Merge ~andersson123/autopkgtest-cloud:amend_trusty_service_files into autopkgtest-cloud:master

Proposed by Tim Andersson
Status: Merged
Approved by: Brian Murray
Approved revision: 8a85aee1a4ccb49a03bb1b471afd002fab2594f6
Merged at revision: a99bab45e59b21a2f11dcf11ac5d78827ad4e5fb
Proposed branch: ~andersson123/autopkgtest-cloud:amend_trusty_service_files
Merge into: autopkgtest-cloud:master
Diff against target: 69 lines (+33/-2)
2 files modified
charms/focal/autopkgtest-cloud-worker/lib/systemd.py (+32/-1)
mojo/service-bundle (+1/-1)
Reviewer Review Type Date Requested Status
Brian Murray Needs Fixing
Review via email: mp+454132@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

ready for review

Revision history for this message
Tim Andersson (andersson123) wrote :

amended, removed some unnecessary changes, please review.

Revision history for this message
Brian Murray (brian-murray) wrote :

I think at least one change is necessary and another would be nice to have. What kind of testing have you done of this in staging?

review: Needs Fixing
Revision history for this message
Tim Andersson (andersson123) wrote :

Adding and removing trusty and xenial from the service bundle, doing mojo runs and evaluating the state of the autopkgtest services as well as the presence of ensure adt images and build adt image service files

Revision history for this message
Tim Andersson (andersson123) wrote :

Amended, please re-review

Revision history for this message
Brian Murray (brian-murray) wrote :

The unit_tests passed for me locally but I didn't have the proxy server set up so that could be an issue. Please investigate the test failure.

:: Ran 63 tests in 1.176s
::
:: OK

review: Needs Fixing
Revision history for this message
Brian Murray (brian-murray) wrote :

Once the unit tests are sorted this looks good to me.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/charms/focal/autopkgtest-cloud-worker/lib/systemd.py b/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
index a7f6c19..3df8f98 100644
--- a/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
+++ b/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
@@ -9,6 +9,11 @@ from lib.utils import UbuntuRelease
99
10SYSTEM_BUS = Gio.bus_get_sync(Gio.BusType.SYSTEM)10SYSTEM_BUS = Gio.bus_get_sync(Gio.BusType.SYSTEM)
1111
12ARCH_RELEASE_ALLOW_MAPPING = {
13 "trusty": ["amd64", "i386"],
14 "xenial": ["amd64", "i386"],
15}
16
1217
13def get_unit_names(region, arch, ns):18def get_unit_names(region, arch, ns):
14 if arch == "amd64":19 if arch == "amd64":
@@ -170,7 +175,11 @@ def get_units():
170def update_cloud_dropins(region, arch, n, releases):175def update_cloud_dropins(region, arch, n, releases):
171 # re-create, to support fiddling on upgrade176 # re-create, to support fiddling on upgrade
172 def get_arches(release):177 def get_arches(release):
173 if arch == "amd64" and UbuntuRelease(release) < UbuntuRelease("focal"):178 if release in ARCH_RELEASE_ALLOW_MAPPING:
179 return ARCH_RELEASE_ALLOW_MAPPING[release]
180 elif arch == "amd64" and UbuntuRelease(release) < UbuntuRelease(
181 "focal"
182 ):
174 return ["amd64", "i386"]183 return ["amd64", "i386"]
175 else:184 else:
176 return [arch]185 return [arch]
@@ -342,6 +351,28 @@ def set_up_systemd_units(target_cloud_config, target_lxd_config, releases):
342 )351 )
343 disable_timer(region, arch, releases_to_disable)352 disable_timer(region, arch, releases_to_disable)
344353
354 for release in releases:
355 if release in ARCH_RELEASE_ALLOW_MAPPING:
356 if arch not in ARCH_RELEASE_ALLOW_MAPPING[release]:
357 if os.path.exists(
358 "/etc/systemd/system/build-adt-image@"
359 + release
360 + "-"
361 + region
362 + "-"
363 + arch
364 + ".timer"
365 ):
366 os.remove(
367 "/etc/systemd/system/build-adt-image@"
368 + release
369 + "-"
370 + region
371 + "-"
372 + arch
373 + ".timer"
374 )
375
345 # now do lxd. the target config is a dict arch -> IP -> nworkers376 # now do lxd. the target config is a dict arch -> IP -> nworkers
346 all_lxd_arches = set(377 all_lxd_arches = set(
347 list(lxd_unit_object_paths.keys()) + list(target_lxd_config.keys())378 list(lxd_unit_object_paths.keys()) + list(target_lxd_config.keys())
diff --git a/mojo/service-bundle b/mojo/service-bundle
index f85cc66..0c59c26 100644
--- a/mojo/service-bundle
+++ b/mojo/service-bundle
@@ -1,5 +1,5 @@
1{%- if stage_name == "production" %}1{%- if stage_name == "production" %}
2 {%- set releases = "xenial bionic focal jammy lunar mantic noble" %}2 {%- set releases = "trusty xenial bionic focal jammy lunar mantic noble" %}
3 {%- set channel = "latest/stable" %}3 {%- set channel = "latest/stable" %}
4{%- elif stage_name == "staging" or stage_name == "devel" %}4{%- elif stage_name == "staging" or stage_name == "devel" %}
5 {%- set releases = "focal jammy lunar mantic" %}5 {%- set releases = "focal jammy lunar mantic" %}

Subscribers

People subscribed via source and target branches