guix/gnu/services
Giacomo Leidi 60f4d72590
services: Add oci-service-type.
This patch implements a generalization of the
oci-container-service-type, which consequently is made deprecated.  The
oci-service-type, in addition to all the features from the
oci-container-service-type, can now provision OCI networks and volumes.
It only handles OCI objects creation, the user is supposed to handle
state once the objects are provsioned.

It currently supports two different OCI runtimes: Docker and rootless
Podman.  Both runtimes are tested to make sure provisioned containers
can connect to each other through provisioned networks and can
read/write data with provisioned volumes.

At last the Scheme API is thought to facilitate the implementation of a
Guix Home service in the future.

* gnu/build/oci-containers.scm: New file containg OCI runtime business
logic used in OCI backed Shepherd services.
oci-read-lines
(oci-system*,oci-object-exists?,oci-object-service-available?
oci-image-load,oci-log-verbose,oci-container-execlp,oci-object-create):
New procedures.
* gnu/local.mk: Add it.
* gnu/services/containers.scm (list-of-oci-containers?,
list-of-oci-networks?,list-of-oci-volumes?,%oci-supported-runtimes,
oci-runtime?,oci-runtime-system-environment,oci-runtime-system-extra-arguments,
oci-runtime-system-requirement,oci-runtime-cli,oci-runtime-system-cli,
oci-runtime-home-cli,oci-runtime-name,oci-runtime-group,
oci-container-shepherd-name,oci-networks-shepherd-name,
oci-networks-home-shepherd-name,oci-volumes-shepherd-name,
oci-volumes-home-shepherd-name,oci-container-configuration->options,
oci-network-configuration->options,oci-volume-configuration->options,
oci-container-shepherd-service,oci-objects-merge-lst,oci-extension-merge,
oci-service-accounts,oci-service-profile,oci-service-subids,
oci-configuration->shepherd-services,oci-configuration-extend): New
procedures.
(image-reference): Implement unambiguous naming convention, that paired
with the new implementation for listing caches images with docker ls or
podman ls, allows for more efficient image caching.
(oci-container-configuration)[user,group]: Change default-type to
maybe-string, since by default containers will run under the user and
group declared in oci-configuration records. When unset the
oci-service-type will derive their value from the OCI runtime state.
[runtime,host-environment,environment,shepherd-actions,ports,extra-arguments]:
define a predicate and use it as a type in the configuration.  This
way errors are reported with source location information.
(lower-manifest): Defer to caller the logic of setting up an image tag.
(lower-oci-image): Rename to load-oci-image-state.
(oci-runtime-state): Intermediate representation of the OCI runtime
details. It is supposed to be an internal API.
(oci-state): Intermediate representation of the OCI provisioning state,
such as containers and networks. It is supposed to be an internal API.
(oci-container-invocation): Intermediate representation of the OCI
runtime run command to start a container. It is supposed to be an
internal API.
(%oci-image-loader): Rename to oci-image-loader and use
oci-runtime-state and (gnu build oci-containers).
(oci-container-shepherd-service): Use oci-state and oci-runtime-state,
add command-line action.
(oci-network-configuration,oci-volume-configuration,oci-configuration,
oci-extension): New record types.
(oci-service-type): New service-type.
* doc/guix.texi: Document it.
* gnu/tests/containers.scm: Test it.
* gnu/services/docker.scm: Deprecate the oci-container-service-type.

