cloudapi: add support for uploading to a container registry

Worker
------
Add configuration for the default container registry.
Use the default container registry if not provided as part
of the image name.
When using the default registry use the configured values
Return the image url as part of the result.

Composer Worker API
-------------------
Add `ContainerTargetResultOptions` to return the image url

Composer API
------------
Add UploadOptions to allow setting of the image name and tag
Add UploadStatus to return the url of the uploaded image

Co-Developed-By: Christian Kellner <christian@kellner.me>
This commit is contained in:
Ygal Blum 2022-07-26 14:45:52 +03:00 committed by Tom Gundersen
parent 14208d872b
commit 3231aabbc0
9 changed files with 277 additions and 130 deletions

View file

@ -511,6 +511,7 @@ components:
- $ref: '#/components/schemas/AWSS3UploadStatus'
- $ref: '#/components/schemas/GCPUploadStatus'
- $ref: '#/components/schemas/AzureUploadStatus'
- $ref: '#/components/schemas/ContainerUploadStatus'
UploadStatusValue:
type: string
enum: ['success', 'failure', 'pending', 'running']
@ -521,6 +522,7 @@ components:
- aws.s3
- gcp
- azure
- container
AWSEC2UploadStatus:
type: object
required:
@ -566,7 +568,22 @@ components:
build_id:
type: integer
example: 42
ContainerUploadStatus:
type: object
additionalProperties: false
required:
- url
- digest
properties:
url:
type: string
example: 'quay.io/myaccount/osbuild:latest'
description: |
FQDN of the uploaded image
digest:
type: string
description: |
Digest of the manifest of the uploaded container on the registry
ComposeMetadata:
allOf:
- $ref: '#/components/schemas/ObjectReference'
@ -700,6 +717,7 @@ components:
- $ref: '#/components/schemas/AWSS3UploadOptions'
- $ref: '#/components/schemas/GCPUploadOptions'
- $ref: '#/components/schemas/AzureUploadOptions'
- $ref: '#/components/schemas/ContainerUploadOptions'
description: |
This should really be oneOf but AWSS3UploadOptions is a subset of
AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
@ -824,6 +842,23 @@ components:
Name of the uploaded image. It must be unique in the given resource group.
If name is omitted from the request, a random one based on a UUID is
generated.
ContainerUploadOptions:
type: object
additionalProperties: false
required:
- name
- tag
properties:
name:
type: string
example: 'osbuild'
description: |
Name for the created container image
tag:
type: string
example: 'latest'
description: |
Tag for the created container image
Customizations:
type: object
properties: