Skip to content

Commit d8d9452

Browse files
Merge branch 'pre-release' into stable
2 parents 7135b98 + c4f6c11 commit d8d9452

21 files changed

+824
-311
lines changed

BUILD.rst

+382
Large diffs are not rendered by default.

Makefile

+15-9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ SARRA_LINK = '-Wl,-rpath,$$ORIGIN/../lib' -L${SARRA_LIBDIR}
2222

2323
CC = gcc
2424

25+
VERSION = $(shell head -1 debian/changelog| sed 's/.*(//' | sed 's/).*//')
26+
MAJOR_VERSION = $(shell echo "$(VERSION)" | sed 's+\..*++g' )
27+
2528
# can also use intel compiller just by changing CC
2629
# CC = icc
2730

@@ -37,29 +40,31 @@ LIBCLOCATION=$(shell ldd /bin/sh | awk '/libc\.so\./ { print; }' | cut -d' ' -f3
3740
# also remove -ljson-c from EXT_LIB declaration.
3841
# to work with sr3, change SR_APPNAME=\"sr3\" ... otherwise will be managed by version 2.
3942
# on Power9, -fstack-check causes coredumps, so removed for now.
43+
# On RHEL8, add -DINTERCEPT_SYSCALL to handle cases where mv calls syscall directly, instead of calling renameat2.
44+
# See sarrac issue #145 for more information about syscall/renameat2.
4045

4146
CFLAGS = -DHAVE_JSONC -DSR_APPNAME=\"sr3\" -DFORCE_LIBC_REGEX=\"$(LIBCLOCATION)\" -fPIC -ftest-coverage -std=gnu99 -Wall -g -D_GNU_SOURCE $(RABBIT_INCDIR)
4247

4348
SARRA_HEADER = sr_cache.h sr_config.h sr_consume.h sr_context.h sr_credentials.h sr_event.h sr_post.h sr_util.h sr_version.h uthash.h
4449
SARRA_OBJECT = sr_post.o sr_consume.o sr_context.o sr_config.o sr_event.o sr_credentials.o sr_cache.o sr_util.o
45-
SARRA_LIB = libsr3c.so.1.0.0
50+
SARRA_LIB = libsr3c.so.$(VERSION)
4651
EXT_LIB = -ljson-c -lrabbitmq -lcrypto -lc
47-
SHARED_LIB = libsr3shim.so.1 -o libsr3shim.so.1.0.0 libsr3shim.c libsr3c.so.1.0.0
52+
SHARED_LIB = libsr3shim.so.$(MAJOR_VERSION) -o libsr3shim.so.$(VERSION) libsr3shim.c libsr3c.so.$(VERSION)
4853

4954
.c.o: $(SARRA_HEADER) Makefile
5055
$(CC) $(CFLAGS) -c $<
5156

5257
# head -1 debian/changelog | sed 's/.*(//' | sed 's/).*//'
5358
all: sr_version.h $(SARRA_OBJECT)
54-
$(CC) $(CFLAGS) -shared -Wl,-soname,libsr3c.so.1 -o libsr3c.so.1.0.0 $(SARRA_OBJECT) -ldl $(RABBIT_LINK) $(EXT_LIB)
59+
$(CC) $(CFLAGS) -shared -Wl,-soname,libsr3c.so.$(MAJOR_VERSION) -o libsr3c.so.$(VERSION) $(SARRA_OBJECT) -ldl $(RABBIT_LINK) $(EXT_LIB)
5560
$(CC) $(CFLAGS) -shared -Wl,-soname,$(SHARED_LIB) -ldl $(SARRA_LINK) $(RABBIT_LINK) $(EXT_LIB)
5661
if [ ! -f libsr3c.so ]; \
5762
then \
58-
ln -s libsr3c.so.1.0.0 libsr3c.so ; \
63+
ln -s libsr3c.so.$(VERSION) libsr3c.so ; \
5964
fi;
60-
if [ ! -f libsr3c.so.1 ]; \
65+
if [ ! -f libsr3c.so.$(MAJOR_VERSION) ]; \
6166
then \
62-
ln -s libsr3c.so.1.0.0 libsr3c.so.1 ; \
67+
ln -s libsr3c.so.$(VERSION) libsr3c.so.$(MAJOR_VERSION) ; \
6368
fi;
6469
$(CC) $(CFLAGS) -o sr_configtest sr_configtest.c -lsr3c $(SARRA_LINK) -lrabbitmq $(RABBIT_LINK) -lcrypto
6570
$(CC) $(CFLAGS) -o sr_utiltest sr_utiltest.c -lsr3c $(SARRA_LINK) -lrabbitmq $(RABBIT_LINK) -lcrypto
@@ -70,14 +75,15 @@ all: sr_version.h $(SARRA_OBJECT)
7075
#debian/changelog: ../sarracenia/debian/changelog
7176
# sed 's/^metpx-sarracenia/libsarra-c/' <../sarracenia/debian/changelog >debian/changelog
7277

78+
7379
sr_version.h: debian/changelog
74-
echo "#define __sarra_version__ \"`head -1 debian/changelog| sed 's/.*(//' | sed 's/).*//'`\"" >sr_version.h
80+
echo "#define __sarra_version__ \"$(VERSION)\"" >sr_version.h
7581

7682
install:
7783
@mkdir -p build build/bin build/lib build/include
7884
@mv *.so build/lib
79-
@mv *.so.1 build/lib
80-
@mv *.so.*1.0.0 build/lib
85+
@mv *.so.$(MAJOR_VERSION) build/lib
86+
@mv *.so.*$(VERSION) build/lib
8187
@mv sr3_cpost build/bin
8288
@mv sr3_cpump build/bin
8389
@cp *.h build/include/

README.rst

+4-175
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,6 @@ NOTE:
174174
The tests are disabled for now because the C consumer does lose messages.
175175

176176

177-
Source Code Documentation
178-
-------------------------
179-
180-
Partial implementation of Doxygen docs.
181-
to view::
182-
183-
sudo apt install doxygen
184-
sudo apt install graphviz
185-
doxygen
186-
187-
and run, and it will create the browseable docs/html/ subdirectory
188-
with some documentation. Although only a few files out of the total
189-
have been properly annoted so far, doxygen is configured to extract
190-
as much information from the code as possible. (We have some pretty
191-
call/caller graphs now!)
192-
193177
Limitations of the C implementation
194178
-----------------------------------
195179

@@ -205,74 +189,6 @@ Limitations of the C implementation
205189
- The C implementation uses the libc(7) regular expression routines, which
206190
are a little more limited than python ones.
207191

208-
Build Dependencies
209-
------------------
210-
211-
The librabbitmq version needs to be > 0.8, this is newer than what is in
212-
ubuntu 16.04. So you need to git clone from https://github.com/alanxz/rabbitmq-c
213-
then built it there. The launchpad PPA has a backport included to take care of
214-
this::
215-
216-
export RABBIT_BUILD=*directory where rabbit has been built*
217-
218-
219-
librabbitmq-dev - AMQP client library written in C - Dev Files
220-
libssl-dev - OpenSSL client library (used for hash algorithms.)
221-
libjson-c-dev - json-c header files.
222-
223-
run dependencies::
224-
225-
librabbitmq4 - AMQP client library written in C
226-
libssl - OpenSSL client library.
227-
libjson-c3 - JSON manupulation library (for v03 parsing)
228-
229-
On RPM-based distributions::
230-
231-
librabbitmq-devel
232-
json-c-devel
233-
234-
This JSON library changed API multiple times in it's history. Sarrac development
235-
platform is ubuntu 18.04, where the libjson-c3 library is provided. Older linux
236-
versions may have incompatible library versions and may not build or run correctly.
237-
The Makefile includes the -DHAVE_JSONC option in CFLAGS. Removing this option
238-
disables v03 message parsing, but makes it possible to build on such systems.
239-
v03 posting will still work (dependency only required to receive messages.)
240-
241-
BUILD OPTIONS
242-
-------------
243-
244-
FORCE_LIBC_REGEX
245-
~~~~~~~~~~~~~~~~
246-
247-
This option is set by default as it is usually desired.
248-
If you see::
249-
250-
2018-11-21 00:08:17,315 [ERROR] invalid regular expression: .*\/tmp\/.*. Ignored
251-
252-
and the regex is valid... the symptom we had was that the library was
253-
calling a version of the regular expresison routines included in a binary
254-
(ksh93 in this case) instead of the ones in libc that were expected.
255-
without this option being set, the shim library will compile and user
256-
Korn Shell regular expression grammar instead of the libc/posix ones.
257-
This is confusing in practice.
258-
259-
Set the option::
260-
261-
-DFORCE_LIBC_REGEX=\"/lib/x86_64-linux-gnu/libc.so.6\"
262-
263-
to the file containing the regcomp and regexec routines what are to be
264-
used. The code uses dynamic library loading to force use of the specified
265-
routines. Obviously this setting is architecture dependent and would
266-
need adjustment if compiling on another platform, such as ARM or MIPS.
267-
268-
SR_DEBUG_LOGS
269-
~~~~~~~~~~~~~
270-
271-
To disable all log file support, so that diagnostics messages
272-
are sent to standard error instead, include::
273-
274-
-DSR_DEBUG_LOGS=1
275-
276192

277193
Dorval Computing Centre
278194
-----------------------
@@ -289,100 +205,13 @@ To load sr3_cpost::
289205
290206
or it may be installed in the system locations (/usr/bin, etc...)
291207

208+
Build Process
209+
-------------
292210

293-
Branches
294-
--------
295-
296-
The main repository of sarrac is: https://github.com/MetPX/sarrac
297-
As of 2022/12, development is on v3 compatible version of sarrac.
298-
The customer switched to sr3, so there is no need to continue with v2.
299-
The existing git branches and their roles:
300-
301-
* development ... the default development branch, launchpad.net daily packages built from here.
302-
* pre-release ... v03 pre-release branch, tracks development punctually. launchpad.net pre-release packages built from here.
303-
* stable ... v03 release branch, tracks pre-release punctually. launchpad.net stable packages built from here.
304-
* v2 ... v2 development branch. (legacy)
305-
* v2_stable ... v2 release branch, tracks v2 punctually. (legacy)
306-
* issueXXX ... branch developed to address a particular issue.
211+
See `Building from Source <BUILD.rst>`_
307212

308213

309214
Release Process
310215
---------------
311216

312-
To note changes:
313-
- Compile once with -DSR_DEBUG_LOGS to verify that no msg_log calls have errors (compiler will report)
314-
- build package (without -DSR_DEBUG_LOGS) and install.
315-
- run some ./test scripts.
316-
- make trust_but_verify
317-
examine results, which include a valgrind run.
318-
- Run through a flow test.
319-
- dch, and add your points.
320-
- when ready to release, edit UNRELEASED to an appropriate status, usually unstable.
321-
- git commit #what you need to commit...
322-
- git tag <release> -m <release>
323-
- git push
324-
- git push origin <release>
325-
326-
- go to Launchpad, and import source `here <https://code.launchpad.net/~ssc-hpc-chp-spc/metpx-sarrac/+git/master>`_.
327-
- go to launchpad, find the recipe and Request Build `here <https://code.launchpad.net/~ssc-hpc-chp-spc/+recipe/metpx-sarrac>`_.
328-
329-
330-
Building RPMS
331-
-------------
332-
333-
clone source to metpx-sr3c directory (needed by rpm build rules)::
334-
335-
git clone https://github.com/MetPX/sarrac metpx-sr3c
336-
cd sr3c
337-
338-
on Suse::
339-
340-
zypper addrepo https://download.opensuse.org/repositories/network:messaging:amqp/openSUSE_Leap_15.1/network:messaging:amqp.repo
341-
zypper refresh
342-
zypper install librabbitmq4 librabbitmq-devel
343-
zypper install libopenssl-devel libjson-c-devel
344-
make rpm_suse15
345-
346-
on Redhat/Centos::
347-
348-
make rpm_rhel7
349-
350-
351-
( notes from: https://github.com/MetPX/sarrac/issues/73 )
352-
353-
354-
Proposed Coding Style Guidelines
355-
--------------------------------
356-
357-
Generally, we used `Linux Kernel C Guidelines <https://www.kernel.org/doc/html/v4.10/process/coding-style.html>`_
358-
359-
but with one pythonic affectation: You know Rule 1? about the tabs with 8 characters? This code base is normally
360-
indented like python instead, use four spaces, and not tabs.
361-
362-
Also, in terms of documenting code, when adding new things one should add comments
363-
keeping in minde compatbility with `doxygen <http://www.doxygen.nl/manual/docblocks.html>`_
364-
Examples::
365-
366-
/**
367-
* descriptive comment above a struct or function declaration.
368-
*/
369-
370-
/**
371-
* sr_config_find_one() - find the name configuration file name
372-
* \param sr_cfg: The configuration to be updated with the configuration found.
373-
* \param original_one: The name provided by the user.
374-
*
375-
* Return pointer to the matching mask if there is one, NULL otherwise.
376-
* The pointer to char will hold the absolute path of the config file corresponding to original_one
377-
*
378-
* Return: pointer to a static char buffer with a path name to the corresponding configuration file.
379-
*/
380-
381-
char foo; /**< description of foo class member */
382-
383-
384-
The code has a mix of comments is not entirely doxygen friendly just yet. Feel free
385-
to improve. Other than that... the kernel C guidelines are the rule.
386-
387-
FIXME: We ran a code reformatter on it once... should probably repeat from time to time, would be
388-
useful to document which one was used. I believe it undoes for the pythonic exception.
217+
See `Releases <Release.rst>`_

RELEASE.rst

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
------------------------------
3+
Making a Release of MetPX-sr3c
4+
------------------------------
5+
6+
Release Targets:
7+
8+
* hpc: intel and powerpc
9+
* launchpad: whatever platforms it builds for (ARM would be cool.)
10+
* upload packages to github, which acts as central node for release notifications.
11+
12+
* See `Build <Build.rst>`_ for instructions on local building.
13+
14+
Pre-Rrelease QA/Validation
15+
--------------------------
16+
17+
Finalize the changes:
18+
19+
- update debian/changelog appropriately for the release.
20+
- in debian/changelog, Set the version on the first line correctly. This version will determine the label on the built packages, regardless of git tag. (perhaps use dch on debian/ubuntu system.)
21+
- Compile once with -DSR_DEBUG_LOGS to verify that no msg_log calls have errors (compiler will report)
22+
- make trust_but_verify
23+
examine results, which include a valgrind run.
24+
25+
Once that is clean, proceed to the Pre-Release Porting:
26+
27+
Pre-Release Porting
28+
~~~~~~~~~~~~~~~~~~~
29+
30+
Development is mostly done on new operating systems. The most important platforms
31+
for deployment, however, are pretty old.
32+
33+
Prior to doing a full release, should install on all platforms and run tests. on Github,
34+
these tests are done by Actions automatically, so one just has to review results for
35+
ubuntu 20.04, 22.04, and 24.04. However one must run the tests manually on the following
36+
platforms:
37+
38+
for each of:
39+
40+
* redhat8
41+
* redhat9
42+
* ubuntu18
43+
44+
do:
45+
46+
* https://github.com/MetPX/sarrac/blob/development/BUILD.rst#testing
47+
* then install the package locally: either
48+
49+
* https://github.com/MetPX/sarrac/blob/development/BUILD.rst#build-a-debian-package or
50+
* https://github.com/MetPX/sarrac/blob/development/BUILD.rst#build-a-debian-package
51+
52+
* install them...
53+
54+
* rpm -ivh or dpkg -i ...
55+
56+
* then run the python flow_tests. as per the python package documentation:
57+
58+
* https://metpx.github.io/sarracenia/Contribution/Release.html#pre-release-overview
59+
60+
61+
Release Process
62+
---------------
63+
64+
To note changes:
65+
66+
- install package so that it is used for flow tests on at least one platform.
67+
- find redhat8 (with local disk) and run make test_shim
68+
69+
- on redhat8, edit Makefile to add -DINTERCEPT_SYSCALL to CFLAGS.
70+
71+
- find ubuntu18 (with local disk) and run make test_shim.
72+
- dch, and touch up your points if need be.
73+
- when ready to release, edit UNRELEASED to an appropriate status, usually unstable.
74+
- git commit #what you need to commit...
75+
- git tag <release> -m <release>
76+
- git push
77+
- git push origin <release>
78+
79+
- go to Launchpad, and import source `here <https://code.launchpad.net/~ssc-hpc-chp-spc/metpx-sarrac/+git/master>`_.
80+
- go to launchpad, find the recipe and Request Build `here <https://code.launchpad.net/~ssc-hpc-chp-spc/+recipe/metpx-sr3c-pre-release>`_.
81+
- go to an hpc account (on an intel node)
82+
* mkdir ~/Sarracenia; cd ~/Sarracenia
83+
* git clone https://github.com/MetPX/sarrac metpx-sr3c
84+
* edit Makefile to add -DINTERCEPT_SYSCALL to CFLAGS.
85+
* cd metpx-sr3c
86+
* make rpm_rhel7
87+
* rpm -ivh ~/rpmbuild/RPMS/_platform_/*version*.rpm (if upgrading, -Uvh)
88+
89+
- go to a hpc account on a powerpc node
90+
* cd Sarracenia/metpx-sr3c
91+
* make clean
92+
* make rpm_rhel7
93+
* rpm -ivh ~/rpmbuild/RPMS/_platform_/*version*.rpm
94+
95+
The rpm build targets run *rpmbuild* which places the packages in a standard tree in the user account:
96+
~/rpmbuild/RPMS/<arch>/..rpm on each arch the rpm will be created in the appropriate directory.
97+
98+

debian/changelog

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
metpx-sr3c (3.24.02) unstable; urgency=medium
1+
metpx-sr3c (3.24.07) unstable; urgency=medium
22

3+
* fix #154 rename ignored when one end is outside tree being watched with inotify.
4+
* support #147 coreutils using syscall instead of renameat2 on redhat8 and
5+
ubuntu 18.
6+
* fix #148 sr3_cpost posting messages with corrupt topics if relPath blank.
37
* fix #141 sr3_cpost in a tree being mirrored (conflict with shim)
48
* tests: fix for link modification times cannot be preserved.
59
* test fixes for changes in python side.
610
* README revised to reflect that cpump is not resilient to failure.
711
* fix #133 read some non-utf8 fields (instead of erroring.)
812
* last tx/rx should be cumulative, reset less often.
13+
* fix SR_DEBUG_LOGS being broken by addition of context to api signature
14+
* tests working on RedHat 8 and 9
915

10-
-- peter <[email protected]> Tue, 15 Jan 2024 08:26:22 -0500
16+
-- Reid Sunderland <[email protected]> Mon, 12 Aug 2024 15:06:22 -0600
1117

1218
metpx-sr3c (3.23.11p3) unstable; urgency=medium
1319

0 commit comments

Comments
 (0)