GithubHelp home page GithubHelp logo

osbuild / weldr-client Goto Github PK

View Code? Open in Web Editor NEW
5.0 16.0 15.0 1.05 MB

Go client library and cmdline tool for WELDR API servers like lorax-composer and osbuild-composer

License: Apache License 2.0

Makefile 0.81% Go 99.10% Shell 0.09%

weldr-client's Introduction

composer-cli

composer-cli is a command line utility used with osbuild-composer to manage blueprints, build and upload images, and manage source repositories.

Edit a Blueprint

Start out by listing the available blueprints using composer-cli blueprints list, pick one and save it to the local directory by running composer-cli blueprints save http-server. If there are no blueprints available you can copy one of the examples from here.

Edit the file (it will be saved with a .toml extension) and change the description, add a package to it. Send it back to the server by running composer-cli blueprints push http-server.toml. You can verify that it was saved by viewing the changelog - composer-cli blueprints changes http-server.

See the Blueprint Format section for the details on how to create a blueprint.

Build an image

Build a qcow2 disk image from this blueprint by running composer-cli compose start http-server qcow2. It will print a UUID that you can use to keep track of the build. You can also cancel the build if needed.

The available types of images is displayed by composer-cli compose types. Currently this consists of: ami, fedora-iot-commit, openstack, qcow2, vhd, vmdk

You can optionally start an upload of the finished image, see Image Uploads for more information.

Monitor the build status

Monitor it using composer-cli compose info UUID where UUID is the UUID returned by the start command. This will show the status of the build. You can view the build logs once it is in the RUNNING state using composer-cli compose log UUID

Once the build is in the FINISHED state you can download the image.

Download the image

Downloading the final image is done with composer-cli compose image UUID and it will save the qcow2 image as UUID-disk.qcow2 which you can then use to boot a VM like this:

qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2

Image Uploads

composer-cli can upload the images to a number of services, including AWS, Azure, and VMWare. The upload can be started when the build is finished by passing the service's profile.toml to the compose start command. For example:

composer-cli compose start http-server server aws.toml

providers.toml

Each provider requires it's own set of details in order to upload to it, this usually involves authentication information. Each provider has its own list of requirements.

AWS

A provider.toml file for AWS looks like this:

[settings]
bucket = "AWS Bucket"
region = "AWS Region"
key = "AWS Key"
accessKeyID = "AWS Access Key"
secretAccessKey = "AWS Secret Key"

The access key and secret key can be created by going to the IAM->Users->Security Credentials section and creating a new access key. The secret key will only be shown when it is first created so make sure to record it in a secure place. The region should be the region that you want to use the AMI in, and the bucket can be an existing bucket, or a new one, following the normal AWS bucket naming rules. It will be created if it doesn't already exist.

When uploading the image it is first uploaded to the s3 bucket, and then converted to an AMI. If the conversion is successful the s3 object will be deleted. If it fails, re-trying after correcting the problem will re-use the object if you have not deleted it in the meantime, speeding up the process.

Azure

For Azure the provider.toml looks like:

[settings]
storageAccount = "account"
storageAccessKey = "key"
container = "container"

VMWare

The VMWare provider.toml uses this template:

[settings]
host =  "Hostname"
username =  "Username"
password = "Password"
datacenter = "Datacenter"
cluster = "Cluster"
datastore = "Datastore"

Build an image and upload results

If you have a profile named test-uploads:

composer-cli compose start example-http-server ami "http image" aws test-uploads

Or if you have the settings stored in a TOML file:

composer-cli compose start example-http-server ami "http image" aws-settings.toml

It will return the UUID of the image build, and the UUID of the upload. Once the build has finished successfully it will start the upload process, which you can monitor with composer-cli upload info <UPLOAD-UUID>

You can also view the upload logs from the Ansible playbook with:

composer-cli upload log <UPLOAD-UUID>

The type of the image must match the type supported by the provider.

JSON Output

composer-cli can output the JSON data returned by the osbuild-composer API, either for debugging or testing purposes. The return format is a JSON 'object' that contains 4 fields: method with the HTTP method used to make the request, path is the API path that was called, status is the HTTP return code from the server, and body contains the raw JSON returned by the server.

Some commands send 2 requests to the server in order to retrieve all the results at once. The API supports pagination and defaults to 20 items, so you need to find the total and set the limit to that total in order to get all of them.

