Setup for composing an image
The new output type must add a kickstart template to ./share/composer/ where the name of the kickstart (without the trailing .ks) matches the entry in compose_args.
The kickstart should not have any url or repo entries, these will be added at build time. The %packages section should be the last thing, and while it can contain mandatory packages required by the output type, it should not have the trailing %end because the package NEVRAs will be appended to it at build time.
compose_args should have a name matching the kickstart, and it should set the novirt_install parameters needed to generate the desired output. Other types should be set to False.
Returns the settings to pass to novirt_install for the compose type
Parameters: | compose_type (str) – The type of compose to create, from compose_types() |
---|
This will return a dict of options that match the ArgumentParser options for livemedia-creator. These are the ones the define the type of output, it’s filename, etc. Other options will be filled in by make_compose()
Returns a list of the supported output types
The output types come from the kickstart names in /usr/share/lorax/composer/*ks
Move the final image to the results_dir and cleanup the unneeded compose files
Parameters: |
|
---|
Return a kickstart line with the correct args.
Set url to “baseurl” if it is a repo, leave it as “url” for the installation url.
lorax-composer configuration
Parameters: |
---|
Convert the changelog to a string
Parameters: | changelog (tuple) – A list of time, author, string tuples. |
---|---|
Returns: | The most recent changelog text or “” |
Return type: | str |
This returns only the most recent changelog entry.
Convert time since epoch to a string
Parameters: | t (int) – Seconds since epoch |
---|---|
Returns: | Time string |
Return type: | str |
Return the epoch:version-release.arch for the dep
Parameters: | dep (dict) – dependency dict |
---|---|
Returns: | epoch:version-release.arch |
Return type: | str |
Estimate the installed size of a package list
Parameters: |
|
---|---|
Returns: | The estimated size of installed packages |
Return type: | int |
Estimating actual requirements is difficult without the actual file sizes, which yum doesn’t provide access to. So use the file count and block size to estimate a minimum size for each package.
Return details about a module, including dependencies
Parameters: |
|
---|---|
Returns: | List of dicts with module details and dependencies. |
Return type: | list of dicts |
Return a list of modules
Parameters: |
|
---|---|
Returns: | List of module information and total count |
Return type: | tuple of a list of dicts and an Int |
Modules don’t exist in RHEL7 so this only returns projects and sets the type to “rpm”
Return the dependencies for a list of projects
Parameters: |
|
---|---|
Returns: | NEVRA’s of the project and its dependencies |
Return type: | list of dicts |
Return the dependencies and installed size for a list of projects
Parameters: |
|
---|---|
Returns: | installed size and a list of NEVRA’s of the project and its dependencies |
Return type: | tuple of (int, list of dicts) |
Return details about specific projects
Parameters: |
|
---|---|
Returns: | List of project info dicts with yaps_to_project as well as epoch, version, release, etc. |
Return type: | list of dicts |
Return a list of projects
Parameters: | yb (YumBase) – yum base object |
---|---|
Returns: | List of project info dicts with name, summary, description, homepage, upstream_vcs |
Return type: | list of dicts |
Extract the info from a TransactionMember object
Parameters: | tm (TransactionMember) – A Yum transaction object |
---|---|
Returns: | A dict with name, epoch, version, release, arch |
Return type: | dict |
Extract the name from a YumAvailablePackageSqlite object
Parameters: | yaps (YumAvailablePackageSqlite) – Yum object with package details |
---|---|
Returns: | A dict with name, and group_type |
Return type: | dict |
group_type is hard-coded to “rpm”
Extract the details from a YumAvailablePackageSqlite object
Parameters: | yaps (YumAvailablePackageSqlite) – Yum object with package details |
---|---|
Returns: | A dict with the name, summary, description, and url. |
Return type: | dict |
upstream_vcs is hard-coded to UPSTREAM_VCS
Extract the details from a YumAvailablePackageSqlite object
Parameters: | yaps (YumAvailablePackageSqlite) – Yum object with package details |
---|---|
Returns: | A dict with the project details, as well as epoch, release, arch, build_time, changelog, ... |
Return type: | dict |
metadata entries are hard-coded to {}
Functions to monitor compose queue and run anaconda
Return the details of finished or failed builds
Parameters: |
|
---|---|
Returns: | A list of the build details (from compose_details) |
Return type: | list of dicts |
This returns a list of build details for each of the matching builds on the system. It does not return the status of builds that have not been finished. Use queue_status() for those.
Return details about the build.
Parameters: | results_dir (str) – The directory containing the metadata and results for the build |
---|---|
Returns: | A dictionary with details about the compose |
Return type: | dict |
Raises : | IOError if it cannot read the directory, STATUS, or blueprint file. |
The following details are included in the dict:
Return the type of composition.
Parameters: | results_dir (str) – The directory containing the metadata and results for the build |
---|---|
Returns: | The type of compose (eg. ‘tar’) |
Return type: | str |
Raises : | RuntimeError if no kickstart template can be found. |
Return the filename and full path of the build’s image file
Parameters: | uuid (str) – The UUID of the build |
---|---|
Returns: | The image filename and full path |
Return type: | tuple of strings |
Raises : | RuntimeError if there was a problem (eg. invalid uuid, missing config file) |
Run anaconda with the final-kickstart.ks from results_dir
Parameters: |
|
---|---|
Returns: | Nothing |
Raises : | May raise various exceptions |
This takes the final-kickstart.ks, and the settings in config.toml and runs Anaconda in no-virt mode (directly on the host operating system). Exceptions should be caught at the higer level.
If there is a failure, the build artifacts will be cleaned up, and any logs will be moved into logs/anaconda/ and their ownership will be set to the user from the cfg object.
Monitor the queue for new compose requests
Parameters: | cfg (DataHolder) – Configuration settings |
---|---|
Returns: | Does not return |
The queue has 2 subdirectories, new and run. When a compose is ready to be run a symlink to the uniquely named results directory should be placed in ./queue/new/
When the it is ready to be run (it is checked every 30 seconds or after a previous compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file will be created in the results directory.
STATUS can contain one of: RUNNING, FINISHED, FAILED
If the system is restarted while a compose is running it will move any old symlinks from ./queue/run/ to ./queue/new/ and rerun them.
Return details about what is in the queue.
Parameters: | cfg (ComposerConfig) – Configuration settings |
---|---|
Returns: | A list of the new composes, and a list of the running composes |
Return type: | dict |
This returns a dict with 2 lists. “new” is the list of uuids that are waiting to be built, and “run” has the uuids that are being built (currently limited to 1 at a time).
Start the queue monitor as a mp process
Parameters: | |
---|---|
Returns: | None |
Cancel a build and delete its results
Parameters: |
|
---|---|
Returns: | True if it was canceled and deleted |
Return type: | bool |
Only call this if the build status is WAITING or RUNNING
Delete all of the results from a compose
Parameters: |
|
---|---|
Returns: | True if it was deleted |
Return type: | bool |
Raises : | This will raise an error if the delete failed |
Return the filename and full path of the build’s image file
Parameters: |
|
---|---|
Returns: | The image filename and full path |
Return type: | tuple of strings |
Raises : | RuntimeError if there was a problem (eg. invalid uuid, missing config file) |
Return information about the composition
Parameters: |
|
---|---|
Returns: | dictionary of information about the composition |
Return type: | dict |
Raises : | RuntimeError if there was a problem |
This will return a dict with the following fields populated:
Return size kbytes from the end of the anaconda.log
Parameters: | |
---|---|
Returns: | Up to size kbytes from the end of the log |
Return type: | str |
Raises : | RuntimeError if there was a problem (eg. no log file available) |
This function tries to return lines from the end of the log, it will attempt to start on a line boundry, and may return less than size kbytes.
Return the details of a specific UUID compose
Parameters: |
|
---|---|
Returns: | Details about the build |
Return type: | dict or None |
Returns the same dict as compose_details()
Return a tar of the build data
Parameters: | |
---|---|
Returns: | A stream of bytes from tar |
Return type: | A generator |
Raises : | RuntimeError if there was a problem (eg. missing config file) |
This yields an uncompressed tar’s data to the caller. It includes the selected data to the caller by returning the Popen stdout from the tar process.
Bases: pylorax.base.DataHolder
Bases: dict
A Recipe of package and modules
This is a subclass of dict that enforces the constructor arguments and adds a .filename property to return the recipe’s filename, and a .toml() function to return the recipe as a TOML string.
semver recipe version number bump
Parameters: | old_version (str) – An optional old version number |
---|---|
Returns: | The new version number or None |
Return type: | str |
Raises : | ValueError |
If neither have a version, 0.0.1 is returned If there is no old version the new version is checked and returned If there is no new version, but there is a old one, bump its patch level If the old and new versions are the same, bump the patch level If they are different, check and return the new version
Return the Recipe’s filename
Replaces spaces in the name with ‘-‘ and appends .toml
Commit a recipe to a branch
Parameters: |
|
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Commit all *.toml files from a directory, if they aren’t already in git.
Parameters: | |
---|---|
Returns: | None |
Raises : | Can raise errors from Ggit or RecipeFileError |
Files with Toml or RecipeFileErrors will be skipped, and the remainder will be tried.
Commit a recipe file to a branch
Parameters: | |
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit or RecipeFileError |
Delete a file from a branch.
Parameters: | |
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Delete a recipe from a branch.
Parameters: | |
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Return the differences between two lists of dicts.
Parameters: |
|
---|---|
Returns: | List of diff dicts with old/new entries |
Return type: | list(dict) |
Find the tag that matches the commit_id
Parameters: | |
---|---|
Returns: | The tag or None if there isn’t one |
Return type: | str or None |
There should be only 1 tag pointing to a commit, but there may not be a tag at all.
The tag will look like: ‘refs/tags/<branch>/<filename>/r<revision>’
Find the dict matching the name in a list and return it.
Parameters: |
|
---|---|
Returns: | First dict with matching name, or None |
Return type: | dict or None |
Return the details about a specific commit.
Parameters: |
|
---|---|
Returns: | Details about the commit |
Return type: | CommitDetails |
Raises : | CommitTimeValError or Ggit exceptions |
Return the revision number from a tag
Parameters: | tag (str) – The tag to exract the revision from |
---|---|
Returns: | The integer revision or None |
Return type: | int or None |
The revision is the part after the r in ‘branch/filename/rXXX’
Get the branch’s HEAD Commit Object
Parameters: |
|
---|---|
Returns: | Branch’s head commit |
Return type: | Git.Commit |
Raises : | Can raise errors from Ggit |
Check to see if a tag points to a specific commit.
Parameters: |
|
---|---|
Returns: | True if the tag points to the commit, False otherwise |
Return type: | bool |
Check to see if the commit is different from its parents
Parameters: |
|
---|---|
Retuns : | True if filename in the commit is different from its parents |
Return type: | bool |
Return a sorted list of the files on the branch HEAD
Parameters: |
|
---|---|
Returns: | A sorted list of the filenames |
Return type: | list(str) |
Raises : | Can raise errors from Ggit |
Return a sorted list of the files on a commit
Parameters: |
|
---|---|
Returns: | A sorted list of the filenames |
Return type: | list(str) |
Raises : | Can raise errors from Ggit |
List the commit history of a file on a branch.
Parameters: | |
---|---|
Returns: | A list of commit details |
Return type: | list(CommitDetails) |
Raises : | Can raise errors from Ggit |
Open an existing repo, or create a new one
Parameters: | path (string) – path to recipe directory |
---|---|
Returns: | A repository object |
Return type: | Git.Repository |
Raises : | Can raise errors from Ggit |
A bare git repo will be created in the git directory of the specified path. If a repo already exists it will be opened and returned instead of creating a new one.
Prepare for a commit
Parameters: |
|
---|---|
Returns: | (Tree, Sig, Ref) |
Return type: | tuple |
Raises : | Can raise errors from Ggit |
Return the contents of a file on a specific branch or commit.
Parameters: | |
---|---|
Returns: | The commit id, and the contents of the commit |
Return type: | tuple(str, str) |
Raises : | Can raise errors from Ggit |
If no commit is passed the master:filename is returned, otherwise it will be commit:filename
Return the raw content of the blob specified by the spec
Parameters: |
|
---|---|
Returns: | Contents of the commit |
Return type: | str |
Raises : | Can raise errors from Ggit |
eg. To read the README file from master the spec is “master:README”
Read a recipe commit and its id from git
Parameters: | |
---|---|
Returns: | The commit id, and a Recipe object |
Return type: | tuple(str, Recipe) |
Raises : | Can raise errors from Ggit |
If no commit is passed the master:filename is returned, otherwise it will be commit:filename
Read a recipe commit from git and return a Recipe object
Parameters: | |
---|---|
Returns: | A Recipe object |
Return type: | Recipe |
Raises : | Can raise errors from Ggit |
If no commit is passed the master:filename is returned, otherwise it will be commit:filename
Diff two versions of a recipe
Parameters: |
|
---|---|
Returns: | A list of diff dict entries with old/new |
Return type: | list(dict) |
Return the toml filename for a recipe
Replaces spaces with ‘-‘ and appends ‘.toml’
Create a Recipe object from a plain dict.
Parameters: | recipe_dict (dict) – A plain dict of the recipe |
---|---|
Returns: | A Recipe object |
Return type: | Recipe |
Raises : | RecipeError |
Return a recipe file as a Recipe object
Parameters: | recipe_path (str) – Path to the recipe fila |
---|---|
Returns: | A Recipe object |
Return type: | Recipe |
Create a Recipe object from a toml string.
Parameters: | recipe_str (str) – The Recipe TOML string |
---|---|
Returns: | A Recipe object |
Return type: | Recipe |
Raises : | TomlError |
Revert the contents of a file to that of a previous commit
Parameters: | |
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Revert the contents of a recipe to that of a previous commit
Parameters: | |
---|---|
Returns: | OId of the new commit |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Tag a file’s most recent commit
Parameters: | |
---|---|
Returns: | Tag id or None if it failed. |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
This uses git tags, of the form refs/tags/<branch>/<filename>/r<revision> Only the most recent recipe commit can be tagged to prevent out of order tagging. Revisions start at 1 and increment for each new commit that is tagged. If the commit has already been tagged it will return false.
Tag a file’s most recent commit
Parameters: | |
---|---|
Returns: | Tag id or None if it failed. |
Return type: | Git.OId |
Raises : | Can raise errors from Ggit |
Uses tag_file_commit()
Setup v0 of the API server
v0_api() must be called to setup the API routes for Flask
Some requests only return a status/error response.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Example response:
{ "status": true }Error response:
{ "errors": ["ggit-error: Failed to remove entry. File isn't in the tree - jboss.toml (-1)"] "status": false }
All of the blueprints routes support the optional branch argument. If it is not used then the API will use the master branch for blueprints. If you want to create a new branch use the new or workspace routes with ?branch=<branch-name> to store the new blueprint on the new branch.
List the available blueprints:
{ "limit": 20, "offset": 0, "blueprints": [ "atlas", "development", "glusterfs", "http-server", "jboss", "kubernetes" ], "total": 6 }
Return the JSON representation of the blueprint. This includes 3 top level objects. changes which lists whether or not the workspace is different from the most recent commit. blueprints which lists the JSON representation of the blueprint, and errors which will list any errors, like non-existant blueprints.
Example:
{ "changes": [ { "changed": false, "name": "glusterfs" } ], "errors": [], "blueprints": [ { "description": "An example GlusterFS server with samba", "modules": [ { "name": "glusterfs", "version": "3.7.*" }, { "name": "glusterfs-cli", "version": "3.7.*" } ], "name": "glusterfs", "packages": [ { "name": "2ping", "version": "3.2.1" }, { "name": "samba", "version": "4.2.*" } ], "version": "0.0.6" } ] }Error example:
{ "changes": [], "errors": ["ggit-error: the path 'missing.toml' does not exist in the given tree (-3)"] "blueprints": [] }
Return the commits to a blueprint. By default it returns the first 20 commits, this can be changed by passing offset and/or limit. The response will include the commit hash, summary, timestamp, and optionally the revision number. The commit hash can be passed to /api/v0/blueprints/diff/ to retrieve the exact changes.
Example:
{ "errors": [], "limit": 20, "offset": 0, "blueprints": [ { "changes": [ { "commit": "e083921a7ed1cf2eec91ad12b9ad1e70ef3470be", "message": "blueprint glusterfs, version 0.0.6 saved.", "revision": null, "timestamp": "2017-11-23T00:18:13Z" }, { "commit": "cee5f4c20fc33ea4d54bfecf56f4ad41ad15f4f3", "message": "blueprint glusterfs, version 0.0.5 saved.", "revision": null, "timestamp": "2017-11-11T01:00:28Z" }, { "commit": "29b492f26ed35d80800b536623bafc51e2f0eff2", "message": "blueprint glusterfs, version 0.0.4 saved.", "revision": null, "timestamp": "2017-11-11T00:28:30Z" }, { "commit": "03374adbf080fe34f5c6c29f2e49cc2b86958bf2", "message": "blueprint glusterfs, version 0.0.3 saved.", "revision": null, "timestamp": "2017-11-10T23:15:52Z" }, { "commit": "0e08ecbb708675bfabc82952599a1712a843779d", "message": "blueprint glusterfs, version 0.0.2 saved.", "revision": null, "timestamp": "2017-11-10T23:14:56Z" }, { "commit": "3e11eb87a63d289662cba4b1804a0947a6843379", "message": "blueprint glusterfs, version 0.0.1 saved.", "revision": null, "timestamp": "2017-11-08T00:02:47Z" } ], "name": "glusterfs", "total": 6 } ] }
Create a new blueprint, or update an existing blueprint. This supports both JSON and TOML for the blueprint format. The blueprint should be in the body of the request with the Content-Type header set to either application/json or text/x-toml.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Delete a blueprint. The blueprint is deleted from the branch, and will no longer be listed by the list route. A blueprint can be undeleted using the undo route to revert to a previous commit.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Write a blueprint to the temporary workspace. This works exactly the same as new except that it does not create a commit. JSON and TOML bodies are supported.
The workspace is meant to be used as a temporary blueprint storage for clients. It will be read by the info and diff routes if it is different from the most recent commit.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Remove the temporary workspace copy of a blueprint. The info route will now return the most recent commit of the blueprint. Any changes that were in the workspace will be lost.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
This will revert the blueprint to a previous commit. The commit hash from the changes route can be used in this request.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Tag a blueprint as a new release. This uses git tags with a special format. refs/tags/<branch>/<filename>/r<revision>. Only the most recent blueprint commit can be tagged. Revisions start at 1 and increment for each new tag (per-blueprint). If the commit has already been tagged it will return false.
The response will be a status response with status set to true, or an error response with it set to false and an error message included.
Return the differences between two commits, or the workspace. The commit hash from the changes response can be used here, or several special strings:
- NEWEST will select the newest git commit. This works for from_commit or to_commit
- WORKSPACE will select the workspace copy. This can only be used in to_commit
eg. /api/v0/blueprints/diff/glusterfs/NEWEST/WORKSPACE will return the differences between the most recent git commit and the contents of the workspace.
Each entry in the response’s diff object contains the old blueprint value and the new one. If old is null and new is set, then it was added. If new is null and old is set, then it was removed. If both are set, then it was changed.
The old/new entries will have the name of the blueprint field that was changed. This can be one of: Name, Description, Version, Module, or Package. The contents for these will be the old/new values for them.
In the example below the version was changed and the ping package was added.
Example:
{ "diff": [ { "new": { "Version": "0.0.6" }, "old": { "Version": "0.0.5" } }, { "new": { "Package": { "name": "ping", "version": "3.2.1" } }, "old": null } ] }
Return a JSON representation of the blueprint with the package and module versions set to the exact versions chosen by depsolving the blueprint.
Example:
{ "errors": [], "blueprints": [ { "blueprint": { "description": "An example GlusterFS server with samba", "modules": [ { "name": "glusterfs", "version": "3.8.4-18.4.el7.x86_64" }, { "name": "glusterfs-cli", "version": "3.8.4-18.4.el7.x86_64" } ], "name": "glusterfs", "packages": [ { "name": "ping", "version": "2:3.2.1-2.el7.noarch" }, { "name": "samba", "version": "4.6.2-8.el7.x86_64" } ], "version": "0.0.6" } } ] }
Depsolve the blueprint using yum, return the blueprint used, and the NEVRAs of the packages chosen to satisfy the blueprint’s requirements. The response will include a list of results, with the full dependency list in dependencies, the NEVRAs for the blueprint’s direct modules and packages in modules, and any error will be in errors.
Example:
{ "errors": [], "blueprints": [ { "dependencies": [ { "arch": "noarch", "epoch": "0", "name": "2ping", "release": "2.el7", "version": "3.2.1" }, { "arch": "x86_64", "epoch": "0", "name": "acl", "release": "12.el7", "version": "2.2.51" }, { "arch": "x86_64", "epoch": "0", "name": "audit-libs", "release": "3.el7", "version": "2.7.6" }, { "arch": "x86_64", "epoch": "0", "name": "avahi-libs", "release": "17.el7", "version": "0.6.31" }, ... ], "modules": [ { "arch": "noarch", "epoch": "0", "name": "2ping", "release": "2.el7", "version": "3.2.1" }, { "arch": "x86_64", "epoch": "0", "name": "glusterfs", "release": "18.4.el7", "version": "3.8.4" }, ... ], "blueprint": { "description": "An example GlusterFS server with samba", "modules": [ { "name": "glusterfs", "version": "3.7.*" }, ... } } ] }
List all of the available projects. By default this returns the first 20 items, but this can be changed by setting the offset and limit arguments.
Example:
{ "limit": 20, "offset": 0, "projects": [ { "description": "0 A.D. (pronounced "zero ey-dee") is a ...", "homepage": "http://play0ad.com", "name": "0ad", "summary": "Cross-Platform RTS Game of Ancient Warfare", "upstream_vcs": "UPSTREAM_VCS" }, ... ], "total": 21770 }
Return information about the comma-separated list of projects. It includes the description of the package along with the list of available builds.
Example:
{ "projects": [ { "builds": [ { "arch": "x86_64", "build_config_ref": "BUILD_CONFIG_REF", "build_env_ref": "BUILD_ENV_REF", "build_time": "2017-03-01T08:39:23", "changelog": "- restore incremental backups correctly, files ...", "epoch": "2", "metadata": {}, "release": "32.el7", "source": { "license": "GPLv3+", "metadata": {}, "source_ref": "SOURCE_REF", "version": "1.26" } } ], "description": "The GNU tar program saves many ...", "homepage": "http://www.gnu.org/software/tar/", "name": "tar", "summary": "A GNU file archiving program", "upstream_vcs": "UPSTREAM_VCS" } ] }
Depsolve the comma-separated list of projects and return the list of NEVRAs needed to satisfy the request.
Example:
{ "projects": [ { "arch": "noarch", "epoch": "0", "name": "basesystem", "release": "7.el7", "version": "10.0" }, { "arch": "x86_64", "epoch": "0", "name": "bash", "release": "28.el7", "version": "4.2.46" }, { "arch": "x86_64", "epoch": "0", "name": "filesystem", "release": "21.el7", "version": "3.2" }, ... ] }
Return a list of all of the available modules. This includes the name and the group_type, which is always “rpm” for lorax-composer. By default this returns the first 20 items. This can be changed by setting the offset and limit arguments.
Example:
{ "limit": 20, "modules": [ { "group_type": "rpm", "name": "0ad" }, { "group_type": "rpm", "name": "0ad-data" }, { "group_type": "rpm", "name": "0install" }, { "group_type": "rpm", "name": "2048-cli" }, ... ] "total": 21770 }
Return the list of comma-separated modules. Output is the same as /modules/list
Example:
{ "limit": 20, "modules": [ { "group_type": "rpm", "name": "tar" } ], "offset": 0, "total": 1 }
Return the module’s dependencies, and the information about the module.
Example:
{ "modules": [ { "dependencies": [ { "arch": "noarch", "epoch": "0", "name": "basesystem", "release": "7.el7", "version": "10.0" }, { "arch": "x86_64", "epoch": "0", "name": "bash", "release": "28.el7", "version": "4.2.46" }, ... ], "description": "The GNU tar program saves ...", "homepage": "http://www.gnu.org/software/tar/", "name": "tar", "summary": "A GNU file archiving program", "upstream_vcs": "UPSTREAM_VCS" } ] }
Start a compose. The content type should be ‘application/json’ and the body of the POST should look like this:
{ "blueprint_name": "http-server", "compose_type": "tar", "branch": "master" }Pass it the name of the blueprint, the type of output (from ‘/api/v0/compose/types’), and the blueprint branch to use. ‘branch’ is optional and will default to master. It will create a new build and add it to the queue. It returns the build uuid and a status if it succeeds:
{ "build_id": "e6fa6db4-9c81-4b70-870f-a697ca405cdf", "status": true }
Returns the list of supported output types that are valid for use with ‘POST /api/v0/compose’
- {
- “types”: [
- {
- “enabled”: true, “name”: “tar”
}
]
}
Return the status of the build queue. It includes information about the builds waiting, and the build that is running.
Example:
{ "new": [ { "id": "45502a6d-06e8-48a5-a215-2b4174b3614b", "blueprint": "glusterfs", "queue_status": "WAITING", "timestamp": 1517362647.4570868, "version": "0.0.6" }, { "id": "6d292bd0-bec7-4825-8d7d-41ef9c3e4b73", "blueprint": "kubernetes", "queue_status": "WAITING", "timestamp": 1517362659.0034983, "version": "0.0.1" } ], "run": [ { "id": "745712b2-96db-44c0-8014-fe925c35e795", "blueprint": "glusterfs", "queue_status": "RUNNING", "timestamp": 1517362633.7965999, "version": "0.0.6" } ] }
Return the details on all of the finished composes on the system.
Example:
{ "finished": [ { "id": "70b84195-9817-4b8a-af92-45e380f39894", "blueprint": "glusterfs", "queue_status": "FINISHED", "timestamp": 1517351003.8210032, "version": "0.0.6" }, { "id": "e695affd-397f-4af9-9022-add2636e7459", "blueprint": "glusterfs", "queue_status": "FINISHED", "timestamp": 1517362289.7193348, "version": "0.0.6" } ] }
Return the details on all of the failed composes on the system.
Example:
{ "failed": [ { "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a", "blueprint": "http-server", "queue_status": "FAILED", "timestamp": 1517523249.9301329, "version": "0.0.2" } ] }
Return the details for each of the comma-separated list of uuids.
Example:
{ "uuids": [ { "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a", "blueprint": "http-server", "queue_status": "FINISHED", "timestamp": 1517523644.2384307, "version": "0.0.2" }, { "id": "45502a6d-06e8-48a5-a215-2b4174b3614b", "blueprint": "glusterfs", "queue_status": "FINISHED", "timestamp": 1517363442.188399, "version": "0.0.6" } ] }
Cancel the build, if it is not finished, and delete the results. It will return a status of True if it is successful.
Example:
{ "status": true, "uuid": "03397f8d-acff-4cdb-bd31-f629b7a948f5" }
Delete the list of comma-separated uuids from the compose results.
Example:
{ "errors": [], "uuids": [ { "status": true, "uuid": "ae1bf7e3-7f16-4c9f-b36e-3726a1093fd0" } ] }
Get detailed information about the compose. The returned JSON string will contain the following information:
- id - The uuid of the comoposition
- config - containing the configuration settings used to run Anaconda
- blueprint - The depsolved blueprint used to generate the kickstart
- commit - The (local) git commit hash for the blueprint used
- deps - The NEVRA of all of the dependencies used in the composition
- compose_type - The type of output generated (tar, iso, etc.)
- queue_status - The final status of the composition (FINISHED or FAILED)
Example:
{ "commit": "7078e521a54b12eae31c3fd028680da7a0815a4d", "compose_type": "tar", "config": { "anaconda_args": "", "armplatform": "", "compress_args": [], "compression": "xz", "image_name": "root.tar.xz", ... }, "deps": { "packages": [ { "arch": "x86_64", "epoch": "0", "name": "acl", "release": "14.el7", "version": "2.2.51" } ] }, "id": "c30b7d80-523b-4a23-ad52-61b799739ce8", "queue_status": "FINISHED", "blueprint": { "description": "An example kubernetes master", ... } }
Returns a .tar of the metadata used for the build. This includes all the information needed to reproduce the build, including the final kickstart populated with repository and package NEVRA.
The mime type is set to ‘application/x-tar’ and the filename is set to UUID-metadata.tar
The .tar is uncompressed, but is not large.
Returns a .tar of the metadata, logs, and output image of the build. This includes all the information needed to reproduce the build, including the final kickstart populated with repository and package NEVRA. The output image is already in compressed form so the returned tar is not compressed.
The mime type is set to ‘application/x-tar’ and the filename is set to UUID.tar
Returns a .tar of the anaconda build logs. The tar is not compressed, but is not large.
The mime type is set to ‘application/x-tar’ and the filename is set to UUID-logs.tar
Returns the output image from the build. The filename is set to the filename from the build with the UUID as a prefix. eg. UUID-root.tar.xz or UUID-boot.iso.
Returns the end of the anaconda.log. The size parameter is optional and defaults to 1Mbytes if it is not included. The returned data is raw text from the end of the logfile, starting on a line boundry.
Example:
12:59:24,222 INFO anaconda: Running Thread: AnaConfigurationThread (140629395244800) 12:59:24,223 INFO anaconda: Configuring installed system 12:59:24,912 INFO anaconda: Configuring installed system 12:59:24,912 INFO anaconda: Creating users 12:59:24,913 INFO anaconda: Clearing libuser.conf at /tmp/libuser.Dyy8Gj 12:59:25,154 INFO anaconda: Creating users 12:59:25,155 INFO anaconda: Configuring addons 12:59:25,155 INFO anaconda: Configuring addons 12:59:25,155 INFO anaconda: Generating initramfs 12:59:49,467 INFO anaconda: Generating initramfs 12:59:49,467 INFO anaconda: Running post-installation scripts 12:59:49,467 INFO anaconda: Running kickstart %%post script(s) 12:59:50,782 INFO anaconda: All kickstart %%post script(s) have been run 12:59:50,782 INFO anaconda: Running post-installation scripts 12:59:50,784 INFO anaconda: Thread Done: AnaConfigurationThread (140629395244800)
Delete the recipe from the workspace
Parameters: | |
---|---|
Returns: | None |
Raises : | IO related errors |
Create the workspace’s path from a Repository and branch
Parameters: |
|
---|---|
Returns: | The path to the branch’s workspace directory |
Return type: | str |