Commit Graph

24 Commits

Author SHA1 Message Date
Jeremy Cline
471599c785 fedora-image-uploader: Publish AMQP messages for published Azure images
This enables publishing messages whenever we upload an Azure image.
2024-07-03 11:52:56 +00:00
Kevin Fenzi
3d98cbbd03 fedimg: change staging bucket name
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-06-24 14:47:30 -07:00
Kevin Fenzi
c1d34ab1d6 cloud-image-uploader: just set volume size to 6 for now
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-06-24 12:59:57 -07:00
Jeremy Cline
2e2d141320 fedora-image-uploader: Add AWS configuration for staging
This will enable AWS support on staging. It remains off in production.
2024-06-24 15:20:18 -04:00
Jeremy Cline
858ab494c3 Add AWS credentials to the cloud-image-uploader
For now, just re-use the fedimg credentials.

Note that currently the AWS support is not enabled so nothing makes use
of these credentials just yet.
2024-06-24 15:10:59 -04:00
Jeremy Cline
a0db292af2 fedora-image-uploader: configure message publishing
The service will soon emit messages when new images are uploaded. This
grants it access to publish under the fedora_image_uploader topic.

Specific topics under the org.fedoraproject.prod prefix look like:

  fedora_image_uploader.azure.Fedora-Cloud-40.aarch64
  fedora_image_uploader.container.fedora.f40
2024-06-18 22:33:43 +00:00
Jeremy Cline
f0f0062de1 fedora-image-uploader: Fix config for new package name
The Python package was renamed[0] upstream. Because the container
contains a default CMD that was updated to reference the new callback
path, the only thing that broke in production was the logging.

[0] https://pagure.io/cloud-image-uploader/pull-request/15
2024-06-17 09:45:36 +00:00
Jeremy Cline
9c2a1fb270 fedora-image-uploader: Add log handler to email errors 2024-06-12 07:26:36 +00:00
Jeremy Cline
d54c08c67a cloud-image-uploader: Switch to Pungi compose messages
The cloud-image-uploader uses Pungi compose messages starting with
v0.3.0. This switches the routing keys and also adds a one-off task to
remove the queue before re-adding it to flush out any queued up messages
and remove the old topic bindings.
2024-05-07 15:19:23 +00:00
Neil Hanlon
bafcded29e fix(os:cloud-image-uploader): set workingDir on container
The latest import failed due to "ERROR: Unable to create local
directories(/.ansible/tmp): [Errno 13] Permission denied: b'/.ansible'".
Which implies the code is being executed from `/`, despite the WORKDIR
variable being set in the container image--I suspect this is a quirk of
kube/openshift that was not expected.

This change sets the workingDir to /srv/cloud-uploader, as specified in
the Containerfile, which should resolve the execution error.

Signed-off-by: Neil Hanlon <neil@shrug.pw>
2024-04-20 20:47:16 +00:00
Jeremy Cline
79935add66 cloud-image-uploader: Fix routing key for AMQP binding
env renders to "production" which is not what messages are published
under ("prod"). Match what other apps are doing and just use a wildcard
so it'll match anything. Since prod and stage are separate brokers this
is fine.
2024-04-17 11:10:46 -04:00
Jeremy Cline
d89d0d22cf cloud-image-uploader: replicate production images beyond eastus
The image needs to be replicated to a region to be usable in that
region. It's likely we'll want to expand this list and potentially add
logic to the uploader to not replicate nightly images until they are
promoted to the latest image in the stream so I've templated it it
in the configuration.
2024-04-16 12:20:04 -04:00
Jeremy Cline
1072599f35 cloud-image-uploader: change prod storage account name
Storage account names need to be globally unique. It seems fedoraimages
was already taken, so I've adjusted it to one that's not taken. It's
only used to import the images so the name doesn't really matter.
2024-04-16 12:20:02 -04:00
Jeremy Cline
ea9efa2ffc cloud-image-uploader: fix the final queue reference
I forgot queues are declared separately from the bindings.
2024-04-10 17:16:31 -04:00
Jeremy Cline
e086b2fe93 cloud-image-uploader: azure gallery names are unique per subscription
I assumed gallery names were unique per resource group, but this is not
the case. They're unique per subscription, oddly, so we need to use a
different name in staging.
2024-04-10 17:16:26 -04:00
Jeremy Cline
6d9f9ecc68 cloud-image-uploader: change rabbitmq name to match CN in certificate
The client certificate contains "cloud-image-uploader.stg" for the CN,
so our RabbitMQ name needs to match. Additionally, the queue name needs
to start with the username, so we need to adjust that as well.
2024-04-10 13:32:01 -04:00
Francois Andrieu
ce0f875245 cloud-image-uploader: fix deployment trigger & remove rollout 2024-04-10 18:23:41 +02:00
Jeremy Cline
76285355d6 cloud-image-uploader: fix up queue name
The queue name needs to match the queue name we defined in the playbook
that creates the user and queue.
2024-04-10 11:55:48 -04:00
Jeremy Cline
07be198d0a cloud-image-uploader fix TLS settings for fedora-messaging
These need to match the "key" used in the playbook that creates the
secret files.
2024-04-10 11:03:28 -04:00
Kevin Fenzi
59c2360268 cloud-image-uploader: pull image from local openshift registry
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-04-09 16:37:19 -07:00
Kevin Fenzi
8f16ad59fd cloud-image-uploader: Add matchLabels attribute
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-04-09 16:25:58 -07:00
Jeremy Cline
30b24d38ef cloud-image-uploader: use stringData instead of data
I mis-read the docs and data needs to be base64 encoded, stringData will
handle it for you.
2024-04-09 19:13:57 -04:00
Jeremy Cline
cf9b6065db cloud-image-uploader: swap staging and prod blocks in config
These were all backwards, setting prod settings in stage and stage
settings in prod.
2024-04-09 23:01:08 +00:00
Jeremy Cline
e564d0c2da Add a role and playbook for the cloud-image-uploader
This app is an AQMP client that uploads VM images to public clouds. It
currently supports Azure images.

Ref: https://pagure.io/fedora-infrastructure/issue/11860
2024-04-09 23:01:08 +00:00