Commit graph

133 commits

Author SHA1 Message Date
Jeremy Cline
28212f5f65
ci: get CI passing
All checks were successful
/ test (pull_request) Successful in 1m25s
/ test (push) Successful in 1m27s
This workflow file was written speculatively prior to our migration and
it seems to be failing during code checkout. Other workflow files use
the full URL to point to the Forgejo repository, and the latest action
is now v7.0.1.

Additionally:

 - We need to have node installed as it's a dependency to run the
   checkout action.

 - I broke one of the azure tests when I fixed upload failing due to the
   gallery API silently changing

 - Time marched on and needed freezing since Fedora 42 EOLd

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-08-27 14:38:57 -04:00
Jeremy Cline
e16b83df7f
Update container to Fedora 44, use mostly distro packages
Some checks failed
/ test (push) Failing after 24s
Recently there was a regression in Pika, and it would generally be nice
to use distribution packages for most of our dependencies. Since the
image tester is already committing similar crimes I think it's fine for
the uploader, too.

Right now we only pull in the Google SDK bits from PyPI, as well as the
Azure compute module from there since the Azure CLI pins an ancient
version.

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-08-06 13:32:05 -04:00
Jeremy Cline
de9fce6412
Temporarily pin pika to 1.4.1 or lower
Some checks failed
/ test (push) Failing after 26s
See also: https://github.com/pika/pika/pull/1678

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-08-05 15:24:39 -04:00
Jeremy Cline
cbcb72860d
azure: maybe fix crashing on gallery creation
Some checks failed
/ test (push) Failing after 23s
Somewhat recently, Azure images started failing to upload, crashing when
calling azure_compute_client.gallery_images.begin_create_or_update with
a server-side error of "HttpResponseError: (InvalidParameter) Required
parameter 'galleryImageVersionName' is missing (null)."

It _seems_ like it no longer allows updating a gallery image (even if
there are no actual updates happening, it just declares it as it always
was) with features that don't include a version within that gallery
where the feature is first enabled.

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-06-10 12:33:44 -04:00
Jeremy Cline
7bfe363c87
azure: drop compute API pin
Some checks failed
/ test (push) Failing after 23s
SDKs have been moving away from bundling all the API versions so this
isn't going to keep working.

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-06-10 11:48:29 -04:00
Jeremy Cline
18dec91847
Temporarily avoid updating to azure-mgmt-compute 38
Some checks failed
/ test (push) Failing after 34s
It's got a massive list of breaking changes and at least one of them
impact us.

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-06-10 11:15:47 -04:00
f7bcc53be9
Update tests to handle that since ba8b8e0, we only delete images that we own 2026-04-26 17:00:45 +01:00
658016a534
Fixup failing AWS test
Not totally sure about this one, I've removed a couple of test
conditions where it seems like an image was expected to be filtered out
but the only thing which has changed since the previous line was
removing the thing that caused it to be filtered in the first place.

Happy to put these back if someone can explain what the intention was.
2026-04-26 16:45:57 +01:00
6521f0e9f9
Skip GCP tests if the GCP environment variables aren't set 2026-04-26 16:23:27 +01:00
3e5fac69f2
Make all tests runnable through hatch test 2026-04-26 16:13:40 +01:00
Jeremy Cline
f258ac24cc
gcp: Fix missing logging format parameter
Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2026-03-16 13:18:53 -04:00
9f89e9dcbf Drop a couple of conditionals obsolete since F39 went EOL
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-01-06 11:56:09 -08:00
Jeremy Cline
c05031171a
azure: skip cleaning up untagged resources as well
The tags attribute is None if there's no tags, not an empty dictionary.
Skip untagged resources for cleanup.
2025-12-04 11:17:29 -05:00
Jeremy Cline
ba8b8e0b3a
azure: Only delete images owned by this application
In order to not step on other images in the gallery, we need to filter
out images we didn't upload.
2025-12-04 10:01:42 -05:00
Jeremy Cline
b2abcad74b
Use non-capitalized delete tag
Elsewhere is already using non-capitalized delete tags, so let's be
consistent.
2025-12-04 09:44:46 -05:00
Jeremy Cline
5401c2d22f
azure: switch to DefaultAzureCredential class
This loads the credentials from a number of sources (azure-cli login,
environment variables, etc).

