2121DOCKER_REPO = "fluxrm/flux-core"
2222
2323
24+ def on_master_or_tag (matrix ):
25+ return matrix .branch == "master" or matrix .tag
26+
27+
28+ DEFAULT_MULTIARCH_PLATFORMS = {
29+ "linux/arm64" : {
30+ "when" : on_master_or_tag ,
31+ "suffix" : " - arm64" ,
32+ "command_args" : "--install-only " ,
33+ },
34+ "linux/amd64" : {"when" : lambda _ : True },
35+ }
36+
37+
2438class BuildMatrix :
2539 def __init__ (self ):
2640 self .matrix = []
@@ -137,6 +151,27 @@ def add_build(
137151 }
138152 )
139153
154+ def add_multiarch_build (
155+ self ,
156+ name : str ,
157+ platforms = DEFAULT_MULTIARCH_PLATFORMS ,
158+ default_suffix = "" ,
159+ image = None ,
160+ docker_tag = True ,
161+ ** kwargs ,
162+ ):
163+ for p , args in platforms .items ():
164+ if args ["when" ](self ):
165+ suffix = args .get ("suffix" , default_suffix )
166+ self .add_build (
167+ name + suffix ,
168+ platform = p ,
169+ docker_tag = docker_tag ,
170+ image = image if image is not None else name ,
171+ command_args = args .get ("command_args" , "" ),
172+ ** kwargs ,
173+ )
174+
140175 def __str__ (self ):
141176 """Return compact JSON representation of matrix"""
142177 return json .dumps (
@@ -146,27 +181,85 @@ def __str__(self):
146181
147182matrix = BuildMatrix ()
148183
149- # Fedora40: no args
150- matrix .add_build (name = "fedora40" )
184+ # Multi-arch builds, arm only builds on
185+ bookworm_platforms = dict (DEFAULT_MULTIARCH_PLATFORMS )
186+ bookworm_platforms ["linux/386" ] = {"when" : lambda _ : True , "suffix" : " - 32 bit" }
187+ common_args = (
188+ "--prefix=/usr"
189+ " --sysconfdir=/etc"
190+ " --with-systemdsystemunitdir=/etc/systemd/system"
191+ " --localstatedir=/var"
192+ " --with-flux-security"
193+ " --enable-caliper"
194+ )
195+ matrix .add_multiarch_build (
196+ name = "bookworm" ,
197+ default_suffix = " - test-install" ,
198+ platforms = bookworm_platforms ,
199+ args = common_args ,
200+ env = dict (
201+ TEST_INSTALL = "t" ,
202+ ),
203+ )
204+ matrix .add_multiarch_build (
205+ name = "noble" ,
206+ default_suffix = " - test-install" ,
207+ args = common_args ,
208+ env = dict (
209+ TEST_INSTALL = "t" ,
210+ ),
211+ )
212+ matrix .add_multiarch_build (
213+ name = "el9" ,
214+ default_suffix = " - test-install" ,
215+ args = common_args ,
216+ env = dict (
217+ TEST_INSTALL = "t" ,
218+ ),
219+ )
220+ matrix .add_multiarch_build (
221+ name = "fedora40" ,
222+ default_suffix = " - test-install" ,
223+ args = common_args ,
224+ env = dict (
225+ TEST_INSTALL = "t" ,
226+ ),
227+ )
228+ matrix .add_multiarch_build (
229+ name = "alpine" ,
230+ default_suffix = " - test-install" ,
231+ args = (
232+ "--prefix=/usr"
233+ " --sysconfdir=/etc"
234+ " --with-systemdsystemunitdir=/etc/systemd/system"
235+ " --localstatedir=/var"
236+ " --with-flux-security"
237+ ),
238+ env = dict (
239+ TEST_INSTALL = "t" ,
240+ ),
241+ )
151242
152- # Debian: 32b
243+ # single arch builds that still produce a container
244+ # Ubuntu: TEST_INSTALL
153245matrix .add_build (
154- name = "bookworm - 32 bit" ,
155- image = "bookworm" ,
156- platform = "linux/386" ,
246+ name = "jammy - test-install" ,
247+ image = "jammy" ,
248+ env = dict (
249+ TEST_INSTALL = "t" ,
250+ ),
251+ args = "--with-flux-security --enable-caliper" ,
252+ docker_tag = True ,
253+ )
254+
255+ # Ubuntu 20.04: py3.8, deprecated
256+ matrix .add_build (
257+ name = "focal - py3.8" ,
258+ image = "focal" ,
259+ env = dict (PYTHON_VERSION = "3.8" ),
157260 docker_tag = True ,
158261)
159262
160- # debian/Fedora40: arm64, expensive, only on master and tags, only install
161- if matrix .branch == "master" or matrix .tag :
162- for d in ("bookworm" , "noble" , "fedora40" , "el9" ):
163- matrix .add_build (
164- name = f"{ d } - arm64" ,
165- image = "{d}" ,
166- platform = "linux/arm64" ,
167- docker_tag = True ,
168- command_args = "--install-only " ,
169- )
170263
171264# Debian: gcc-12, content-s3, distcheck
172265matrix .add_build (
@@ -204,47 +297,11 @@ def __str__(self):
204297 args = "--with-flux-security --enable-caliper" ,
205298)
206299
207- # Ubuntu: TEST_INSTALL
208- matrix .add_build (
209- name = "noble - test-install" ,
210- image = "noble" ,
211- env = dict (
212- TEST_INSTALL = "t" ,
213- ),
214- docker_tag = True ,
215- )
216-
217- # el9: TEST_INSTALL
218- matrix .add_build (
219- name = "el9 - test-install" ,
220- image = "el9" ,
221- env = dict (
222- TEST_INSTALL = "t" ,
223- ),
224- platform = "linux/amd64" ,
225- docker_tag = True ,
226- )
227-
228- # Ubuntu 20.04: py3.8
229- matrix .add_build (
230- name = "focal - py3.8" ,
231- image = "focal" ,
232- env = dict (PYTHON_VERSION = "3.8" ),
233- docker_tag = True ,
234- )
235-
236- # RHEL8 clone
237- matrix .add_build (
238- name = "el8" ,
239- image = "el8" ,
240- env = dict (PYTHON_VERSION = "3.6" , LDFLAGS = "-Wl,-z,relro -Wl,-z,now" ),
241- docker_tag = True ,
242- )
243-
244300# RHEL8 clone
245301matrix .add_build (
246302 name = "el8 - ascii" ,
247303 image = "el8" ,
304+ env = dict (PYTHON_VERSION = "3.6" , LDFLAGS = "-Wl,-z,relro -Wl,-z,now" ),
248305 args = "--enable-broken-locale-mode" ,
249306)
250307
@@ -259,34 +316,6 @@ def __str__(self):
259316 args = "--with-flux-security --enable-caliper" ,
260317)
261318
262- # Fedora 40
263- matrix .add_build (
264- name = "fedora40 - gcc-14.1,py3.12" ,
265- image = "fedora40" ,
266- args = (
267- "--prefix=/usr"
268- " --sysconfdir=/etc"
269- " --with-systemdsystemunitdir=/etc/systemd/system"
270- " --localstatedir=/var"
271- " --with-flux-security"
272- " --enable-caliper"
273- ),
274- docker_tag = True ,
275- )
276-
277- matrix .add_build (
278- name = "alpine" ,
279- image = "alpine" ,
280- args = (
281- "--prefix=/usr"
282- " --sysconfdir=/etc"
283- " --with-systemdsystemunitdir=/etc/systemd/system"
284- " --localstatedir=/var"
285- " --with-flux-security"
286- ),
287- docker_tag = True ,
288- )
289-
290319# inception
291320matrix .add_build (
292321 name = "inception" ,
0 commit comments