Commit Graph

10 Commits

Author SHA1 Message Date
Brian C. Lane
dfcdc08844 Add /compose/cancel API to cancel a running build
If the build hasn't started yet (state is WAITING) try removing the
symlink to it. If this succeeds, delete the partial results directory.

If the build makes it to RUNNING then it writes a CANCEL file in the
results directory. The callback that is passed to execWithRedirect
catches this, causing a SIGTERM to be sent to anaconda. It then exits
and cleanup happens normally. The partial results directory is then
removed.
2018-02-13 17:22:12 -08:00
Brian C. Lane
9154044408 Add API routes for downloading build results
Also fix a bug with the name of the queue status in the status results
(it is now 'queue_status' not 'status' which is used for error
responses).

This adds the following routes:
 - /compose/metadata/<uuid> to retrieve a .tar of the build metadata
 - /compose/results/<uuid> to retrieve .tar of all of the build results
 - /compose/logs/<uuid> to retrieve a .tar of just the logs from the build
 - /compose/image/<uuid> to retrieve the output image from the build
2018-02-06 16:56:39 -08:00
Brian C. Lane
f063651e2e Add /compose/info route to retrieve details about a compose
The results is a JSON string with the following information:

* id - The uuid of the comoposition
* config - containing the configuration settings used to run Anaconda
* recipe - The depsolved recipe used to generate the kickstart
* commit - The (local) git commit hash for the recipe 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)
2018-02-06 16:55:14 -08:00
Brian C. Lane
1e73041e78 Add DELETE /compose/delete/<uuids> API route
This will delete all of the build's results and cannot be undone.
2018-02-06 16:55:14 -08:00
Brian C. Lane
da62b74d83 Add /compose/status/<uuids> to retrieve details of a specific build 2018-02-06 16:55:14 -08:00
Brian C. Lane
c5a82ffd9e Add compose status routes /compose/finished and /compose/failed
These will return a list of details about the finished or failed builds.
2018-02-06 16:55:14 -08:00
Brian C. Lane
b098e2916e Add /compose/queue to get the status of the build queue
This will return a JSON result that includes the waiting builds,
and the running builds.
2018-02-01 10:53:32 -08:00
Brian C. Lane
0346a04dad Add building an image, and the /compose route to start it
This adds the ability to build a tar output image. The /compose and
/compose/types API routes are now available.

To start a build POST a JSON body to /compose, like this:

{"recipe_name":"glusterfs", "compose_type":"tar", "branch":"master"}

This will return a unique build id:

{
  "build_id": "4d13abb6-aa4e-4c80-a671-0b867e6e77f6",
  "status": true
}

which will be used to keep track of the build status (routes for this
do not exist yet).
2018-01-29 17:14:36 -08:00
Brian C. Lane
97fe514ceb Remove test configuration and read it from the build directory 2018-01-26 16:55:56 -08:00
Brian C. Lane
8b725a1cf5 Add basic composer queue handling
The queue is in /var/lib/weldr/queue/new by default. It watches the
directory for new symlinks (to /var/lib/weldr/results/<dirname>) and
handles running anaconda on the kickstart found in final-kickstart.ks
inside the symlinked directory.
2018-01-24 12:11:03 -08:00