For production, we expect the AZURE_CLIENT_ID, AZURE_TENANT_ID, and
AZURE_CLIENT_SECRET or AZURE_CLIENT_CERTIFICATE_PATH variables to be
set.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-11-19 10:47:59 -05:00
Jeremy Cline
f3101d67c1
azure: Rename GalleryDiskImageSource parameter
The parameter changed from "id" to "storage_account_id" when uploading,
presumably because the id field is used for the resource itself and not
the storage account. This breaking change was recently enforced server
side.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-11-18 07:51:14 -05:00
Jeremy Cline
bcdc84b8a8
azure: Tag images with the time they should be deleted
This is in preparation to add a garbage collection task for our Azure
subscription like the AWS account has. Resources including a "Delete"
tag with a date will be deleted after that date.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-10-10 12:22:52 -04:00
e8584a3d47 aws, gcp: update ELN subvariants
ELN now uses subvariants for all images to match CS and RHEL, which is
necessary to avoid collisions between images.

https://pagure.io/cloud-image-uploader/issue/62

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2025-09-30 23:09:52 -04:00
Jeremy Cline
f230c59c0c
azure: support azure-mgmt-compute 37+
The SDK no longer provides all prior API versions.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-09-30 18:16:10 -04:00
Jeremy Cline
342c9d56a9
Revert auto-expiry annotations for containers
This reverts commit 69c034fdf3.
This reverts commit 233c7a9172.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-07-18 17:46:27 -04:00
Jeremy Cline
69c034fdf3
containers: Add annotations to both the image index and the manifests
Quay says you can add annotations to expire images, but doing this in
the image index doesn't appear to do anything. Maybe the manifest is
where they're supposed to go?

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-07-17 12:07:31 -04:00
Jeremy Cline
189b5ebc9b
Rename FatManifest::archive_index to image_index
Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-07-16 09:46:55 -04:00
Jeremy Cline
cbfbd518b0
Tweak container manifest name and docblock
Suggested-by: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-07-15 16:15:47 -04:00
Jeremy Cline
233c7a9172
containers: push nightly tags to quay.io with expiry annotations
This adjusts the tags pushed to quay.io to include nightly tags set to
expire when the image reaches EOL.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-06-18 13:10:37 -04:00
Jeremy Cline
73d3020ecb
containers: refactor manifest creation and publishing
Breaking this into two separate functions and hoisting the registry loop
up makes it easier to adjust what gets pushed to each repository. This
is prep work for pushing nightly build tags to Quay, which supports
annotations for garbage collection.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-06-17 17:37:07 -04:00
Jeremy Cline
f2ba4b5b42
Add Python 3.14 to the tox test matrix
Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-06-17 15:12:44 -04:00
Jeremy Cline
2fbe642643
gcp: skip tests in tox by default
GCP really, _really_ wants credentials to do anything. There's not an
obvious easy way to test like AWS has. Skip the tests for normal runs
since most people won't have credentials set up.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-06-17 15:11:32 -04:00
Jeremy Cline
6027fd29eb
gcp: skip images if GCP returns HTTP 400
Retrying won't help, log the error and wait for bug fixes.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-06-17 12:07:24 -04:00
f5565dcef1 containers: update 'rawhide' tag for compose with Rawhide number (#55)
Unlike Fedora composes, Fedora-IoT composes are always numbered
- there's never an IoT compose with "Rawhide" as the version.
Right now for e.g. IoT is doing composes with "43" as the
version.

They want us to update the "rawhide" tag for composes with the
release number currently associated with Rawhide, so this will
make that happen.

Add an IoT compose to test_containers so we can check that this
works (and that IoT composes are otherwise handled correctly).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-05-27 12:15:07 -07:00
5ea01361ec test_azure: update stable compose fixture, fix EOL test
The Azure upload code skips uploading if the EOL date is close or
has passed, so all tests that used stable_nightly_compose.json
were broken recently because the F40 EOL date passed. This updates
the fixture to be a more recent stable nightly.

While fixing this I noticed the EOL synthesis test was broken
since aac47f3 - that removed all the assertions from the test,
it was just assigning values to things. This fixes it to use
correct assertions again, and then fixes problems with the changed
mocks that become apparent when you make the test actually assert
things again.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-05-27 12:13:00 -07:00
81c7f1c115 Update test_containers with new compose data
The existing VCR "cassettes" don't work with current fedfind,
but we can't re-record them because the composes in the tests no
longer exist on the server. So change the tests to use current
composes and re-record the cassettes. We also need to adjust
test expectations and re-record cassettes for some other tests
that use the same data. I split off the old rc_compose.json as
rc_compose_40.json for the GCP tests, because I don't have gcloud
API access set up to re-record those cassettes.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-05-27 11:27:28 -07:00
Jeremy Cline
6883369f2f
Revert "container: skip ELN's WSL image"
This reverts commit cd0bd50e8b.
2025-05-13 10:17:33 -04:00
Jeremy Cline
f1d6605627
azure: handle EOL day
Azure doesn't allow for an EOL to be the current day. Skip image upload
if the calculated EOL is in the next day or two.
2025-05-13 10:15:40 -04:00
Jeremy Cline
cd0bd50e8b
container: skip ELN's WSL image
The ELN WSL image has variant/subvariant "BaseOS" which is what their
container image has, as well. Its "type" is also "docker", so it is
being picked up by the container uploader. Add a hacky skip until
they've adjusted their subvariant.

This should be reverted after a couple days.

Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
2025-05-09 09:36:41 -04:00
4bfc6c41da container: don't bail out multi-arch loop entirely on first fail
This loop handles multiple repo/images pairs. Just because an
expected arch is missing for *one* repo doesn't mean we should
bail out of possibly publishing manifests for *all subsequent*
repos in the compose. This is currently causing us not to
publish the multi-arch manifest for fedora-bootc because we're
failing the check for fedora-iot, even though fedora-bootc would
pass the check fine.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-04-28 14:04:04 -07:00
152e5633eb container: allow ppc64le and s390x to be missing for fedora-iot
These are only present in the current manifest by mistake (we
got the IoT and base images mixed up). IoT isn't actually meant
to be built for these arches. Now we've fixed the mixup, though,
sync is failing every day because the current manifest has these
arches in it. Use the mechanism I added in #45 to allow them to
be missing.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-04-28 14:02:10 -07:00
e1eb83886c handle_container: drop check for <F40 images
F39 is EOL now, so we don't need this.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-04-22 14:36:38 -07:00
1413a22c9a handle_container: drop no-longer-needed check for bogus metadata
The PR mentioned in the comment was merged months ago, and I
backported it for all stable branches. We shouldn't have this bad
metadata in any current composes any more.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-04-22 14:34:21 -07:00
Jeremy Cline
99dec0faaf
gcp: include the arch in image names as well
It turns out image names need to be unique across the project, not just
unique to the family that contains them. Bring back the arch suffix.
2025-04-17 09:22:25 -04:00
Jeremy Cline
da33bf35cb
gcp: make image families arch-dependent
It seems families should only have images of a single architecture in
them, rather than being a container for multiple architectures of the
same release. Swap the arch suffix from the image name to the image
family.

See also: https://pagure.io/cloud-sig/issue/438
2025-04-16 12:58:16 -04:00
Jeremy Cline
e203a1878a
gcp: name ELN images "fedora-eln-..."
Previously, ELN images were named "fedora-cloud-11..." which is a bit
confusing.
2025-03-24 16:44:09 -04:00
Jeremy Cline
ba07d7f7b3
gcp: add prod license URL 2025-03-24 13:19:04 -04:00
Jeremy Cline
b747f355f5
gcp: Only specify storage_location in staging
The API won't allow locations to be specified for "official projects",
which "fedora-cloud" is, and "fedora-cloud-devel" is not.
2025-03-24 13:15:47 -04:00
Jeremy Cline
358d64a5b8
gcp: ensure image is deprecated during import
Also fix the comparison for deprecation during image promotion
2025-03-24 10:44:01 -04:00
Jeremy Cline
e574d7a480
gcp: use configured storage locations
The object attribute is not an array and fails to serialize properly.
2025-03-20 15:07:53 -04:00
Jeremy Cline
717677337e
Revert "gcp: Drop idempotent requests"
This reverts commit a35b0cab38.
2025-03-20 15:07:51 -04:00
Jeremy Cline
a35b0cab38
gcp: Drop idempotent requests
While testing required permissions this is a very irritating feature;
this commit will be reverted once the staging permission set is correct.
2025-03-20 12:29:00 -04:00
Jeremy Cline
b286e8eabc
gcp: whoops, strings don't have reverse 2025-03-20 12:16:20 -04:00
Jeremy Cline
e154b27b8a
gcp: Adjust the deprecation call on initial upload
re-using the request-id from the insert call results in an HTTP 400; we
still want it to depend on the image sha, so just use a different offset
in the checksum.
2025-03-20 11:40:42 -04:00