Merge ~raharper/curtin:fix/vmtest-image-sync-after-maas-url-rename into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 48e8c3c14c5fea63f0441370c8abe3bca11d4289
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:fix/vmtest-image-sync-after-maas-url-rename
Merge into: curtin:master
Diff against target: 26 lines (+4/-2)
1 file modified
tests/vmtests/image_sync.py (+4/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
curtin developers Pending
Review via email: mp+396345@code.launchpad.net

Commit message

vmtest: fix image-sync after maas URL stream rename

Image syncing for vmtest has been failing since MAAS renamed their
daily image stream to stable. In an effort to keep the 'daily' URL
valid the website redirects this to 'stable' path. However the content
was also modified and includes references to files and URLs which have
the 'stable' name included. This broke vmtest image sync which expected
the 'daily' string to be present in filenames and content.

The observable result was that curtin would attempt to find content it
had just *synced* to /srv/images but when searching, it would load up
the cached content files which only referenced the 'daily' stream data
and would indicate that the target file was missing.

This branch moves vmtest to using the 'stable' maas image stream
directly. This value is controllable via an environment variable,
MAAS_IMAGE_STREAM, if set will be used to compose the IMAGE_SRC_URL
and the STREAM_BASE variable which is used to find cached content in
/srv/images/.vmtest_data/ directory.

LP: #1908543

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This all makes sense to me. I guess we'll check it passes in jenkins first...

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/vmtests/image_sync.py b/tests/vmtests/image_sync.py
2index e460e02..19b2d22 100644
3--- a/tests/vmtests/image_sync.py
4+++ b/tests/vmtests/image_sync.py
5@@ -32,9 +32,11 @@ def environ_get(key, default):
6 return os.environ.get(long_key, os.environ.get(key, default))
7
8
9+MAAS_IMAGE_STREAM = environ_get("MAAS_IMAGE_STREAM", "stable")
10 IMAGE_SRC_URL = environ_get(
11 'IMAGE_SRC_URL',
12- "http://images.maas.io/ephemeral-v3/daily/streams/v1/index.sjson")
13+ "http://images.maas.io/ephemeral-v3/%s/streams/v1/index.sjson" %
14+ MAAS_IMAGE_STREAM)
15 IMAGE_DIR = environ_get("IMAGE_DIR", "/srv/images")
16
17 KEYRING = environ_get(
18@@ -43,7 +45,7 @@ KEYRING = environ_get(
19 ITEM_NAME_FILTERS = \
20 ['ftype~(boot-initrd|boot-kernel|root-tgz|squashfs)']
21 FORMAT_JSON = 'JSON'
22-STREAM_BASE = 'com.ubuntu.maas:daily'
23+STREAM_BASE = 'com.ubuntu.maas:' + MAAS_IMAGE_STREAM
24 VMTEST_CONTENT_ID_PATH_MAP = {
25 STREAM_BASE + ":v3:download": "streams/v1/vmtest.json",
26 STREAM_BASE + ":centos-bases-download": "streams/v1/vmtest-centos.json",

Subscribers

People subscribed via source and target branches