Skip to content

Commit

Permalink
tasks: Stop assuming image-refresh writes into /cache in run-local.sh
Browse files Browse the repository at this point in the history
When we'll move to job-runner, then `image-create` will not run in the
cockpituous-tasks container any more. So instead of assuming that the
image is already in /cache/images, download it from S3 instead.
  • Loading branch information
martinpitt committed Mar 7, 2024
1 parent d85f0a1 commit 6d8f6ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tasks/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,18 @@ test_mock_image_refresh() {
podman exec -i -u root cockpituous-tasks rm /usr/local/bin/git

podman exec -i cockpituous-tasks sh -euxc '
# image is on the S3 server
cd bots
name=$(python3 -m lib.s3 ls '$S3_URL_POD'/images/ | grep -o "foonux.*qcow2")
# download image (it was not pushed to git, so need to use --state)
rm -f /cache/images/foonux*
./image-download --store $COCKPIT_IMAGE_UPLOAD_STORE --state "$name"
# validate image contents
qemu-img convert /cache/images/foonux-*.qcow2 /tmp/foonux.raw
grep "^fakeimage" /tmp/foonux.raw
rm /tmp/foonux.raw
# image is on the S3 server
cd bots
python3 -m lib.s3 ls '$S3_URL_POD'/images/ | grep "foonux.*qcow"
'
}

Expand Down

0 comments on commit 6d8f6ae

Please sign in to comment.