Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cloudapi support to composer-cli (COMPOSER-2131) #134

Closed
wants to merge 16 commits into from

Conversation

bcl
Copy link
Collaborator

@bcl bcl commented Mar 20, 2024

Note that this is a draft, and there are some significant pieces missing from the cloudapi (that I will cover in #133). This code could also use some tests :) But it does provide a basic framework for using the cloudapi.

If osbuild-composer has local save enabled you can use this to start a compose using the cloudapi and a blueprint file without uploading it to the store first. uploading might also work, but there are a number of limitations preventing easy testing of it that can also be discussed in #133

Basically, this is a starting point for moving commands to cloudapi.

@ochosi ochosi changed the title Adding cloudapi support to composer-cli Adding cloudapi support to composer-cli (COMPOSER-2131) Mar 25, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 26, 2024
@bcl bcl removed the Stale label Apr 26, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 27, 2024
@bcl bcl removed the Stale label May 28, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 28, 2024
@bcl bcl removed the Stale label Jun 28, 2024
@bcl bcl force-pushed the main-cloudapi branch from 5a0f131 to bf2d6d7 Compare July 22, 2024 22:01
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 22, 2024
@elkoniu
Copy link

elkoniu commented Aug 22, 2024

@bcl this change looks to be interesting but GitHub again stalled it.

@bcl bcl removed the Stale label Aug 22, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 22, 2024
@bcl bcl removed the Stale label Sep 23, 2024
bcl added 11 commits September 25, 2024 10:52
- PostRaw and PostJSON functions
- GetJSON function
- Exists function
- ErrorToString function to parse a cloudapi error json response into a string

Related: RHEL-60148
Related: RHEL-60148
This allows you to build weldr-client with a custom version, eg. for
development so that the NEVRA will always be greater than the last
build.

Use it like this:

BASEVER=$(grep ^VERSION Makefile | awk '{ print $3 }')
VERSION=$BASEVER.$(date +%Y%m%d%H%M) make build-in-podman
This will check to see if the cloudapi socket is available, and if so it
will show the Cloud API version number and name of the service.

Related: RHEL-60148
Retrieve the cloud API's openapi info.

Related: RHEL-60148
This function uses the cloud API to start a compose using a blueprint
that is included in the compose request instead of one that has been
previously uploaded.

Related: RHEL-60124
When a local file is used in place of the blueprint name composer-cli
will use the cloud API to upload the blueprint and start the compose.

Currently this expects the osbuild-composer server to have the
'localsave' option enabled in its osbuild-composer.service file.

Resolves: RHEL-60124
The upload options are passed via the cloud API's image request
ImageOptions:

https://github.com/osbuild/osbuild-composer/blob/main/internal/cloudapi/v2/openapi.v2.yml#L795

the cloud client code does not do any validation of the format or
content, that is all handled by the server which will return an error
describing what went wrong if there is a problem.

Related: RHEL-60124
The upload format for the cloud API server is different from that used
by the weldr API. It is described in the cloud API's openapi schema
document in the UploadOptions section:

https://github.com/osbuild/osbuild-composer/blob/main/internal/cloudapi/v2/openapi.v2.yml#L1015

Related: RHEL-60124
The ExecutionError already prints 'ERROR' so there is no need for it in
the strings passed to it.

Related: RHEL-60148
Related: RHEL-60123
bcl added 5 commits September 25, 2024 10:57
Related: RHEL-60123
The composes built with the cloud API are not stored in the weldr API
store so the UUID from the user may belong to one or the other. Check
cloud API first, then weldr API and return the weldr API error if it is
not found in either place.

Note that the result printed is different. Cloud API uses 'success' and
'failure' and WELDR API uses 'FINISHED' and 'FAILED'.

Related: RHEL-60124
Currently the amount of information available for cloud composes is very
limited compared to the WELDR API.

Related: RHEL-60123
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 26, 2024
@bcl bcl removed the Stale label Oct 28, 2024
@bcl
Copy link
Collaborator Author

bcl commented Nov 13, 2024

Splitting into multiple PRs. Part 1 is #150

@bcl bcl closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants