forked from apel/apel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapel.spec
More file actions
243 lines (192 loc) · 7.71 KB
/
apel.spec
File metadata and controls
243 lines (192 loc) · 7.71 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# Conditionally define python_sitelib
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
Name: apel
Version: 1.1.3
Release: 0%{?dist}
Summary: APEL packages
Group: Development/Languages
License: ASL 2.0
URL: https://wiki.egi.eu/wiki/APEL
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%define apelconf %_sysconfdir/apel
%description
The apel packages.
The project is written in Python.
%package lib
Summary: Libraries required for Apel Client, Server and Parsers
Group: Development/Languages
Requires: MySQL-python python-ldap python-iso8601
Requires(pre): shadow-utils
%description lib
apel-lib provides required libraries for the rest of APEL system.
%package parsers
Summary: Parsers for APEL system
Group: Development/Languages
Requires: apel-lib >= 1.1.3
Requires(pre): shadow-utils
%description parsers
The apel-parsers package contains parsers for all the batch systems
supported by the APEL system: Torque, SGE and LSF.
%package client
Summary: APEL client package
Group: Development/Languages
Requires: apel-lib >= 1.1.3, apel-ssm
Requires(pre): shadow-utils
%description client
The apel-client package contains all code needed to retrieve data from
the accounting database, process it and send it to the apel server using
SSM.
%package server
Summary: APEL server package
Group: Development/Languages
Requires: apel-lib >= 1.1.3, apel-ssm
Requires(pre): shadow-utils
%description server
The apel-server package contains all code needed to receive accounting data
from clients, to process and to send the results elsewhere using SSM.
%prep
%setup -q -n %{name}-%{version}
%build
%install
rm -rf $RPM_BUILD_ROOT
# Create directories
mkdir -p %{buildroot}%{apelconf}
mkdir -p %{buildroot}%_bindir
mkdir -p %{buildroot}%{python_sitelib}/apel
mkdir -p %{buildroot}%_sysconfdir/logrotate.d
mkdir -p %{buildroot}%_datadir/apel
mkdir -p %{buildroot}%_defaultdocdir
# Directories for logs, PID files
mkdir -p %{buildroot}%{_localstatedir}/log/apel
mkdir -p %{buildroot}%{_localstatedir}/run/apel
# Python libraries
# Library
cp -fr apel/* %{buildroot}%{python_sitelib}/apel
# Scripts
cp bin/client.py %{buildroot}%_bindir/apelclient
cp bin/parser.py %{buildroot}%_bindir/apelparser
cp bin/dbloader.py %{buildroot}%_bindir/apeldbloader
cp bin/dbunloader.py %{buildroot}%_bindir/apeldbunloader
cp bin/summariser.py %{buildroot}%_bindir/apelsummariser
cp bin/retrieve_dns.py %{buildroot}%_bindir/apelauth
# Configuration files
cp conf/client.cfg %{buildroot}%{apelconf}
cp conf/summariser.cfg %{buildroot}%{apelconf}/
cp conf/unloader.cfg %{buildroot}%{apelconf}/
cp conf/loader.cfg %{buildroot}%{apelconf}/
cp conf/db.cfg %{buildroot}%{apelconf}/
cp conf/parser.cfg %{buildroot}%{apelconf}/
cp conf/auth.cfg %{buildroot}%{apelconf}/
# database schemas
cp schemas/client.sql %{buildroot}%_datadir/apel/
cp schemas/server.sql %{buildroot}%_datadir/apel/
cp schemas/cloud.sql %{buildroot}%_datadir/apel/
cp schemas/storage.sql %{buildroot}%_datadir/apel/
# slurm accounting script
cp scripts/slurm_acc.sh %{buildroot}%_datadir/apel/
# message status script
cp scripts/msg_status.py %{buildroot}%_datadir/apel/
%clean
rm -rf $RPM_BUILD_ROOT
%pre server
# Create the apel user if it doesn't exist
getent passwd apel >/dev/null || \
useradd -r apel
exit 0
%files lib
%defattr(-,root,root,-)
%{python_sitelib}/apel
%files parsers
%defattr(-,root,root,-)
%attr(755,root,root) %_bindir/apelparser
%config(noreplace) %{apelconf}/parser.cfg
%attr(600,-,-) %{apelconf}/parser.cfg
%attr(755,root,root) %_datadir/apel/slurm_acc.sh
%files client
%defattr(-,root,root,-)
%_datadir/apel/client.sql
# Directories for logs, PID files
%dir %{_localstatedir}/log/apel
%dir %{_localstatedir}/run/apel
%attr(755,root,root) %_bindir/apelclient
%config(noreplace) %{apelconf}/client.cfg
%attr(600,-,-) %{apelconf}/client.cfg
%files server
%defattr(-,root,root,-)
%_datadir/apel/server.sql
%_datadir/apel/cloud.sql
%_datadir/apel/storage.sql
%attr(755,root,root) %_datadir/apel/msg_status.py
# Directories for logs, PID files
%dir %{_localstatedir}/log/apel
%dir %{_localstatedir}/run/apel
%attr(755,root,root) %_bindir/apeldbunloader
%attr(755,root,root) %_bindir/apeldbloader
%attr(755,root,root) %_bindir/apelsummariser
%attr(755,root,root) %_bindir/apelauth
%config(noreplace) %{apelconf}/summariser.cfg
%config(noreplace) %{apelconf}/unloader.cfg
%config(noreplace) %{apelconf}/loader.cfg
%config(noreplace) %{apelconf}/db.cfg
%attr(600,apel,apel) %{apelconf}/db.cfg
%config(noreplace) %{apelconf}/auth.cfg
%changelog
* Wed Dec 11 2013 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 1.1.3-0
- Added catch for xml parser exceptions to fix db loader crash.
- Changed SLURM parser to handle times greater than a day and unit prefixes
greater than K.
- Added ORDER BY NULL to GROUP BY queries to improve performance.
- Changed client.py to fetch site_name if joiner is enabled to fix crash.
* Fri May 31 2013 Stuart Pullinger <stuart.pullinger@stfc.ac.uk> - 1.1.2-0
- Changed file permissions for parser.cfg, client.cfg and db.cfg
to 0600, owner and group of db.cfg to apel:apel, in apel.spec
* Mon Apr 29 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.1.1-0
- Separate summarising procedure into component parts and use
relevant parts for client.py and summariser.py scripts
* Tue Apr 16 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.1.0-0
- Option to withhold DNs when sending messages
- Update and enable SLURM parser
- Enable parser to reprocess event records
- Fixes to cloud summaries
* Wed Mar 20 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.5-0
- Create, send and receive cloud summaries
- Parse FQAN information and add to CloudRecords table
- Refactor client script and simplify configuration
- First version of SLURM parser (thanks to Lisa Zangrando)
- First version of msg_status script
* Thu Mar 07 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.4-0
- Change primary key on server JobRecords
* Wed Feb 27 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.3-0
- Enable saving accepted messages in dbloader
- Use python-iso8601 for parsing datetimes
- Fixed crash when parsing empty files
- Corrections to CAR syntax
- Fix include_vos and exclude_vos in dbunloader
* Wed Feb 20 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.2-0
- Correct VHepSpecHistory view
- Correct handling of omitted Processors, NodeCount info
* Thu Feb 14 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.1-0
- Remove unnecessary dbld file
- Handle incorrect BDII value for CPUScalingReference
* Sat Jan 26 2013 Will Rogers <will.rogers@stfc.ac.uk> - 1.0.0-0
- More defensive handling of configuration
- First release of new apel
* Thu Jan 24 2013 Will Rogers <will.rogers@stfc.ac.uk> - 0.0.5-0
- Client and parser scripts rewritten to be more logical and simpler
- Use INSERT IGNORE for log file records instead of REPLACE
- Change sync records to reflect any VO or local job filtering
- Make MPI parsing optional
* Wed Jan 16 2013 Will Rogers <will.rogers@stfc.ac.uk> - 0.0.4-0
- Updated to use new cloud schema and message format
* Thu Jan 10 2013 Will Rogers <will.rogers@stfc.ac.uk> - 0.0.3-0
- Loader accepts StAR messages, database updated
- Move to using one specfile, hyphenated rpm names
- Stored procedure improvements
* Thu Dec 13 2012 Will Rogers <will.rogers@stfc.ac.uk> - 0.0.2-0
- Correct database logic. Improve logging.
* Tue Nov 13 2012 Will Rogers <will.rogers@stfc.ac.uk> - 0.0.1-0
- First tag