For example, the JSON response from a composer-cli blueprints list looks like this:

[{
    "method": "GET",
    "path": "/blueprints/list?limit=0",
    "status": 200,
    "body": {
        "blueprints": [],
        "limit": 0,
        "offset": 0,
        "total": 3
    }
},
{
    "method": "GET",
    "path": "/blueprints/list?limit=23",
    "status": 200,
    "body": {
        "blueprints": [
            "http-server-bp-1"
            "database-bp-1"
            "dev-bp-1"
        ],
        "limit": 3,
        "offset": 0,
        "total": 3
    }
}]

NOTE: This output format changed in weldr-client v35.6, it used to be a stream of objectes and is now a proper JSON list of objects, making it easier to parse.

Blueprint Format

Blueprints are simple text files in TOML format that describe which packages, and what versions, to install into the image. They can also define a limited set of customizations to make to the final image.

Example blueprints can be found in here, with a simple one looking like this:

name = "base"
description = "A base system with bash"
version = "0.0.1"

[[packages]]
name = "bash"
version = "4.4.*"

The name field is the name of the blueprint. It can contain spaces, but they will be converted to - when it is written to disk. It should be short and descriptive.

description can be a longer description of the blueprint, it is only used for display purposes.

version is a semver compatible version number. If a new blueprint is uploaded with the same version the server will automatically bump the PATCH level of the version. If the version doesn't match it will be used as is. eg. Uploading a blueprint with version set to 0.1.0 when the existing blueprint version is 0.0.1 will result in the new blueprint being stored as version 0.1.0.

[[packages]] and [[modules]]

These entries describe the package names and matching version glob to be installed into the image.

The names must match the names exactly, and the versions can be an exact match or a filesystem-like glob of the version using * wildcards and ? character matching.

NOTE: Currently there is no difference between packages and modules. In the future the modules list may be used for module support, so it is best to just use [[packages]] for now.

For example, to install tmux-2.9a and openssh-server-8.*, you would add this to your blueprint:

[[packages]]
name = "tmux"
version = "2.9a"

[[packages]]
name = "openssh-server"
version = "8.*"

[[groups]]

The groups entries describe a group of packages to be installed into the image. Package groups are defined in the repository metadata. Each group has a descriptive name used primarily for display in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected way of listing a group.

Groups have three different ways of categorizing their packages: mandatory, default, and optional. For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism for selecting optional packages.

For example, if you want to install the anaconda-tools group you would add this to your blueprint:

[[groups]]
name="anaconda-tools"

groups is a TOML list, so each group needs to be listed separately, like packages but with no version number.

Customizations

The [customizations] section can be used to configure the hostname of the final image. eg.:

[customizations]
hostname = "baseimage"

This is optional and may be left out to use the defaults.

[customizations.kernel]

This allows you to append arguments to the bootloader's kernel commandline. This will not have any effect on tar or ext4-filesystem images since they do not include a bootloader.

For example:

[customizations.kernel]
append = "nosmt=force"

[[customizations.sshkey]]

Set an existing user's ssh key in the final image:

[[customizations.sshkey]]
user = "root"
key = "PUBLIC SSH KEY"

The key will be added to the user's authorized_keys file.


WARNING

key expects the entire content of ~/.ssh/id_rsa.pub, make sure it is the public key.


[[customizations.user]]

Add a user to the image, and/or set their ssh key. All fields for this section are optional except for the name, here is a complete example:

[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
key = "PUBLIC SSH KEY"
home = "/srv/widget/"
shell = "/usr/bin/bash"
groups = ["widget", "users", "wheel"]
uid = 1200
gid = 1200

If the password starts with $6$, $5$, or $2b$ it will be stored as an encrypted password. Otherwise it will be treated as a plain text password.


WARNING

key expects the entire content of ~/.ssh/id_rsa.pub, make sure it is the public key.


[[customizations.group]]

Add a new group to the image. name is required and gid is optional:

[[customizations.group]]
name = "widget"
gid = 1130

[customizations.timezone]

Customizing the timezone and the NTP servers to use for the system:

[customizations.timezone]
timezone = "US/Eastern"
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]

The values supported by timezone can be listed by running timedatectl list-timezones.

If no timezone is setup the system will default to using UTC. The ntp servers are also optional and will default to using the distribution defaults which are fine for most uses.

In some image types there are already NTP servers setup, eg. Google cloud image, and they cannot be overridden because they are required to boot in the selected environment. But the timezone will be updated to the one selected in the blueprint.

