Commit graph

14 commits

Author SHA1 Message Date
Achilleas Koutsou
03e86cc31a spec: remove dnf-json service and socket
dnf-json is a standalone script again.  The service and socket are
removed.
2022-06-01 11:36:52 +01:00
Thomas Lavocat
ca126e9747 dnf-json: Change dnf-json to be a daemon
The service is started via systemd activation sockets.
The service serves http POST requests, the same json as before is
expected as the body of the request, and the same json as before is sent
as the response of the request.
2021-12-15 09:41:32 +01:00
Martin Sehnoutka
e310d4e4f0 distribution: Use After=network.target instead of multi-user
There is no need for osbuild-composer to wait until the whole multi-user
target is completed. It can be started earlier as it doesn't have any
dependencies in the target.

This can be a problem if there is a unit in the target that is not starting
and still is unrelated to osbuild-composer. There was a bug like this
with Plymouth where the service didn't finish and it was hanging. That
prevented osbuild-composer from starting and the user was left with
working SSH connection and shell, but composer-cli and systemctl start
osbuild-composer.service were both unresponsive.

Replace After=multi-user.target with After=network.target to start
osbuild-composer earlier.
2021-09-24 14:15:10 +02:00
Ondřej Budai
dc1b84fcfe composer: split out the local worker socket
Everybody hates the local workers. The first step of getting rid of them
is to split their socket out of osbuild-composer.socket - we need to keep
this one to support the Weldr API but the local worker socket can live in
its own file.

The behaviour should be the same for now: osbuild-composer.service always
starts the local worker socket.

However, this split allows the osbuild-composer executable to be run without
the Weldr API activated. The following commit explores this option more
in depth.

Note that the new socket can be used by root only because workers are always
run as root.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-11-17 17:01:18 +00:00
Lars Karlitski
aa0c037bb2 osbuild-worker: support canceling jobs
Exit the whole worker process when a job was canceled, because osbuild
does not clean up all child processes when receiving SIGKILL.

Change the service to restart osbuild-worker also on success, and
decrease the restart timeout.
2020-06-12 10:00:50 +02:00
Tom Gundersen
6002a128b8 osbuild-worker: don't flush cache between jobs
Until osbuild-14, the images were unconditionally kept in the cache,
meaning the cache could grow very large. Now only the downloaded RPMs
are saved, which greatly limits how big it can grow.

Having the RPMs cached should speed up all but the first image build a
lot, so we should take advantage of that by not flushing the cache
between each build.

The cache is still flushed when the worker is stopped / restarted.

This moves the cache from /var/tmp/osbulid-worker* to
/var/cache/osbulid-worker/osbulid-worker-*. This means that each worker
gets a dedicated cache, in case there are several on one machine. In the
future we may want to combine them and only ever have one cache, but for
that we need improvements in parallel access and cache-cleanup.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-07 19:22:52 +02:00
Lars Karlitski
f8982f4a1a worker: don't hard code path to unix domain socket
Introduce a mandatory argument `address`, which is interpreted as a path
to a unix socket when `-unix` is given or a network address otherwise.

Move the default path to the service file.

Add a more useful usage message when passing `-help` or no arguments.
2020-03-25 14:05:44 +01:00
Tom Gundersen
8b7b592bd2 disbtribution/worker: drop cache directory
This is not currently used. Drop it for now, until we use it, and
when we do, it should be reintroduced with the right name, to avoid
clashing with osbuild-composer (they are owned by different users,
so cannot be shared).

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-02-20 15:26:54 +01:00
Ondřej Budai
412ce45667 worker: Remove unused -C argument
It isn't defined anywhere in the code, therefore it had no effect in the
unit file.
2020-02-20 13:47:59 +01:00
Tom Gundersen
b9e20c4c06 service: adjust the IO and CPU scheduling classes
Image generation is very much a batch job, latency is not important
and because it is so CPU and IO intensive, it really affects the
overall responsiveness of the system if left on the default settings.

Set scheduling to idle/batched for the worker. The composer service
is still left in the normal scheduling classes as its latency is
important for the UI.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-12-13 20:13:15 +01:00
Tom Gundersen
df73a9bfad service: make sure the worker pulls in the socket
The worker cannot be started unless the socket is available, so make
this a hard requirement.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-12-11 15:23:24 +01:00
Tom Gundersen
ef6fbe2a25 service: pull in the worker at runtime
Rather than enabling the worker when composer is enabled, make sure
it is started whenever composer is.

This means that one worker instance is always available, and more can
be enabled if required. They are then also started whenever composer
is.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-12-11 15:23:24 +01:00
Tom Gundersen
88c0cf4b27 distro: move binaries to /usr/libexec to follow Fedora packaging guidelines
This makes no difference, so let's just put them where the Fedora
guidelines say they should be.

Also, make sure to own the containing directory.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-11-11 21:13:43 +00:00
Martin Sehnoutka
4dbba6398a fix worker service template
It is not properly named so it does not work for starting multiple
instances. This should fix it.
2019-10-04 01:49:16 +02:00
Renamed from distribution/osbuild-worker.service (Browse further)