2018-10-24 17:06:12 +00:00
. \" Man page generated from reStructuredText.
.
2020-10-01 22:48:47 +00:00
.TH "COMPOSER-CLI" "1" "Oct 01, 2020" "33.10" "Lorax"
2018-10-24 17:06:12 +00:00
.SH NAME
composer-cli \- Composer Cmdline Utility Documentation
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\ $1 \\ n[an-margin]
level \\ n[rst2man-indent-level]
level margin: \\ n[rst2man-indent\\ n[rst2man-indent-level]]
-
\\ n[rst2man-indent0]
\\ n[rst2man-indent1]
\\ n[rst2man-indent2]
. .
.de1 INDENT
. \" .rstReportMargin pre:
. RS \\ $1
. nr rst2man-indent\\n[rst2man-indent-level] \\ n[an-margin]
. nr rst2man-indent-level +1
. \" .rstReportMargin post:
. .
.de UNINDENT
. RE
. \" indent \\n[an-margin]
. \" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
. \" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\ n[rst2man-indent\\n[rst2man-indent-level]]u
. .
.INDENT 0 .0
.TP
.B Authors
Brian C. Lane <\fI \% bcl@redhat.com\fP >
.UNINDENT
.sp
2020-10-01 22:48:47 +00:00
\fB composer\- cli\fP is an interactive tool for use with a WELDR API server,
managing blueprints, exploring available packages, and building new images.
\fI lorax\- composer <lorax\- composer.html>\fP and \fI osbuild\- composer
<https://osbuild.org>\fP both implement compatible servers.
2018-10-24 17:06:12 +00:00
.sp
2020-10-01 22:48:47 +00:00
It requires the server to be installed on the local system, and the user
running it needs to be a member of the \fB weldr\fP group. They do not need to be
root, but all of the \fI \% security precautions\fP
apply.
2018-10-24 17:06:12 +00:00
.SH COMPOSER-CLI CMDLINE ARGUMENTS
.sp
Lorax Composer commandline tool
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
2020-10-01 22:48:47 +00:00
usage: composer\- cli [\- h] [\- j] [\- s SOCKET] [\- \- log LOG] [\- a APIVER] [\- \- test TESTMODE] [\- V] ...
2018-10-24 17:06:12 +00:00
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Positional Arguments
.INDENT 0 .0
.TP
.Bargs
.UNINDENT
.SS Named Arguments
.INDENT 0 .0
.TP
.B \- j, \- \- json
Output the raw JSON response instead of the normal output.
.sp
Default: False
.TP
.B \- s, \- \- socket
Path to the socket file to listen on
.sp
Default: "/run/weldr/api.socket"
.TP
.B \- \- log
Path to logfile (./composer\- cli.log)
.TP
.B \- a, \- \- api
API Version to use
.sp
2019-10-16 21:01:30 +00:00
Default: "1"
2018-10-24 17:06:12 +00:00
.TP
.B \- \- test
Pass test mode to compose. 1=Mock compose with fail. 2=Mock compose with finished.
.sp
Default: 0
.TP
.B \- V
show program\(aq s version number and exit
.sp
Default: False
.UNINDENT
.sp
.INDENT 0 .0
.TP
2020-10-01 22:48:47 +00:00
.B compose start [\-\-size XXXX] <BLUEPRINT> <TYPE> [<IMAGE\-NAME> <PROVIDER> <PROFILE> | <IMAGE\-NAME> <PROFILE.TOML>]
2019-10-16 21:01:30 +00:00
Start a compose using the selected blueprint and output type. Optionally start an upload.
2020-10-01 22:48:47 +00:00
\- \- size is supported by osbuild\- composer, and is in MiB.
.TP
.B compose start\-ostree [\-\-size XXXX] [\-\-parent PARENT] [\-\-ref REF] <BLUEPRINT> <TYPE> [<IMAGE\-NAME> <PROFILE.TOML>]
Start an ostree compose using the selected blueprint and output type. Optionally start an upload. This command
is only supported by osbuild\- composer. \- \- size is in MiB.
2018-10-24 17:06:12 +00:00
.TP
.B compose types
List the supported output types.
.TP
.B compose status
List the status of all running and finished composes.
.TP
.B compose list [waiting|running|finished|failed]
List basic information about composes.
.TP
.B compose log <UUID> [<SIZE>]
Show the last SIZE kB of the compose log.
.TP
.B compose cancel <UUID>
Cancel a running compose and delete any intermediate results.
.TP
.B compose delete <UUID,...>
Delete the listed compose results.
.TP
.B compose info <UUID>
Show detailed information on the compose.
.TP
.B compose metadata <UUID>
Download the metadata use to create the compose to <uuid>\- metadata.tar
.TP
.B compose logs <UUID>
Download the compose logs to <uuid>\- logs.tar
.TP
.B compose results <UUID>
Download all of the compose results; metadata, logs, and image to <uuid>.tar
.TP
.B compose image <UUID>
Download the output image from the compose. Filename depends on the type.
.TP
.B blueprints list
List the names of the available blueprints.
.TP
.B blueprints show <BLUEPRINT,...>
Display the blueprint in TOML format.
.TP
.B blueprints changes <BLUEPRINT,...>
Display the changes for each blueprint.
.TP
.B blueprints diff <BLUEPRINT> <FROM\-COMMIT> <TO\-COMMIT>
Display the differences between 2 versions of a blueprint.
FROM\- COMMIT can be a commit hash or NEWEST
TO\- COMMIT can be a commit hash, NEWEST, or WORKSPACE
.TP
.B blueprints save <BLUEPRINT,...>
Save the blueprint to a file, <BLUEPRINT>.toml
.TP
.B blueprints delete <BLUEPRINT>
Delete a blueprint from the server
.TP
.B blueprints depsolve <BLUEPRINT,...>
Display the packages needed to install the blueprint.
.TP
.B blueprints push <BLUEPRINT>
Push a blueprint TOML file to the server.
.TP
.B blueprints freeze <BLUEPRINT,...>
Display the frozen blueprint\(aq s modules and packages.
.TP
.B blueprints freeze show <BLUEPRINT,...>
Display the frozen blueprint in TOML format.
.TP
.B blueprints freeze save <BLUEPRINT,...>
Save the frozen blueprint to a file, <blueprint\- name>.frozen.toml.
.TP
.B blueprints tag <BLUEPRINT>
Tag the most recent blueprint commit as a release.
.TP
.B blueprints undo <BLUEPRINT> <COMMIT>
Undo changes to a blueprint by reverting to the selected commit.
.TP
.B blueprints workspace <BLUEPRINT>
Push the blueprint TOML to the temporary workspace storage.
.TP
.B modules list
List the available modules.
.TP
.B projects list
List the available projects.
.TP
.B projects info <PROJECT,...>
Show details about the listed projects.
.TP
.B sources list
List the available sources
.TP
.B sources info <SOURCE\-NAME,...>
Details about the source.
.TP
.B sources add <SOURCE.TOML>
Add a package source to the server.
.TP
.B sources change <SOURCE.TOML>
Change an existing source
.TP
.B sources delete <SOURCE\-NAME>
Delete a package source.
.UNINDENT
.sp
status show Show API server status.
2019-10-16 21:01:30 +00:00
.INDENT 0 .0
.TP
.B upload info <UPLOAD\-UUID>
Details about an upload
.TP
.B upload start <BUILD\-UUID> <IMAGE\-NAME> [<PROVIDER> <PROFILE>|<PROFILE.TOML>]
Upload a build image to the selected provider.
.TP
.B upload log <UPLOAD\-UUID>
Show the upload log
.TP
.B upload cancel <UPLOAD\-UUID>
Cancel an upload with that is queued or in progress
.TP
.B upload delete <UPLOAD\-UUID>
Delete the upload and remove it from the build
.TP
.B upload reset <UPLOAD\-UUID>
Reset the upload so that it can be tried again
.TP
.B providers list <PROVIDER>
List the available providers, or list the <provider\(aq s> available profiles
.TP
.B providers show <PROVIDER> <PROFILE>
show the details of a specific provider\(aq s profile
.TP
.B providers push <PROFILE.TOML>
Add a new profile, or overwrite an existing one
.TP
.B providers save <PROVIDER> <PROFILE>
Save the profile\(aq s details to a TOML file named <PROFILE>.toml
.TP
.B providers delete <PROVIDER> <PROFILE>
Delete a profile from a provider
.UNINDENT
2018-10-24 17:06:12 +00:00
.SH EDIT A BLUEPRINT
.sp
Start out by listing the available blueprints using \fB composer\- cli blueprints
list\fP , pick one and save it to the local directory by running \fB composer\- cli
blueprints save http\- server\fP \& . If there are no blueprints available you can
copy one of the examples \fI \% from the test suite\fP \& .
.sp
Edit the file (it will be saved with a .toml extension) and change the
description, add a package or module to it. Send it back to the server by
running \fB composer\- cli blueprints push http\- server.toml\fP \& . You can verify that it was
saved by viewing the changelog \- \fB composer\- cli blueprints changes http\- server\fP \& .
.SH BUILD AN IMAGE
.sp
Build a \fB qcow2\fP disk image from this blueprint by running \fB composer\- cli
compose start http\- server qcow2\fP \& . It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.
.sp
The available types of images is displayed by \fB composer\- cli compose types\fP \& .
2019-04-17 19:12:11 +00:00
Currently this consists of: alibaba, ami, ext4\- filesystem, google, hyper\- v,
live\- iso, openstack, partitioned\- disk, qcow2, tar, vhd, vmdk
2019-10-16 21:01:30 +00:00
.sp
You can optionally start an upload of the finished image, see \fI \% Image Uploads\fP for
more information.
2018-10-24 17:06:12 +00:00
.SH MONITOR THE BUILD STATUS
.sp
Monitor it using \fB composer\- cli compose status\fP , which will show the status of
all the builds on the system. You can view the end of the anaconda build logs
once it is in the \fB RUNNING\fP state using \fB composer\- cli compose log UUID\fP
where UUID is the UUID returned by the start command.
.sp
Once the build is in the \fB FINISHED\fP state you can download the image.
.SH DOWNLOAD THE IMAGE
.sp
Downloading the final image is done with \fB composer\- cli compose image UUID\fP and it will
save the qcow2 image as \fB UUID\- disk.qcow2\fP which you can then use to boot a VM like this:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
qemu\- kvm \- \- name test\- image \- m 1024 \- hda ./UUID\- disk.qcow2
.ft P
.fi
.UNINDENT
.UNINDENT
2019-10-16 21:01:30 +00:00
.SH IMAGE UPLOADS
.sp
\fB composer\- cli\fP can upload the images to a number of services, including AWS,
OpenStack, and vSphere. The upload can be started when the build is finished,
by using \fB composer\- cli compose start ...\fP or an existing image can be uploaded
with \fB composer\- cli upload start ...\fP \& . In order to access the service you need
to pass authentication details to composer\- cli using a TOML file, or reference
a previously saved profile.
2020-10-01 22:48:47 +00:00
.sp
\fB lorax\- composer\fP and \fB osbuild\- composer\fP handle this differently, with
\fB osbuild\- composer\fP you can currently only specify upload targets during the
compose process.
2019-10-16 21:01:30 +00:00
.SH PROVIDERS
.sp
Providers are the services providers with Ansible playbook support under
\fB /usr/share/lorax/lifted/providers/\fP , you will need to gather some provider
specific information in order to authenticate with it. You can view the
required fields using \fB composer\- cli providers template <PROVIDER>\fP , eg. for AWS
you would run:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
composer\- cli upload template aws
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The output looks like this:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
provider = "aws"
[settings]
aws_access_key = "AWS Access Key"
aws_bucket = "AWS Bucket"
aws_region = "AWS Region"
aws_secret_key = "AWS Secret Key"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Save this into an \fB aws\- credentials.toml\fP file and use it when running \fB start\fP \& .
.SS AWS
.sp
The access key and secret key can be created by going to the
\fB IAM\- >Users\- >Security Credentials\fP 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\(aq t already exist.
.sp
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.
.SH PROFILES
.sp
Profiles store the authentication settings associated with a specific provider.
Providers can have multiple profiles, as long as their names are unique. For
example, you may have one profile for testing and another for production
uploads.
.sp
Profiles are created by pushing the provider settings template to the server using
\fB composer\- cli providers push <PROFILE.TOML>\fP where \fB PROFILE.TOML\fP is the same as the
provider template, but with the addition of a \fB profile\fP field. For example, an AWS
profile named \fB test\- uploads\fP would look like this:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
provider = "aws"
profile = "test\- uploads"
[settings]
aws_access_key = "AWS Access Key"
aws_bucket = "AWS Bucket"
aws_region = "AWS Region"
aws_secret_key = "AWS Secret Key"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can view the profile by using \fB composer\- cli providers aws test\- uploads\fP \& .
.SH BUILD AN IMAGE AND UPLOAD RESULTS
.sp
If you have a profile named \fB test\- uploads\fP :
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
composer\- cli compose start example\- http\- server ami "http image" aws test\- uploads
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or if you have the settings stored in a TOML file:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
composer\- cli compose start example\- http\- server ami "http image" aws\- settings.toml
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
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 \fB composer\- cli upload info <UPLOAD\- UUID>\fP
.sp
You can also view the upload logs from the Ansible playbook with:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
\(ga \(ga composer\- cli upload log <UPLOAD\- UUID>\(ga \(ga
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The type of the image must match the type supported by the provider.
.SH UPLOAD AN EXISTING IMAGE
.sp
You can upload previously built images, as long as they are in the \fB FINISHED\fP state, using \fB composer\- cli upload start ...\(ga \fP \& . If you have a profile named \fB test\- uploads\fP :
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
composer\- cli upload start <UUID> "http\- image" aws test\- uploads
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or if you have the settings stored in a TOML file:
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
composer\- cli upload start <UUID> "http\- image" aws\- settings.toml
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will output the UUID of the upload, which can then be used to monitor the status in the same way
described above.
2020-10-01 22:48:47 +00:00
.SH DEBUGGING
.sp
There are a couple of arguments that can be helpful when debugging problems.
These are only meant for debugging and should not be used to script access to
the API. If you need to do that you can communicate with it directly in the
language of your choice.
.sp
\fB \- \- json\fP will return the server\(aq s response as a nicely formatted json output
instead of printing what the command would usually print.
.sp
\fB \- \- test=1\fP will cause a compose start to start creating an image, and then
end with a failed state.
.sp
\fB \- \- test=2\fP will cause a compose to start and then end with a finished state,
without actually composing anything.
2018-10-24 17:06:12 +00:00
.SH AUTHOR
Weldr Team
.SH COPYRIGHT
2018, Red Hat, Inc.
. \" Generated by docutils manpage writer.
.