From 26638b8e8129aa755586d017677b4cf076bafda6 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sun, 2 Jun 2024 09:15:54 +0300 Subject: services: containerd: Provision separately from docker service. containerd can operate independently without relying on Docker for its configuration. * gnu/services/docker.scm (docker-configuration): Deprecate containerd field. (containerd-configuration, containerd-service-type): New variables. (docker-shepherd-service): Use containerd-configuration. Delete duplicated variable binding. Allow to configure environment variables. (docker-service-type): Delete extension with containerd-service-type. * gnu/tests/docker.scm (%docker-os, %oci-os): Add containerd service. (run-docker-test, run-docker-system-test, run-oci-container-test): Run containerd service. * doc/guix.texi (Miscellaneous Services): Document containerd-service-type. Change-Id: Ife0924e50a3e0aa2302d6592dae51ed894600004 --- gnu/tests/docker.scm | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'gnu/tests/docker.scm') diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index d550136b4a..46c886580c 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -54,6 +54,7 @@ (service dbus-root-service-type) (service polkit-service-type) (service elogind-service-type) + (service containerd-service-type) (service docker-service-type))) (define (run-docker-test docker-tarball) @@ -88,7 +89,21 @@ inside %DOCKER-OS." (test-runner-current (system-test-runner #$output)) (test-begin "docker") - (test-assert "service running" + (test-assert "containerd service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'containerd) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + (test-assert "containerd PID file present" + (wait-for-file "/run/containerd/containerd.pid" marionette)) + + (test-assert "dockerd service running" (marionette-eval '(begin (use-modules (gnu services herd)) @@ -234,6 +249,20 @@ inside %DOCKER-OS." (test-runner-current (system-test-runner #$output)) (test-begin "docker") + (test-assert "containerd service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'containerd) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + (test-assert "containerd PID file present" + (wait-for-file "/run/containerd/containerd.pid" marionette)) + (test-assert "service running" (marionette-eval '(begin @@ -327,6 +356,7 @@ docker-image} inside Docker.") (service dbus-root-service-type) (service polkit-service-type) (service elogind-service-type) + (service containerd-service-type) (service docker-service-type) (extra-special-file "/shared.txt" (plain-file "shared.txt" "hello")) @@ -384,6 +414,20 @@ docker-image} inside Docker.") (test-runner-current (system-test-runner #$output)) (test-begin "oci-container") + (test-assert "containerd service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'containerd) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + (test-assert "containerd PID file present" + (wait-for-file "/run/containerd/containerd.pid" marionette)) + (test-assert "dockerd running" (marionette-eval '(begin -- cgit v1.2.3