summaryrefslogtreecommitdiff
path: root/gnu/tests/containers.scm
AgeCommit message (Collapse)Author
2026-02-25tests: Test lowering of file-like objects values for oci-image.Giacomo Leidi
This patch is supposed to introduce a test case to ensure use cases like the one of https://codeberg.org/guix/guix/issues/3818 are working. * gnu/tests/containers.scm (%guile-oci-image): New variable. (%guile-bash-oci-image): New variable. (%oci-rootless-podman-os)[fist-container]: Use %guile-oci-image. [second-container]: Use file-like object as oci-image value. (%oci-docker-os): Ditto. Change-Id: I0052243dba2d901d497e1c0976a5aa1ebe9864a0 Reviewed-by: Owen T. Heisler <writer@owenh.net> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-12-03Update Giacomo's email address.Giacomo Leidi
The change was automated via: git grep -l goodoldpaul@autistici.org | xargs sed -i 's/goodoldpaul@autistici.org/therewasa@fishinthecalculator.me/g' * .mailmap: New entry. Change-Id: I1629388334695d221647afe6a14faf61af5fe0d6 Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-08-25Revert "tests: Use lower-oci-image-state in container tests."Giacomo Leidi
This reverts commit cc07ecd7ccc52540113414eaebafc0fb218ef9ff, which breaks 'guix pull', for to-be-investigated reasons. Fixes: #2252 Change-Id: Idd02dd2e0cd93034e636030845996a9ab3748839 Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-08-25tests: Use lower-oci-image-state in container tests.Giacomo Leidi
This patch replaces boilerplate in container related tests with oci-image plumbing from (gnu services containers). * gnu/tests/containers.scm (%oci-tarball): New variable; (run-rootless-podman-test): use %oci-tarball; (build-tarball&run-rootless-podman-test): drop procedure. * gnu/tests/docker.scm (%docker-tarball): New variable; (build-tarball&run-docker-test): use %docker-tarball; (%docker-system-tarball): New variable; (build-tarball&run-docker-system-test): new procedure. Change-Id: Iad6f0704aee188d89464c83722dea0bb7adb084a Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-08-25services: Add oci-service-type.Giacomo Leidi
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-07-24gnu: tests: Replace deprecated dhcp client service.Gabriel Wicki
* gnu/tests/audio.scm, gnu/tests/avahi.scm, gnu/tests/ci.scm, gnu/tests/containers.scm, gnu/tests/cups.scm, gnu/tests/databases.scm, gnu/tests/dict.scm, gnu/tests/dns.scm, gnu/tests/docker.scm, gnu/tests/file-sharing.scm, gnu/tests/guix.scm, gnu/tests/install.scm, gnu/tests/ldap.scm, gnu/tests/lightdm.scm, gnu/tests/mail.scm, gnu/tests/messaging.scm, gnu/tests/monitoring.scm, gnu/tests/networking.scm, gnu/tests/nfs.scm, gnu/tests/package-management.scm, gnu/tests/rsync.scm, gnu/tests/samba.scm, gnu/tests/ssh.scm, gnu/tests/telephony.scm, gnu/tests/upnp.scm, gnu/tests/version-control.scm, gnu/tests/virtualization.scm, gnu/tests/vnstat.scm, gnu/tests/web.scm: (services): Replace dhcp-client-service-type with its replacement dhcpcd-service-type. Change-Id: I01d7f9a8c01736d8c8da591aaf4749bbfa4dcdad
2025-01-11services: rootless-podman: Enable I/O delegation.Giacomo Leidi
Based on https://rootlesscontaine.rs/getting-started/common/cgroup2/#enabling-cpu-cpuset-and-io-delegation , this patch enables I/O delegation for cgroups v2 enabled users. * gnu/services/containers.scm (cgroups-limits-entrypoint): Enable I/O controller delegation. * gnu/tests/containers.scm: Test it. Change-Id: I7caba33695f11830bea477c4ab3afb89cfaa2fa5 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-01-11services: tests: Add delay for rootless Podman system test.Giacomo Leidi
* gnu/tests/containers.scm (run-rootless-podman-test): Add 60 seconds long delay before tests are actually run. Change-Id: Ifcf70f7258f9e0886bf829884d7daedc9803352b Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-18services: Add rootless-podman-service-type.Giacomo Leidi
* gnu/services/containers.scm: New file; (rootless-podman-configuration): new variable; (rootless-podman-service-subids): new variable; (rootless-podman-service-accounts): new variable; (rootless-podman-service-profile): new variable; (rootless-podman-shepherd-services): new variable; (rootless-podman-service-etc): new variable; (rootless-podman-service-type): new variable. * gnu/local.mk: Test it. * gnu/local.mk: Add them. * doc/guix.texi (Miscellaneous Services): Document it. Change-Id: I041496474c1027da353bd6852f2554a065914d7a Signed-off-by: Ludovic Courtès <ludo@gnu.org>