Merge ~andersson123/autopkgtest-cloud:update-deps-mojo-run-move-pkgs-to-basic into autopkgtest-cloud:master

Proposed by Tim Andersson
Status: Merged
Merged at revision: 04ef28c1b00f8e674a5903d3fe882bd81b7912e7
Proposed branch: ~andersson123/autopkgtest-cloud:update-deps-mojo-run-move-pkgs-to-basic
Merge into: autopkgtest-cloud:master
Diff against target: 81 lines (+18/-4)
4 files modified
charms/focal/autopkgtest-cloud-worker/layer.yaml (+1/-3)
charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py (+7/-0)
charms/focal/autopkgtest-web/layer.yaml (+2/-1)
charms/focal/autopkgtest-web/reactive/autopkgtest_web.py (+8/-0)
Reviewer Review Type Date Requested Status
Paride Legovini Approve
Review via email: mp+456171@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

Needs testing, setting to WIP

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

I tested this and it works. Please review.

Revision history for this message
Paride Legovini (paride) wrote :

I like this, but I'm puzzled by the move of packages from "apt" to "basic". Do we actually need that? Looks like apt.needs_update and apt.queued_installs (which you leverage to trigger an upgrade) are part of the apt layer:

  https://github.com/stub42/layer-apt

so AIUI it's the apt layer performing the update/upgrade operation.

Does this work if we keep packages under apt?

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

I don't really have that information, I was just told by IS DevOps team that this is how you should do it:
https://chat.canonical.com/canonical/pl/gf9gcar9x781umexmnozxynhdw

I can test if it works with packages just under apt, however

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

Yeah, I tested it, and unfortunately, they must be under basic.packages.

I'm not sure why.

I'll leave the MP as is.

Revision history for this message
Paride Legovini (paride) wrote :

Admittedly I'm not that confident about all the moving parts here, but this looks good.

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

awesome, thanks paride :)

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/layer.yaml b/charms/focal/autopkgtest-cloud-worker/layer.yaml
index 4aeb04d..692d9af 100644
--- a/charms/focal/autopkgtest-cloud-worker/layer.yaml
+++ b/charms/focal/autopkgtest-cloud-worker/layer.yaml
@@ -10,9 +10,6 @@ options:
10 - gir1.2-glib-2.010 - gir1.2-glib-2.0
11 - python3-gi11 - python3-gi
12 - python3-pygit212 - python3-pygit2
13 include_system_packages: true
14 apt:
15 packages:
16 - bsd-mailx13 - bsd-mailx
17 - dctrl-tools14 - dctrl-tools
18 - distro-info15 - distro-info
@@ -32,3 +29,4 @@ options:
32 - python3-openstackclient29 - python3-openstackclient
33 - python3-swiftclient30 - python3-swiftclient
34 - ssmtp31 - ssmtp
32 include_system_packages: true
diff --git a/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py b/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
index 2095e42..f39705d 100644
--- a/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
+++ b/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
@@ -184,6 +184,13 @@ def daemon_reload():
184 clear_flag("autopkgtest.daemon-reload-needed")184 clear_flag("autopkgtest.daemon-reload-needed")
185185
186186
187@hook("upgrade-charm")
188def install_apt_packages():
189 """Install packages defined in layer.yaml"""
190 set_flag("apt.needs_update")
191 clear_flag("apt.queued_installs")
192
193
187@hook("install")194@hook("install")
188def enable_persistent_journal():195def enable_persistent_journal():
189 try:196 try:
diff --git a/charms/focal/autopkgtest-web/layer.yaml b/charms/focal/autopkgtest-web/layer.yaml
index 1afa35d..5c81bdb 100644
--- a/charms/focal/autopkgtest-web/layer.yaml
+++ b/charms/focal/autopkgtest-web/layer.yaml
@@ -6,7 +6,7 @@ includes:
6 - 'interface:rabbitmq'6 - 'interface:rabbitmq'
7 - 'interface:apache-website'7 - 'interface:apache-website'
8options:8options:
9 apt:9 basic:
10 packages:10 packages:
11 - amqp-tools11 - amqp-tools
12 - distro-info12 - distro-info
@@ -21,3 +21,4 @@ options:
21 - python3-flask-openid21 - python3-flask-openid
22 - python3-swiftclient22 - python3-swiftclient
23 - python3-werkzeug23 - python3-werkzeug
24 include_system_packages: true
diff --git a/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py b/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
index 842348b..db60fcb 100644
--- a/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
+++ b/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
@@ -8,6 +8,7 @@ from charmhelpers.core.hookenv import charm_dir, config
8from charms.layer import status8from charms.layer import status
9from charms.reactive import (9from charms.reactive import (
10 clear_flag,10 clear_flag,
11 hook,
11 set_flag,12 set_flag,
12 when,13 when,
13 when_all,14 when_all,
@@ -25,6 +26,13 @@ SWIFT_WEB_CREDENTIALS_PATH = os.path.expanduser(
25)26)
2627
2728
29@hook("upgrade-charm")
30def install_apt_packages():
31 """Install packages defined in layer.yaml"""
32 set_flag("apt.needs_update")
33 clear_flag("apt.queued_installs")
34
35
28@when_not("autopkgtest-web.autopkgtest_web_symlinked")36@when_not("autopkgtest-web.autopkgtest_web_symlinked")
29def symlink_autopkgtest_cloud():37def symlink_autopkgtest_cloud():
30 try:38 try:

Subscribers

People subscribed via source and target branches