From patchwork Thu Dec 16 13:06:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 35271 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A072927BBEC; Thu, 16 Dec 2021 13:09:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A359B27BBEA for ; Thu, 16 Dec 2021 13:09:13 +0000 (GMT) Received: from localhost ([::1]:51490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxqVU-0006VP-Mk for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 08:09:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxqUQ-0005mq-4U for guix-patches@gnu.org; Thu, 16 Dec 2021 08:08:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxqUP-0004bK-EC for guix-patches@gnu.org; Thu, 16 Dec 2021 08:08:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxqUP-0006gT-Ah for guix-patches@gnu.org; Thu, 16 Dec 2021 08:08:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52550] [PATCH 10/10] tests: docker: Fix it. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 13:08:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52550 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52550@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 52550-submit@debbugs.gnu.org id=B52550.163966004425575 (code B ref 52550); Thu, 16 Dec 2021 13:08:05 +0000 Received: (at 52550) by debbugs.gnu.org; 16 Dec 2021 13:07:24 +0000 Received: from localhost ([127.0.0.1]:34997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxqTk-0006eL-9n for submit@debbugs.gnu.org; Thu, 16 Dec 2021 08:07:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxqTc-0006d9-0L for 52550@debbugs.gnu.org; Thu, 16 Dec 2021 08:07:16 -0500 Received: from [2001:470:142:3::e] (port=33808 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxqTW-0004Sq-HH for 52550@debbugs.gnu.org; Thu, 16 Dec 2021 08:07:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=bVVB2V0YPLsWxTOB9dqUEflJkOvGOU2hD+1jtHG+gCY=; b=X02d2A80jQVGi7hsPInB dBNQcE2yjtfxMBYJ2n5MdklHK0n0I8HJgT7OEBVA2cqT3DtUwbKTV/Ka9W1wyWQF67oxq9Hac7IyU hPI1LulcsWkEwdXoDkch1tDe/IMyTyVflzq/5A0Wue6wIXa4iWvD4UYPSGhudIToiRhF+DnKbc76v QcWCLe95i0H5eSvGz7wts06Wor4efeRY9rB+z/2gYFJ5pTsXq8w0RKt9oa2m4JSQwOeEmM+neRzAA q/JvkQTePp7VUQPWs6EBWgkm/FFMYSS9j/nR9koJaG8luUbNXVWfcx4THmgHaTTEra9BzQh5HQQFg eiB52gt7noQG1A==; Received: from [2a01:e0a:19b:d9a0:2f3b:16f2:b776:3ef9] (port=57550 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxqTW-0003iQ-Di; Thu, 16 Dec 2021 08:07:10 -0500 From: Mathieu Othacehe Date: Thu, 16 Dec 2021 14:06:49 +0100 Message-Id: <20211216130649.30285-10-othacehe@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211216130649.30285-1-othacehe@gnu.org> References: <20211216130649.30285-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The docker tests are broken because the docker overlay doesn't support running on our own storage overlay. Use the new 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 . (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)))))