-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaurora.spec
171 lines (145 loc) · 5.52 KB
/
aurora.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# To build:
#
# This spec is intended for use with tito/mock, but can be adapted for the
# typical rpm build process. Instructions are for tito/mock, with the
# assumption you are building on a machine with tito and mock installed.
#
# 1) Create your repo for tito, copying the contents of incubator-aurora repo
# to SOURCES/aurora. Be sure to use or track the correct branch you want to
# deploy.
#
# 2) Copy this spec file into the SOURCES/aurora folder.
#
# 3) Ensure that the mesos python egg (tested against 0.18.0) is available
# from your local pypi and setting the appropriate variable in pants.ini
# OR do a horrible hack by copying the egg into the repo as follows:
#
# cp mesos-0.18.0-py2.7-linux-x86_64.egg SOURCES/aurora/.pants.d/python/eggs/
#
# 4) Push to remote.
#
# 5) Clone the repo onto the machine that has tito/mock and cd SOURCES/aurora
#
# 6) run 'tito tag'
#
# 7) mkdir ~/tmp/tito; tito build --srpm -o ~/tmp/tito
# Check the output to find the correct src.rpm to use in the next step.
#
# 8) mock -vr centos6 ~/tmp/tito/aurora-0.5.0-1.el6.rc0.src.rpm
# Use an architecture of your choosing. Tested on SL and Centos.
%define install_base /opt
Name: aurora
Version: 0.7
Release: 1%{?dist}.rc0
Summary: A framework for scheduling long-running services against Apache Mesos
License: ASL 2.0
URL: http://%{name}.incubator.apache.org/
Source0: aurora-0.7.0.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: java-1.8.0-openjdk
BuildRequires: java-1.8.0-openjdk-devel
BuildRequires: mesos
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: tar
BuildRequires: unzip
BuildRequires: which
BuildRequires: zip
BuildRequires: wget
BuildRequires: curl
%description
Apache Aurora is a service scheduler that runs on top of Mesos, enabling you
to schedule long-running services that take advantage of Mesos\' scalability,
fault-tolerance, and resource isolation.
%package client
Summary: Client tools for interacting with the scheduler.
Group: Development/Tools
%description client
Provides aurora_admin and aurora_client binaries.
%package scheduler
Summary: The master scheduler portion of Aurora.
Group: Applications/System
Requires: java-1.8.0-openjdk
Requires: java-1.8.0-openjdk-devel
Requires: mesos
Requires: mesos-python
Requires: python
%description scheduler
Apache Aurora is a service scheduler that runs on top of Mesos, enabling you
to schedule long-running services that take advantage of Mesos\' scalability,
fault-tolerance, and resource isolation.
%package thermos
Summary: A simple Pythonic process management framework for Mesos chroots
Group: Applications/System
Requires: mesos
Requires: mesos-python
Requires: python
%description thermos
Thermos a simple process management framework used for orchestrating
dependent processes within a single Mesos chroot.
%prep
%setup -q
%build
# Download and add python egg if not exists
mkdir -p ./.pants.d/python/eggs/
cd ./.pants.d/python/eggs/
# TODO Implament if file exists method out of systemctl-inst command next time
wget http://downloads.mesosphere.io/master/centos/7/mesos-0.21.1-py2.7-linux-x86_64.egg
# Add custom python2.7 to path.
# export PATH=/usr/python2.7/bin:$PATH
# export JAVA_HOME=/usr
# The main aurora distribution.
./gradlew distZip
# Client binaries.
./pants build -i 'CPython>=2.7.0' src/main/python/apache/aurora/client/bin:aurora_admin
./pants build -i 'CPython>=2.7.0' src/main/python/apache/aurora/client/bin:aurora_client
# Executors/observers.
./pants build -i 'CPython>=2.7.0' src/main/python/apache/aurora/executor/bin:gc_executor
./pants build -i 'CPython>=2.7.0' src/main/python/apache/aurora/executor/bin:thermos_executor
./pants build -i 'CPython>=2.7.0' src/main/python/apache/aurora/executor/bin:thermos_runner
./pants build -i 'CPython>=2.7.0' src/main/python/apache/thermos/observer/bin:thermos_observer
# Package thermos runner within the observer.
python <<EOF
import contextlib
import zipfile
with contextlib.closing(zipfile.ZipFile('dist/thermos_executor.pex', 'a')) as zf:
zf.writestr('apache/aurora/executor/resources/__init__.py', '')
zf.write('dist/thermos_runner.pex', 'apache/aurora/executor/resources/thermos_runner.pex')
EOF
%install
rm -rf %{buildroot}
%define _prefix %{install_base}/aurora
install -d -m 755 %{buildroot}%{_prefix}
unzip dist/distributions/aurora-scheduler-*.zip -d .
mv aurora-scheduler-*/bin %{buildroot}%{_prefix}/
mv aurora-scheduler-*/lib %{buildroot}%{_prefix}/
install -m 755 dist/aurora_admin.pex %{buildroot}%{_bindir}/aurora_admin
install -m 755 dist/aurora_client.pex %{buildroot}%{_bindir}/aurora_client
%define _prefix %{install_base}/thermos
install -d -m 755 %{buildroot}%{_bindir}
install -m 755 dist/gc_executor.pex %{buildroot}%{_bindir}/gc_executor
install -m 755 dist/thermos_executor.pex %{buildroot}%{_bindir}/thermos_executor
install -m 755 dist/thermos_runner.pex %{buildroot}%{_bindir}/thermos_runner
install -m 755 dist/thermos_observer.pex %{buildroot}%{_bindir}/thermos_observer
%clean
rm -rf %{buildroot}
%files client
%defattr(-,root,root,-)
%define _prefix %{install_base}/aurora
%{_bindir}/aurora_admin
%{_bindir}/aurora_client
%files scheduler
%defattr(-,root,root,-)
%define _prefix %{install_base}/aurora
%{_bindir}/aurora-scheduler
%{_bindir}/aurora-scheduler.bat
%{_prefix}/lib/*
%files thermos
%defattr(-,root,root,-)
%define _prefix %{install_base}/thermos
%{_bindir}/gc_executor
%{_bindir}/thermos_executor
%{_bindir}/thermos_runner
%{_bindir}/thermos_observer