unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: 52550@debbugs.gnu.org
Cc: Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#52550] [PATCH 10/10] tests: docker: Fix it.
Date: Thu, 16 Dec 2021 14:06:49 +0100	[thread overview]
Message-ID: <20211216130649.30285-10-othacehe@gnu.org> (raw)
In-Reply-To: <20211216130649.30285-1-othacehe@gnu.org>

The docker tests are broken because the docker overlay doesn't support running
on our own storage overlay. Use the new <virtual-machine> volatile? field to
spawn a VM with a persistent storage and no overlay.

* gnu/tests/docker.scm (run-docker-test): Add the docker-tarball to the gc
roots as the host store is not shared anymore. Spawn a VM without volatile
storage.
(run-docker-system-test): Ditto.
(%test-docker-system): Adapt it to use the image API.
---
 gnu/tests/docker.scm | 51 +++++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 22 deletions(-)

diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm
index bc119988b7..6302bd0727 100644
--- a/gnu/tests/docker.scm
+++ b/gnu/tests/docker.scm
@@ -18,9 +18,11 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu tests docker)
+  #:use-module (gnu image)
   #:use-module (gnu tests)
   #:use-module (gnu system)
   #:use-module (gnu system file-systems)
+  #:use-module (gnu system image)
   #:use-module (gnu system vm)
   #:use-module (gnu services)
   #:use-module (gnu services dbus)
@@ -35,7 +37,7 @@ (define-module (gnu tests docker)
   #:use-module (guix monads)
   #:use-module (guix packages)
   #:use-module (guix profiles)
-  #:use-module (guix scripts pack)
+  #:use-module ((guix scripts pack) #:prefix pack:)
   #:use-module (guix store)
   #:use-module (guix tests)
   #:use-module (guix build-system trivial)
@@ -56,15 +58,18 @@ (define (run-docker-test docker-tarball)
 inside %DOCKER-OS."
   (define os
     (marionette-operating-system
-     %docker-os
+     (operating-system-with-gc-roots
+      %docker-os
+      (list docker-tarball))
      #:imported-modules '((gnu services herd)
                           (guix combinators))))
 
   (define vm
     (virtual-machine
      (operating-system os)
-     (memory-size 700)
-     (disk-image-size (* 1500 (expt 2 20)))
+     (volatile? #f)
+     (memory-size 1024)
+     (disk-image-size (* 3000 (expt 2 20)))
      (port-forwardings '())))
 
   (define test
@@ -173,11 +178,12 @@ (define (build-tarball&run-docker-test)
                                            guest-script-package))
                                     #:hooks '()
                                     #:locales? #f))
-       (tarball (docker-image "docker-pack" profile
-                              #:symlinks '(("/bin/Guile" -> "bin/guile")
-                                           ("aa.scm" -> "a.scm"))
-                              #:entry-point "bin/guile"
-                              #:localstatedir? #t)))
+       (tarball (pack:docker-image
+                 "docker-pack" profile
+                 #:symlinks '(("/bin/Guile" -> "bin/guile")
+                              ("aa.scm" -> "a.scm"))
+                 #:entry-point "bin/guile"
+                 #:localstatedir? #t)))
     (run-docker-test tarball)))
 
 (define %test-docker
@@ -192,19 +198,18 @@ (define (run-docker-system-test tarball)
 inside %DOCKER-OS."
   (define os
     (marionette-operating-system
-     %docker-os
+     (operating-system-with-gc-roots
+      %docker-os
+      (list tarball))
      #:imported-modules '((gnu services herd)
                           (guix combinators))))
 
   (define vm
     (virtual-machine
      (operating-system os)
-     ;; FIXME: Because we're using the volatile-root setup where the root file
-     ;; system is a tmpfs overlaid over a small root file system, 'docker
-     ;; load' must be able to store the whole image into memory, hence the
-     ;; huge memory requirements.  We should avoid the volatile-root setup
-     ;; instead.
-     (memory-size 4500)
+     (volatile? #f)
+     (disk-image-size (* 5000 (expt 2 20)))
+     (memory-size 2048)
      (port-forwardings '())))
 
   (define test
@@ -293,10 +298,12 @@ (define %test-docker-system
    (description "Run a system image as produced by @command{guix system
 docker-image} inside Docker.")
    (value (with-monad %store-monad
-            (>>= (system-docker-image (operating-system
-                                        (inherit (simple-operating-system))
-                                        ;; Use locales for a single libc to
-                                        ;; reduce space requirements.
-                                        (locale-libcs (list glibc)))
-                                      #:memory-size 1024)
+            (>>= (lower-object
+                  (system-image (os->image
+                                 (operating-system
+                                   (inherit (simple-operating-system))
+                                   ;; Use locales for a single libc to
+                                   ;; reduce space requirements.
+                                   (locale-libcs (list glibc)))
+                                 #:type docker-image-type)))
                  run-docker-system-test)))))
-- 
2.34.0





  parent reply	other threads:[~2021-12-16 13:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 13:02 [bug#52550] [PATCH 00/10] Further work on the image API Mathieu Othacehe
2021-12-16 13:06 ` [bug#52550] [PATCH 01/10] build: image: Add optional closure copy support Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 02/10] image: Add a shared-store? field Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 03/10] image: Add a shared-network? field Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 04/10] system: image: Add docker support Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 05/10] system: vm: Use the image API to generate QEMU images Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 06/10] Remove VM generation dead-code Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 07/10] scripts: system: Deprecate the docker-image command Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 08/10] scripts: system: Pass the volatile field to VM generation Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 09/10] scripts: system: Use the disk-image size argument for " Mathieu Othacehe
2021-12-16 13:06   ` Mathieu Othacehe [this message]
2021-12-22 21:39 ` [bug#52550] [PATCH 00/10] Further work on the image API Ludovic Courtès
2021-12-23  9:57   ` bug#52550: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216130649.30285-10-othacehe@gnu.org \
    --to=othacehe@gnu.org \
    --cc=52550@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).