Change-Id: I656b3db85832e42d53072fcbfb91d1226f39ef38
Modified-by: Maxim Cournoyer <maxim@guixotic.coop>
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-08-25 13:04:36 +09:00
..
admin.scm gnu: nss-certs: Relocate to (gnu packages nss). 2025-08-17 22:34:42 +02:00
audio.scm gnu: Fix some misspellings. 2025-02-19 11:21:47 +02:00
auditd.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
authentication.scm
avahi.scm
backup.scm home: Add home-restic-backup service. 2025-05-18 22:55:53 +02:00
base.scm services: greetd: Support initial-session. 2025-07-12 02:39:54 +02:00
certbot.scm services: certbot: Add dry-run? certificate option. 2025-07-08 16:54:06 +09:00
cgit.scm
ci.scm services: ci: Add Forgejo Runner service. 2025-07-04 18:41:43 +02:00
configuration.scm services: configuration: Add define-enumerated-field-type helper. 2025-06-05 22:42:13 +02:00
containers.scm services: Add oci-service-type. 2025-08-25 13:04:36 +09:00
cuirass.scm services: cuirass: Really allow ‘parameters’ to be a file-like object. 2025-03-21 13:29:18 +01:00
cups.scm services: configuration: Add define-enumerated-field-type helper. 2025-06-05 22:42:13 +02:00
databases.scm services: postgresql-role: Add support for password files. 2025-05-02 15:32:25 +09:00
dbus.scm
desktop.scm services: plasma-desktop: Remove "bluedevil" from plasma-dbus-service. 2025-07-28 12:17:59 +08:00
dict.scm services: dico: Add symbols to help users configure FreeDict with dicod. 2025-01-26 22:09:28 +01:00
dns.scm services: knot: Depend on `user-processes'. 2025-06-20 17:59:02 +02:00
docker.scm services: Add oci-service-type. 2025-08-25 13:04:36 +09:00
file-sharing.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
games.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
ganeti.scm services: ganeti: Produce Shepherd timers instead of mcron jobs. 2025-03-23 19:30:44 +01:00
getmail.scm
guix.scm services: Add shared-cache-service-type. 2025-07-25 23:36:10 +09:00
herd.scm services: herd: Use a smarter default for %shepherd-socket-file. 2025-04-22 11:35:23 +09:00
high-availability.scm services: Add rabbitmq service. 2025-07-19 01:47:50 +01:00
hurd.scm
kerberos.scm
ldap.scm services: directory-server: Fix backend-userroot-configuration export. 2025-06-15 23:53:21 +08:00
lightdm.scm services: lightdm: Fix vnc server flag listen-address 2025-02-18 18:20:01 +01:00
linux.scm services: vfs-mapping-shepherd-services: Add missing (ice-9 match) module. 2025-08-05 21:11:47 +09:00
lirc.scm
mail.scm services: opensmtpd: Add logging to a file. 2025-04-10 15:40:25 +02:00
mcron.scm
messaging.scm services: Add mosquitto-service-type. 2025-05-09 19:47:24 +02:00
monitoring.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
networking.scm doc: Correct tor-onion-service-configuration mapping documentation. 2025-08-03 11:07:45 +02:00
nfs.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
nix.scm
pam-mount.scm
pm.scm services: tlp: Make destructor return #f on success. 2025-04-08 17:06:58 +02:00
power.scm services: configuration: Add define-enumerated-field-type helper. 2025-06-05 22:42:13 +02:00
rsync.scm services: rsync: Remove Shepherd 0.9.0 compatibility shim. 2025-06-06 18:16:30 +02:00
samba.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
science.scm
sddm.scm
security-token.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
security.scm
shepherd.scm services: system-log: Allow ‘max-silent-time’ to be #f. 2025-08-23 16:57:48 +02:00
sound.scm gnu: speakersafetyd: Add log file. 2025-04-14 13:49:29 +09:00
spice.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
ssh.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
syncthing.scm services: syncthing: Improve Syncthing code standard compliance. 2025-03-14 16:01:34 -04:00
sysctl.scm
telephony.scm gnu: nss-certs: Relocate to (gnu packages nss). 2025-08-17 22:34:42 +02:00
upnp.scm services: readymedia: Fix typo. 2025-05-24 10:54:30 -07:00
version-control.scm services: gitolite-service-type: Allow setting the admin name. 2025-04-03 21:16:24 +09:00
virtualization.scm gnu: /etc/qemu/firmware: Produce only /etc/qemu/firmware instead of /etc/qemu 2025-05-16 17:01:12 +09:00
vnc.scm gnu: tigervnc-client/server: Relocate to (gnu packages xorg). 2025-08-05 21:11:47 +09:00
vpn.scm services: configuration: Add define-enumerated-field-type helper. 2025-06-05 22:42:13 +02:00
web.scm services: nginx: Rotate log files. 2025-08-24 09:30:02 +01:00
xorg.scm services: xorg: Make startx respect XDG_VTNR. 2025-05-30 20:48:29 +08:00