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
1diff --git a/charms/focal/autopkgtest-cloud-worker/lib/systemd.py b/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
2index a7f6c19..3df8f98 100644
3--- a/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
4+++ b/charms/focal/autopkgtest-cloud-worker/lib/systemd.py
5@@ -9,6 +9,11 @@ from lib.utils import UbuntuRelease
6
7 SYSTEM_BUS = Gio.bus_get_sync(Gio.BusType.SYSTEM)
8
9+ARCH_RELEASE_ALLOW_MAPPING = {
10+ "trusty": ["amd64", "i386"],
11+ "xenial": ["amd64", "i386"],
12+}
13+
14
15 def get_unit_names(region, arch, ns):
16 if arch == "amd64":
17@@ -170,7 +175,11 @@ def get_units():
18 def update_cloud_dropins(region, arch, n, releases):
19 # re-create, to support fiddling on upgrade
20 def get_arches(release):
21- if arch == "amd64" and UbuntuRelease(release) < UbuntuRelease("focal"):
22+ if release in ARCH_RELEASE_ALLOW_MAPPING:
23+ return ARCH_RELEASE_ALLOW_MAPPING[release]
24+ elif arch == "amd64" and UbuntuRelease(release) < UbuntuRelease(
25+ "focal"
26+ ):
27 return ["amd64", "i386"]
28 else:
29 return [arch]
30@@ -342,6 +351,28 @@ def set_up_systemd_units(target_cloud_config, target_lxd_config, releases):
31 )
32 disable_timer(region, arch, releases_to_disable)
33
34+ for release in releases:
35+ if release in ARCH_RELEASE_ALLOW_MAPPING:
36+ if arch not in ARCH_RELEASE_ALLOW_MAPPING[release]:
37+ if os.path.exists(
38+ "/etc/systemd/system/build-adt-image@"
39+ + release
40+ + "-"
41+ + region
42+ + "-"
43+ + arch
44+ + ".timer"
45+ ):
46+ os.remove(
47+ "/etc/systemd/system/build-adt-image@"
48+ + release
49+ + "-"
50+ + region
51+ + "-"
52+ + arch
53+ + ".timer"
54+ )
55+
56 # now do lxd. the target config is a dict arch -> IP -> nworkers
57 all_lxd_arches = set(
58 list(lxd_unit_object_paths.keys()) + list(target_lxd_config.keys())
59diff --git a/mojo/service-bundle b/mojo/service-bundle
60index f85cc66..0c59c26 100644
61--- a/mojo/service-bundle
62+++ b/mojo/service-bundle
63@@ -1,5 +1,5 @@
64 {%- if stage_name == "production" %}
65- {%- set releases = "xenial bionic focal jammy lunar mantic noble" %}
66+ {%- set releases = "trusty xenial bionic focal jammy lunar mantic noble" %}
67 {%- set channel = "latest/stable" %}
68 {%- elif stage_name == "staging" or stage_name == "devel" %}
69 {%- set releases = "focal jammy lunar mantic" %}

Subscribers

People subscribed via source and target branches