[customizations.locale]

Customize the locale settings for the system:

[customizations.locale]
languages = ["en_US.UTF-8"]
keyboard = "us"

The values supported by languages can be listed by running localectl list-locales from the command line.

The values supported by keyboard can be listed by running localectl list-keymaps from the command line.

Multiple languages can be added. The first one becomes the primary, and the others are added as secondary. One or the other of languages or keyboard must be included (or both) in the section.

[customizations.firewall]

By default the firewall blocks all access except for services that enable their ports explicitly, like sshd. This command can be used to open other ports or services. Ports are configured using the port:protocol format:

[customizations.firewall]
ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]

Numeric ports, or their names from /etc/services can be used in the ports enabled/disabled lists.

The blueprint settings extend any existing settings in the image templates, so if sshd is already enabled it will extend the list of ports with the ones listed by the blueprint.

If the distribution uses firewalld you can specify services listed by firewall-cmd --get-services in a customizations.firewall.services section:

[customizations.firewall.services]
enabled = ["ftp", "ntp", "dhcp"]
disabled = ["telnet"]

Remember that the firewall.services are different from the names in /etc/services.

Both are optional, if they are not used leave them out or set them to an empty list []. If you only want the default firewall setup this section can be omitted from the blueprint.

NOTE: Some compose types disable the firewall, this cannot be overridden by the blueprint.

[customizations.services]

This section can be used to control which services are enabled at boot time. Some image types already have services enabled or disabled in order for the image to work correctly, and cannot be overridden. eg. ami requires sshd, chronyd, and cloud-init. Without them the image will not boot. Blueprint services are added to, not replacing, the list already in the compose type, if any.

The service names are systemd service units. You may specify any systemd unit file accepted by systemctl enable eg. cockpit.socket:

[customizations.services]
enabled = ["sshd", "cockpit.socket", "httpd"]
disabled = ["postfix", "telnetd"]

Package Sources

By default osbuild-composer uses the host's configured repositories. These are immutable system repositories and cannot be deleted or changed. If you want to add additional repos use the composer-cli sources command to create them.

A new source repository can be added by creating a TOML file with the details of the repository and add it to the server with composer-cli sources add newrepo.toml:

name = "custom-source-1"
url = "https://url/path/to/repository/"
type = "yum-baseurl"
proxy = "https://proxy-url/"
check_ssl = true
check_gpg = true
gpgkey_urls = ["https://url/path/to/gpg-key"]

The proxy and gpgkey_urls entries are optional. All of the others are required. The supported types for the urls are:

  • yum-baseurl is a URL to a yum repository.
  • yum-mirrorlist is a URL for a mirrorlist.
  • yum-metalink is a URL for a metalink.

If check_ssl is true the https certificates must be valid. If they are self-signed you can either set this to false, or add your Certificate Authority to the host system.

If check_gpg is true the GPG key must either be installed on the host system, or gpgkey_urls should point to it.

You can edit an existing source (other than system sources), by using sources add or sources change with the new version of the source. It will overwrite the previous one.

A list of existing sources is available composer-cli sources list, and detailed info on a source can be retrieved with composer-cli sources info SOURCE-NAME. Deleting a non-system source is done using composer-cli sources delete SOURCE-NAME.

The configured sources are used for all blueprint depsolve operations, and for composing images. When adding additional sources you must make sure that the packages in the source do not conflict with any other package sources, otherwise depsolving will fail.

weldr-client's People

Contributors

7flying avatar atodorov avatar bcl avatar dependabot[bot] avatar eloycoto avatar jrusz avatar lavocatt avatar ochosi avatar ondrejbudai avatar schuellerf avatar thozza avatar tristancacqueray avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weldr-client's Issues

`compose image` shouldn't use /tmp for temporary files

Currently, composer-cli compose image firstly downloads the image into /tmp. This causes the osbuild-composer's test suite to fail because on AWS, /tmp is on tmpfs and we don't have enough RAM to store the whole image. My proposal is to drop the temporary file and save the image directly in the current working directory.

RFE: ability to sort output of `compose-cli compose status` by available fields

It would be nice to be able to sort the output of composer-cli compose status by the different fields that are shown. i.e. composer-cli compose status --sort time or composer-cli compose status --sort status

I'm most interested in sorting by the time field, but I guess it could be useful to sort by other fields too.

