debian-forge-composer/internal
Lars Karlitski b5769add2c store: move queue out of the store
The store is responsible for two things: user state and the compose queue. This
is problematic, because the rcm API has slightly different semantics from weldr
and only used the queue part of the store. Also, the store is simply too
complex.

This commit splits the queue part out, using the new jobqueue package in both
the weldr and the rcm package. The queue is saved to a new directory `queue/`.

The weldr package now also has access to a worker server to enqueue and list
jobs. Its store continues to track composes, but the `QueueStatus` for each
compose (and image build) is deprecated. The field in `ImageBuild` is kept for
backwards compatibility for composes which finished before this change, but a
lot of code dealing with it in package compose is dropped.

store.PushCompose() is degraded to storing a new compose. It should probably be
renamed in the future. store.PopJob() is removed.

Job ids are now independent of compose ids. Because of that, the local
target gains ComposeId and ImageBuildId fields, because a worker cannot
infer those from a job anymore. This also necessitates a change in the
worker API: the job routes are changed to expect that instead of a
(compose id, image build id) pair. The route that accepts built images
keeps that pair, because it reports the image back to weldr.

worker.Server() now interacts with a job queue instead of the store. It gains
public functions that allow enqueuing an osbuild job and getting its status,
because only it knows about the specific argument and result types in the job
queue (OSBuildJob and OSBuildJobResult). One oddity remains: it needs to report
an uploaded image to weldr. Do this with a function that's passed in for now,
so that the dependency to the store can be dropped completely.

The rcm API drops its dependencies to package blueprint and store, because it
too interacts only with the worker server now.

Fixes #342
2020-05-08 14:53:00 +02:00
..
blueprint tests: add coverage for internal/blueprint/customizations.go 2020-03-31 16:47:00 +02:00
client store: move queue out of the store 2020-05-08 14:53:00 +02:00
common common: drop unused image types 2020-04-03 08:46:50 +02:00
compose store: move queue out of the store 2020-05-08 14:53:00 +02:00
crypt crypt_test: don't run on macOS 2020-04-09 13:21:30 +02:00
distro Assert existing pipelines in TestDistro_Manifest 2020-05-08 10:12:28 +03:00
jobqueue Add jobqueue package 2020-05-08 14:53:00 +02:00
jsondb jsondb: add List method 2020-05-08 14:53:00 +02:00
mocks store: move queue out of the store 2020-05-08 14:53:00 +02:00
osbuild osbuild: remove tar image size 2020-04-29 12:36:43 +02:00
rcm store: move queue out of the store 2020-05-08 14:53:00 +02:00
rpmmd dnf-json: set metadata_expire 2020-04-11 19:14:02 +02:00
store store: move queue out of the store 2020-05-08 14:53:00 +02:00
target store: move queue out of the store 2020-05-08 14:53:00 +02:00
test test/helpers: include error return when route fails 2020-05-08 14:53:00 +02:00
upload upload/azure: force .vhd extension 2020-04-29 18:15:13 +02:00
weldr store: move queue out of the store 2020-05-08 14:53:00 +02:00
worker store: move queue out of the store 2020-05-08 14:53:00 +02:00