forked from eclipse-bluechi/bluechi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bluechi.spec.in
501 lines (414 loc) · 17.8 KB
/
bluechi.spec.in
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# python bluechi module is enabled by default, it can be disabled passing `--define "with_python 0"` option to rpmbuild
%if 0%{!?with_python:1}
%global with_python 1
%endif
# coverage collection is disabled by default , it can be enabled passing `--define "with_coverage 1"` option to rpmbuild
%if 0%{?with_coverage}
%global coverage_flags -Dwith_coverage=true
%endif
Name: bluechi
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: A systemd service controller for multi-nodes environments
License: LGPL-2.1-or-later AND CC0-1.0
URL: https://github.com/eclipse-bluechi/bluechi
Vendor: Eclipse BlueChi
Packager: Red Hat
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
# Required to apply the patch
BuildRequires: git-core
BuildRequires: gcc
# Meson needs to detect C++, because part of inih library (which we don't use) provides C++ functionality
BuildRequires: gcc-c++
BuildRequires: meson
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
BuildRequires: golang-github-cpuguy83-md2man
%if 0%{?with_coverage}
BuildRequires: lcov
BuildRequires: sed
%endif
%description
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
##########################
### bluechi-controller ###
##########################
%package controller
Summary: BlueChi service controller
Requires: systemd
Recommends: bluechi-selinux
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte < 0.6.0
Provides: hirte = %{version}-%{release}
Obsoletes: bluechi < 0.7.0
Provides: bluechi = %{version}-%{release}
%description controller
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the controller service.
%post controller
%systemd_post bluechi-controller.service
%preun controller
%systemd_preun bluechi-controller.service
%postun controller
%systemd_postun_with_restart bluechi-controller.service
%files controller
%ghost %{_sysconfdir}/bluechi/controller.conf
%dir %{_sysconfdir}/bluechi
%dir %{_sysconfdir}/bluechi/controller.conf.d
%doc README.md
%doc README.developer.md
%license LICENSE
%{_libexecdir}/bluechi-controller
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Job.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Controller.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Monitor.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Node.xml
%{_datadir}/dbus-1/system.d/org.eclipse.bluechi.conf
%{_datadir}/bluechi/config/controller.conf
%{_mandir}/man1/bluechi-controller.*
%{_mandir}/man5/bluechi-controller.conf.*
%{_sysconfdir}/bluechi/controller.conf.d/README.md
%{_unitdir}/bluechi-controller.service
%{_unitdir}/bluechi-controller.socket
#####################
### bluechi-agent ###
#####################
%package agent
Summary: BlueChi service controller agent
Requires: systemd
Recommends: bluechi-selinux
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte-agent < 0.6.0
Provides: hirte-agent = %{version}-%{release}
%description agent
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the node agent.
%post agent
%systemd_post bluechi-agent.service
%preun agent
%systemd_preun bluechi-agent.service
%postun agent
%systemd_postun_with_restart bluechi-agent.service
%files agent
%ghost %{_sysconfdir}/bluechi/agent.conf
%dir %{_sysconfdir}/bluechi
%dir %{_sysconfdir}/bluechi/agent.conf.d
%doc README.md
%license LICENSE
%{_libexecdir}/bluechi-agent
%{_libexecdir}/bluechi-proxy
%{_datadir}/dbus-1/system.d/org.eclipse.bluechi.Agent.conf
%{_datadir}/bluechi-agent/config/agent.conf
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Agent.xml
%{_mandir}/man1/bluechi-agent.*
%{_mandir}/man1/bluechi-proxy.*
%{_mandir}/man5/bluechi-agent.conf.*
%{_sysconfdir}/bluechi/agent.conf.d/README.md
%{_unitdir}/bluechi-agent.service
%{_userunitdir}/bluechi-agent.service
%{_unitdir}/[email protected]
%{_userunitdir}/[email protected]
%{_unitdir}/[email protected]
%{_userunitdir}/[email protected]
#######################
### bluechi-selinux ###
#######################
%package selinux
Summary: BlueChi SELinux policy
BuildArch: noarch
BuildRequires: checkpolicy
BuildRequires: selinux-policy-devel
%if "%{_selinux_policy_version}" != ""
Requires: selinux-policy >= %{_selinux_policy_version}
%endif
Requires(post): policycoreutils
Obsoletes: hirte-selinux < 0.6.0
Provides: hirte-selinux = %{version}-%{release}
%global selinuxtype targeted
%description selinux
SELinux policy associated with the bluechi and bluechi-agent daemons
%files selinux
%{_datadir}/selinux/devel/include/services/bluechi.if
%{_datadir}/selinux/packages/bluechi.pp.bz2
%{_mandir}/man8/bluechi*selinux.*
%post selinux
# Remove hirte policy
if [ $1 -eq 1 ]; then
semodule -N -X 200 -r hirte 2>/dev/null || true
fi
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/bluechi.pp.bz2
restorecon -R %{_bindir}/bluechi* &> /dev/null || :
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} bluechi
restorecon -R %{_bindir}/bluechi* &> /dev/null || :
fi
###################
### bluechi-ctl ###
###################
%package ctl
Summary: BlueChi service controller command line tool
Requires: %{name} = %{version}-%{release}
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte-ctl < 0.6.0
Provides: hirte-ctl = %{version}-%{release}
%description ctl
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the service controller command line tool.
%files ctl
%doc README.md
%license LICENSE
%{_bindir}/bluechictl
%{_mandir}/man1/bluechictl.*
#########################
### bluechi-is-online ###
#########################
%package is-online
Summary: Command line tool to monitor the connection state of BlueChi's components
Recommends: bluechi-controller = %{version}-%{release}
Recommends: bluechi-agent = %{version}-%{release}
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
%description is-online
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains a command line tool for checking and monitoring the
connection state of BlueChi's core components.
%files is-online
%doc README.md
%license LICENSE
%{_bindir}/bluechi-is-online
%{_mandir}/man1/bluechi-is-online.*
#######################
### python3-bluechi ###
#######################
%if %{with_python}
%package -n python3-bluechi
Summary: Python bindings for BlueChi
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-dasbus
Obsoletes: python3-hirte < 0.6.0
Provides: python3-hirte = %{version}-%{release}
%description -n python3-bluechi
bluechi is a python module to access the public D-Bus API of BlueChi project.
It contains typed python code that is auto-generated from BlueChi's
API description and manually written code to simplify recurring tasks.
%files -n python3-bluechi
%license LICENSE
%doc README.md
%{python3_sitelib}/bluechi-*.egg-info/
%{python3_sitelib}/bluechi/
%endif
########################
### bluechi-coverage ###
########################
%if 0%{?with_coverage}
%package coverage
Summary: Code coverage files for BlueChi
%description coverage
This package contains code coverage files created during the build. Those files
will be used during integration tests when creating code coverage report.
%files coverage
%license LICENSE
%{_datadir}/bluechi-coverage/bin/*
%{_datadir}/bluechi-coverage/*
%dir %{_localstatedir}/tmp/bluechi-coverage/
%endif
%prep
%autosetup -S git_am
%build
%meson -Dapi_bus=system %{?coverage_flags}
%meson_build
%if %{with_python}
pushd src/bindings/python
%py3_build
popd
%endif
%install
%meson_install
%if 0%{?with_coverage}
mkdir -p %{buildroot}/%{_datadir}/bluechi-coverage/bin
cp tests/scripts/gather-code-coverage.sh %{buildroot}/%{_datadir}/bluechi-coverage/bin
cp tests/scripts/setup-src-dir-for-coverage.sh %{buildroot}/%{_datadir}/bluechi-coverage/bin
mkdir -p %{buildroot}/%{_datadir}/bluechi-coverage/unit-test-results
mkdir -p %{buildroot}/%{_localstatedir}/tmp/bluechi-coverage/
%endif
%if %{with_python}
pushd src/bindings/python
%py3_install
popd
%endif
%check
%meson_test
%if 0%{?with_coverage}
# Generate code coverage report from unit tests execution
build-scripts/generate-unit-tests-code-coverage.sh %{_vpath_builddir} %{buildroot}/%{_datadir}
%endif
%changelog
* Tue Nov 12 2024 Michael Engel <[email protected]> - 0.9.0-1
- BlueChi's SELinux policy has been refined and changed from permissive to enforced
- New package: bluechi-is-online
- Added a configurable heartbeat and threshold from bluechi-controller to bluechi-agent
- Added a configurable threshold in bluechi-controller to actively disconnect an unresponsive bluechi-agent
- Added monotonic timestamp properties to D-Bus API
- Added GetUnitFileState method to D-Bus API and is-enabled command to bluechictl
- Added KillUnit method to D-Bus API and kill command to bluechictl
- Added ResetFailed and ResetFailedUnit to D-Bus API and respective commands to bluechictl
- Added ListUnitFiles to D-Bus API and list-unit-files command to bluechictl
- Added GetDefaultTarget and SetDefaultTarget to D-Bus API and respective commands to bluechictl
- Added specific usage functions for commands to bluechictl
- Changed the register call of bluechi-agent to be asynchronous
- Fixed the order of disconnect and controller address changed on calling SwitchController
- Fixed updating the displayed peer IP when a node changes connection state in bluechictl
- Fixed determining the peer IP address of the agent
- Improved debug logging in bluechi-agent, bluechi-controller and bluechictl
- Updated the python bindings for BlueChi's D-Bus API
* Mon Apr 29 2024 Michael Engel <[email protected]> - 0.8.0-1
- Breaking change: Removed obsolete API method Ping
- Fixed .conf suffix check for conf.d files
- Fixed memory leak in bluechictl
- Fixed memory leaks in bluechi-agent
- Fixed bluechictl when fetching status of multiple services
- Fixed segfault when calling set-loglevel API with invalid loglevel
- Fix memory deallocation issue in node_method_set_log_level()
- Cleanup controller when start fails to prevent memory leaks
- Added watch option to bluechictl status
- Changed output of bluechictl status from stderr to stdout
- Implemented D-Bus API for cancelling a Job
- Added IP to of registered nodes as D-Bus property and to the ListUnits API
- Added D-Bus properties for LogLevel and LogTarget of bluechi-controller and bluechi-agent
- Added D-Bus on bluechi-agent to switch the bluechi-controller
- Refactored functions for loading the configuration
- Improved the output of bluechictl list-units
- Improved the formatted output of the dumped config of bluechi-controller and bluechi-agent on startup
- bluechictl monitor flushes stdout for each iteration
- Replaced the function for the D-Bus property of the node name by offsetof
- Removed unused code bluechi-controller and libbluechi
- BlueChi's SELinux policy has been extended by a tunable policy to dis-/allow any port
- BlueChi's python bindings are now formatted and ordered via unified tooling
- Updated the python bindings for BlueChi's D-Bus API
* Wed Jan 17 2024 Michael Engel <[email protected]> - 0.7.0-1
- Breaking change: Completed renaming of manager to controller in configuration, API, etc.
- Breaking change: Removed D-Bus method Shutdown from controller and agent
- Breaking change: Removed bluechictl monitor node-connection
- Added watch option to bluechictl for bluechictl status
- Added system status property on org.eclipse.bluechi.Manager
- Introduced pre-shutdown hook to ensure final signals are emitted
- Added flags to enable and disable commands in bluechictl
- Refactored bluechictl and introduced command pattern
- Added TCP KeepAlive options to configuration
- Added IP_RECV_ERR option to configuration
- Enable quicker tcp error notification by setting IP_RECV_ERR
- Extended monitor API by adding and removing peers
- Send monitor signals only to peer
- Added log statements when sending monitor signals fail
- Upgraded subproject hashmap.c to v0.7.0
- Check for proxy service list being empty instead of NULL on shutdown
- Fixed check that agent started successfully
- Fixed memory leak when assembling monitoring signals
- Added error log when at least one list units request fails
- Integration tests are run with valgrind on testing farm
- Integration tests produce a coverage report in GH workflow
- Added more integration tests for new peer API, -c option and more
- BlueChi logo has been added to the project
- Added documentation about monitoring has been added
- Added documentation about securint BlueChi with mTLS and double proxy
* Mon Nov 13 2023 Michael Engel <[email protected]> - 0.6.0-1
- Moved from containers to eclipse-bluechi organization
- Renamed bluechi to bluechi-controller for binary, rpm and documentation
- Snapshot builds are now available in the centos-sig-automotive COPR group
- Moved bluechi binaries to /usr/libexec for auto-completion
- Introduced packit for builds and running integration tests on testing farm
- Introduced initial implementation for a tool to test FFI of BlueChi
- Introduced clang/LLVM support
- Added properties and signals for connection status and disconnected timestamp to Agent's public API
- Removed duplicate NodeConnectionStateChanged signal from bluechi-controller
- CLI option for the version (-v) prints version and git commit hash for non-release builds
- Extended BlueChi's public D-Bus API specification by inline-comments
- Added EmitsChangedSignal annotation to properties in BlueChi's public D-Bus API specification
- Enhanced typed python bindings generator to use inline-comments from specification
- Enhanced typed python bindings generator to provide listener functions for property changed signals
- Fixes in the D-Bus API description
- Improved error messages returned by D-Bus API
- Added static code analysis from gcc and fixed detected issues
- Added a graceful node shutdown in bluechi-controller
- Fixed a few smaller memory leaks
- Fixed bug where configured manager address was overridden on connection failure
- Fixed bug where removing a subscription was not prevented
- Fixed race condition leading bluechi-proxy and bluechi-dep service to transition into failed state
- NULLing pointers after free for better code hygiene, preventing invalid reads
- Extended integration tests to run with valgrind to detect memory leaks
- Added more integration tests
- Reworked Getting Started documentation
- Reworked Proxy Service documentation and added examples and limitations
- Aligned and added API examples for Python, Go and Rust
- Changed the license for python bindings to MIT-0
* Mon Sep 04 2023 Michael Engel <[email protected]> - 0.5.0-1
- Changing the name of the project from hirte to BlueChi
- Changing the license of the project from GPL-2.0-or-later to LGPL-2.1-or-later
- Changing the license of API examples to CC0-1.0
- Changing the license of typed python bindings package to CC0-1.0
- New feature: freeze and thaw units via BlueChi
- Added CLI option to all binaries to print the version
- A heartbeat interval of 0 disables it instead of spamming the signal
- A disconnecting, anonymous node doesn't lead to a segfault anymore
- Fixed a few smaller memory leaks
- Increased the maximum line length and added multi-line support for configuration files
- Improved error message when parsing configuration file fails
- Python bindings use the property annotation for D-Bus properties
- Fixes in the typed python bindings generator
- Fixes in the D-Bus API description
- The default log target has been set to journald
- Updates to Mkdocs like adding GoLang and Rust example
- Added more unit and integration tests
* Mon Jul 10 2023 Michael Engel <[email protected]> - 0.4.0-1
- Defaults for hirtectl monitor defaults defined and documented
- Dedicated signal is emitted when a node changes its connection state
- Added a last seen timestamp of a node as a D-Bus property
- Added new command to hirtectl to monitor node connections
- Support of FQDN in ManagerHost
- Support of IPv6 in ManagerHost
- Added hirtectl command to get the status of a unit
- Autogenerated, typed python bindings
- New rpm package for the typed python bindings of hirte's D-Bus API
- API and hirtectl commands for setting the loglevel at runtime
- Fixes in the D-Bus API description
* Wed May 31 2023 Michael Engel <[email protected]> - 0.3.0-1
- API and hirtectl commands for enabling, disabling and reloading of systemd units added
- Glob filter option to hirtectl list-units
- Collecting metrics for unit startup time
- Improvements for building hirte RPMs
- Allow hirte to run with unconfined user
- Aligned naming of hirte config files
- Fixed for invalid type cast of ProxyMonitor
- Mkdocs-based documentation added
- Wildcard support for monitoring units
* Wed May 03 2023 Michael Engel <[email protected]> - 0.2.1-1
- RPM and unit test fixes
* Tue Apr 25 2023 Michael Engel <[email protected]> - 0.2.0-1
- Heartbeat interval configurable
- Restart for hirte and hirte-agent systemd unit added
- Logging improvements
- SELinux policy added
- Defaults for node name and manager host in code
- Fix conf.d usage and memory leaks
* Tue Mar 21 2023 Martin Perina <[email protected]> - 0.1.0-1
- Initial release