Cannot upgrade from composer-cli on Fedora 34

$ rpm -q composer-cli
composer-cli-34.9-5.fc34.x86_64
$ sudo dnf install --enablerepo=updates-testing weldr-client
Last metadata expiration check: 0:23:11 ago on Čt 22. dubna 2021, 15:05:27.
Dependencies resolved.
===============================================================================================================================================================
 Package                                Architecture                     Version                               Repository                                 Size
===============================================================================================================================================================
Installing:
 weldr-client                           x86_64                           35.1-1.fc34                           updates-testing                           2.6 M

Transaction Summary
===============================================================================================================================================================
Install  1 Package

Total size: 2.6 M
Installed size: 8.6 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] weldr-client-35.1-1.fc34.x86_64.rpm: Already downloaded                                                                                             
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/bin/composer-cli from install of weldr-client-35.1-1.fc34.x86_64 conflicts with file from package composer-cli-34.9-5.fc34.x86_64
  file /usr/share/man/man1/composer-cli.1.gz from install of weldr-client-35.1-1.fc34.x86_64 conflicts with file from package composer-cli-34.9-5.fc34.x86_64

I think that maybe Obsoletes: composer-cli < 35.0 might solve it, I didn't test it though. We might also want Conflicts? Not sure...

composer-cli blueprints save produces incorrect blueprints

Describe the bug
composer-cli blueprints save creates a blueprint .toml where the user's UID and GID are floating point numbers, e.g. a UID of 1200 will be 1200.0 in the resulting .toml

Environment

  • OS version (/etc/os-release and /etc/redhat-release): Fedora 35
  • osbuild-composer version (rpm -qi osbuild-composer)
Name        : osbuild-composer
Version     : 42
Release     : 1.fc35
Architecture: x86_64
Install Date: Tue 01 Feb 2022 02:08:27 PM CET
Group       : Unspecified
Size        : 17577
License     : ASL 2.0
Signature   : RSA/SHA256, Wed 12 Jan 2022 02:59:40 PM CET, Key ID db4639719867c58f
Source RPM  : osbuild-composer-42-1.fc35.src.rpm
Build Date  : Wed 12 Jan 2022 02:53:03 PM CET
Build Host  : buildvm-x86-17.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://github.com/osbuild/osbuild-composer
Bug URL     : https://bugz.fedoraproject.org/osbuild-composer
Summary     : An image building service based on osbuild
Description :

A service for building customized OS artifacts, such as VM images and OSTree
commits, that uses osbuild under the hood. Besides building images for local
usage, it can also upload images directly to cloud.

It is compatible with composer-cli and cockpit-composer clients.

To Reproduce
Steps to reproduce the behavior:

Create an original_blueprint.toml file with these contents:

name = "BPSaveBug"
description = ""
version = "0.0.1"

[[customizations.user]]
name = "admin"
password = "$6$qL0yRFzeHbv5xvh9$DLgYdwRL5dYj0S9R941AWbjA6lN/ecJr/htnyPvct93tke2sp81qy9F7EHAZmIRMQtlCUT82Q2DYaoAqRJ3CG."
groups = ["wheel"]
uid = 1200
gid = 1200

Push and save the blueprint:
composer-cli blueprints push originalblueprint.toml
composer-cli blueprints save originalblueprint

The resulting BPSaveBug.toml has incorrect floating point values for gid and uid:

description = ""
distro = ""
groups = []
modules = []
name = "BPSaveBug"
packages = []
version = "0.0.1"

[customizations]

  [[customizations.user]]
    gid = 1200.0
    groups = ["wheel"]
    name = "admin"
    password = "$6$qL0yRFzeHbv5xvh9$DLgYdwRL5dYj0S9R941AWbjA6lN/ecJr/htnyPvct93tke2sp81qy9F7EHAZmIRMQtlCUT82Q2DYaoAqRJ3CG."
    uid = 1200.0

Expected behavior

description = ""
distro = ""
groups = []
modules = []
name = "BPSaveBug"
packages = []
version = "0.0.1"

[customizations]

  [[customizations.user]]
    gid = 1200
    groups = ["wheel"]
    name = "admin"
    password = "$6$qL0yRFzeHbv5xvh9$DLgYdwRL5dYj0S9R941AWbjA6lN/ecJr/htnyPvct93tke2sp81qy9F7EHAZmIRMQtlCUT82Q2DYaoAqRJ3CG."
    uid = 1200

Additional context
Add any other context about the problem here.

No cli feedback on 'sudo composer-cli compose results'

When calling sudo composer-cli compose results I get not feedback on stdout (as opposed to the docs which suggest the name and size of the result should be printed).

I know this is a minor / cosmetic issue but at first I thought something had gone wrong until I figured it out.
(Using F34 and osbuild from the repos.)

invalid-url URL `%{gourl}`

user@desktopa weldr-client € make scratch-srpm
sed -e "s/%%VERSION%%/35.6/g" -e "s/%%GPGKEY%%//g" < weldr-client.spec.in > weldr-client.spec
make -s changelog >> weldr-client.spec
mkdir -p /home/supakeen/dev/src/work/weldr-client/rpmbuild/SPECS
cp weldr-client.spec /home/supakeen/dev/src/work/weldr-client/rpmbuild/SPECS
git archive --prefix=weldr-client-35.6/ --format=tar.gz HEAD > weldr-client-35.6.tar.gz
mkdir -p /home/supakeen/dev/src/work/weldr-client/rpmbuild/SOURCES
cp weldr-client-35.6.tar.gz* rpmbuild/SOURCES/
rpmbuild -bs \
	--define "_topdir /home/supakeen/dev/src/work/weldr-client/rpmbuild" \
	--define "commit 35.6" \
	--with tests \
	--without signed \
	rpmbuild/SPECS/weldr-client.spec
setting SOURCE_DATE_EPOCH=1661472000
Wrote: /home/supakeen/dev/src/work/weldr-client/rpmbuild/SRPMS/weldr-client-35.6-1.fc36.src.rpm
user@desktopa weldr-client € rpmlint rpmbuild/SRPMS/weldr-client-35.6-1.fc36.src.rpm
================================================================================================================================== rpmlint session starts ==================================================================================================================================
rpmlint: 2.2.0
configuration:
    /usr/lib/python3.10/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/licenses.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 1

weldr-client.src: W: unexpanded-macro URL %{gourl}
weldr-client.spec:30: W: macro-in-comment %check
weldr-client.spec:168: W: macro-in-%changelog %gobuild
weldr-client.src: W: invalid-url URL %{gourl}

Migrate from weldr-api to cloud-api.

weldr-client currently speaks to the weldr-api as provided by osbuild-composer. In the longer term I'd like to move this over to the cloud-api, also provided by osbuild-composer.

Most important is how we deal with blueprints. These are currently being parsed on the weldr-api side of things and with this change they would need to be parsed and converted into a cloud-api type request on the client side.

We would likely split out the parsing and validation of blueprints to a separate library as the service has also indicated interest in copy/pasting in a blueprint.

`make rpm` on git checkout fails on GPG signing of the archive

I wanted to test a version of weldr-client with the support for cross-distro building and while trying to build RPMs from the git checkout, I got an error due to failed signing:

$ make rpm
sed -e "s/%%VERSION%%/35.1/g" -e "s/%%GPGKEY%%/908AF740C0F898A1079968CDC5887AD51D9F3C2D/g" < weldr-client.spec.in > weldr-client.spec
make -s changelog >> weldr-client.spec
mkdir -p /home/thozza/devel/weldr-client/rpmbuild/SPECS
cp weldr-client.spec /home/thozza/devel/weldr-client/rpmbuild/SPECS
git archive --prefix=weldr-client-35.1/ --format=tar.gz HEAD > weldr-client-35.1.tar.gz
gpg --armor --detach-sign -u 908AF740C0F898A1079968CDC5887AD51D9F3C2D weldr-client-35.1.tar.gz
gpg: skipped "908AF740C0F898A1079968CDC5887AD51D9F3C2D": No secret key
gpg: signing failed: No secret key
make: *** [Makefile:53: sign] Error 2

Please consider not signing the archive as part of rpm target.

Add support for upload status

The compose info response from the server can also contain the status of uploads, these should also be printed.
The trick is to figure out how to include them in the current output without making it messy.

Fix Cobra flag usage during testing

As pointed out in pr #7 the flags don't get reset between tests because the Cobra struct persists for all the tests.
Need to figure out a nice way to reset things so that you don't need to clear them all at the start of every test.

composer-cli --json blueprint changes returns multiple json objects

the old composer-cli:

$ sudo composer-cli --json blueprints changes empty
{
    "blueprints": [
        {
            "changes": [
                {
                    "commit": "14cf307a846a66b4ae184aa79b00ffb5d7de2cb1",
                    "message": "Recipe empty, version  saved.",
                    "revision": null,
                    "timestamp": "2021-04-22T15:59:36Z"
                },
...
            ],
            "name": "empty",
            "total": 15
        }
    ],
    "errors": [],
    "limit": 15,
    "offset": 0
}

the new weldr-client:

$ sudo composer-cli --json blueprints changes empty
{
    "method": "GET",
    "path": "/blueprints/changes/empty?limit=0",
    "status": 200,
    "body": {
        "blueprints": [
            {
                "changes": [
                    {
                        "commit": "14cf307a846a66b4ae184aa79b00ffb5d7de2cb1",
                        "message": "Recipe empty, version  saved.",
                        "revision": null,
                        "timestamp": "2021-04-22T15:59:36Z"
                    },
...
        ],
        "errors": [],
        "limit": 0,
        "offset": 0
    }
}
{
    "method": "GET",
    "path": "/blueprints/changes/empty?limit=15",
    "status": 200,
    "body": {
        "blueprints": [
            {
                "changes": [
                    {
                        "commit": "14cf307a846a66b4ae184aa79b00ffb5d7de2cb1",
                        "message": "Recipe empty, version  saved.",
                        "revision": null,
                        "timestamp": "2021-04-22T15:59:36Z"
                    },
...
                ],
                "name": "empty",
                "total": 15
            }
        ],
        "errors": [],
        "limit": 15,
        "offset": 0
    }
}

I'm not sure what's the expected behavior here. I would say that a user expects a valid JSON when passing the --json flag. On the hand, the output is actually a valid JSON stream. Not sure, what do you think @bcl?

migrate the readme file to the guides

The README.md file contains a user guide which could live in the guides repository. We could either synchronize it there or move it completely and only reference it.

composer-cli compose log says compose is still running.

According to the command help, compose log is meant to get information of the running build, however, it complains the compose is still running, which sounds like a contradiction.

[root@fedoravm image-builder]# composer-cli compose list
ID                                     Status    Blueprint   Version   Type
a4abfd36-0b79-4ccb-a6ac-3edea46ec575   RUNNING   fedora-nx   0.0.1     image-installer
17bda711-098a-413d-bbd8-c4f6f7ac6c34   FAILED    fedora-nx   0.0.2     image-installer
b2f165f0-cb6d-4803-880d-1d62b365f6dd   FAILED    fedora-nx   0.0.0     image-installer
[root@fedoravm image-builder]# composer-cli compose log a4abfd36-0b79-4ccb-a6ac-3edea46ec575 100
Build a4abfd36-0b79-4ccb-a6ac-3edea46ec575 is still running.

Using weldr API client for go binding

Hello,

Is there any plans on structuring this so that other Go applications can
use the weldr client that this has?

I don't see a good way to import it right now so I think we'll have to copy the code.

Best regards

Running command with `--json` that fails returns 0

This easy reproducer says it all:

[root@kvm-08-guest31 osbuild-composer]# composer-cli compose start whatever qcow2
ERROR: UnknownBlueprint: Unknown blueprint name: whatever
[root@kvm-08-guest31 osbuild-composer]# echo $?
1
[root@kvm-08-guest31 osbuild-composer]# composer-cli --json compose start whatever qcow2
{
    "method": "POST",
    "path": "/api/v1/compose",
    "status": 400,
    "body": {
        "errors": [
            {
                "id": "UnknownBlueprint",
                "msg": "Unknown blueprint name: whatever"
            }
        ],
        "status": false
    }
}
[root@kvm-08-guest31 osbuild-composer]# echo $?
0

Ran using weldr-client-35.1-4.el9.x86_64

JSON Output for multiple requests isn't a JSON list

The JSON output for commands like list that send more than one request is not a JSON list, it is a series of distinct objects. It would be nice if this could be JSON compliant so it can be passed directly into a parser.

Add option to download created image to a specific file name

As the subject says, currently composer-cli compose image xxx downloads to a pre-defined image name (based on the UUID) but this isn't optimal for automation, as it forces one to parse the output and rename the image in a 2nd step and, because Ansible doesn't support moving/renaming of files, it requires a copy and/or using a command to move it. Anyway, it's less than nice and being able to give directly the name of the downloaded image, would make it easier.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.