GNU bug report logs - #31592
Add Singularity and squashfs image support to guix pack.

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>

Date: Fri, 25 May 2018 14:30:02 UTC

Severity: normal

Done: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31592 in the body.
You can then email your comments to 31592 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Fri, 25 May 2018 14:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 25 May 2018 14:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <guix-patches <at> gnu.org>
Subject: Add Singularity and squashfs image support to guix pack.
Date: Fri, 25 May 2018 16:28:49 +0200
This patch series adds the Singularity package, and it also adds
squashfs image support for “guix pack”.  The squashfs images work with
this Singularity package.

--
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Fri, 25 May 2018 15:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31592 <at> debbugs.gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: [PATCH 2/4] gnu: Add singularity.
Date: Fri, 25 May 2018 17:47:28 +0200
* gnu/packages/linux.scm (singularity): New variable.
---
 gnu/packages/linux.scm | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 70e612995..5670bf193 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2016 Raymond Nicholson <rain1 <at> openmailbox.org>
 ;;; Copyright © 2016 Mathieu Lirzin <mthl <at> gnu.org>
 ;;; Copyright © 2016, 2018 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
-;;; Copyright © 2016 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
 ;;; Copyright © 2016 John Darrington <jmd <at> gnu.org>
 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke <at> fastmail.com>
@@ -80,6 +80,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages nettle)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages perl)
@@ -2566,6 +2567,43 @@ similar in functionality to chroot, although pflask provides better isolation
 thanks to the use of namespaces.")
     (license license:bsd-2)))
 
+(define-public singularity
+  (package
+    (name "singularity")
+    (version "2.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/singularityware/singularity/releases/download/"
+                                  version "/singularity-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0f28dgf2qcy8ljjfix7p9q36q12j7rxyicfzzi4n0fl8zr8ab88g"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--disable-suid"
+             "--localstatedir=/var")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Do not create directories in /var.
+         (add-after 'unpack 'disable-install-hook
+           (lambda _
+             (substitute* "Makefile.in"
+               (("\\$\\(MAKE\\) .*install-data-hook") ""))
+             #t)))))
+    (inputs
+     `(("libarchive" ,libarchive)
+       ("python" ,python-wrapper)
+       ("nettle" ,nettle)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("squashfs-tools" ,squashfs-tools)))
+    (home-page "https://singularity.lbl.gov/")
+    (synopsis "Container platform")
+    (description "Singularity is a container platform supporting a number of
+container image formats.")
+    (license license:bsd-3)))
+
 (define-public hdparm
   (package
     (name "hdparm")
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Fri, 25 May 2018 15:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31592 <at> debbugs.gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: [PATCH 4/4] pack: Add support for squashfs images.
Date: Fri, 25 May 2018 17:47:30 +0200
* guix/scripts/pack.scm (%formats): Add "squashfs" format.
(guix-pack): Adjust "archiver" dependent on pack-format.
(squashfs-image): New procedure.
---
 guix/scripts/pack.scm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 92 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 980aef0ed..88a2495c8 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2017, 2018 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2017 Efraim Flashner <efraim <at> flashner.co.il>
-;;; Copyright © 2017 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen <at> fastmail.net>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich <at> gmail.com>
 ;;;
@@ -214,6 +214,91 @@ added to the pack."
                     build
                     #:references-graphs `(("profile" ,profile))))
 
+(define* (squashfs-image name profile
+                         #:key target
+                         deduplicate?
+                         (compressor (first %compressors))
+                         localstatedir?
+                         (symlinks '())
+                         (archiver squashfs-tools-next))
+  "Return a squashfs image containing a store initialized with the closure of
+PROFILE, a derivation.  The image contains a subset of /gnu/store and .
+
+SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
+added to the pack."
+  (define build
+    (with-imported-modules '((guix build utils)
+                             (guix build store-copy)
+                             (gnu build install))
+      #~(begin
+          (use-modules (guix build utils)
+                       (gnu build install)
+                       (guix build store-copy)
+                       (srfi srfi-1)
+                       (srfi srfi-26)
+                       (ice-9 match))
+
+          (setenv "PATH" (string-append #$archiver "/bin"))
+
+          ;; We need an empty file in order to have a valid file argument when
+          ;; we reparent the root file system.  Read on for why that's
+          ;; necessary.
+          (with-output-to-file ".empty" (lambda () (display "")))
+
+          ;; Create the squashfs image in several steps.
+          (exit
+           (and
+            ;; Add all store items.  Unfortunately mksquashfs throws away all
+            ;; ancestor directories and only keeps the basename.  We fix this
+            ;; in the following invocations of mksquashfs.
+            (zero? (apply system* "mksquashfs"
+                          `(,@(call-with-input-file "profile"
+                                read-reference-graph)
+                            ,#$output
+
+                            ;; Do not perform duplicate checking because we
+                            ;; don't have any dupes.
+                            "-no-duplicates"
+                            "-comp"
+                            ,#+(compressor-name compressor))))
+
+            ;; Here we reparent the store items.  For each sub-directory of
+            ;; the store prefix we need one invocation of "mksquashfs".
+            (every (lambda (dir)
+                     (zero? (apply system* "mksquashfs"
+                                   `(".empty"
+                                     ,#$output
+                                     "-root-becomes" ,dir))))
+                   (reverse (filter (negate string-null?)
+                                    (string-split (%store-directory) #\/))))
+
+            ;; Add symlinks and mount points.
+            (zero? (apply system* "mksquashfs"
+                          `(".empty"
+                            ,#$output
+                            ;; Create SYMLINKS via pseudo file definitions.
+                            ,@(append-map
+                               (match-lambda
+                                 ((source '-> target)
+                                  (list "-p"
+                                        (string-join
+                                         ;; name s mode uid gid symlink
+                                         (list source
+                                               "s" "777" "0" "0"
+                                               (string-append #$profile "/" target))))))
+                               '#$symlinks)
+
+                            ;; Create empty mount points.
+                            "-p" "/proc d 555 0 0"
+                            "-p" "/sys d 555 0 0"
+                            "-p" "/dev d 555 0 0"))))))))
+
+  (gexp->derivation (string-append name
+                                   (compressor-extension compressor)
+                                   ".squashfs")
+                    build
+                    #:references-graphs `(("profile" ,profile))))
+
 (define* (docker-image name profile
                        #:key target
                        deduplicate?
@@ -462,6 +547,7 @@ please email '~a'~%")
 (define %formats
   ;; Supported pack formats.
   `((tarball . ,self-contained-tarball)
+    (squashfs . ,squashfs-image)
     (docker  . ,docker-image)))
 
 (define %options
@@ -626,9 +712,11 @@ Create a bundle of PACKAGE.\n"))
                (compressor  (if bootstrap?
                                 bootstrap-xz
                                 (assoc-ref opts 'compressor)))
-               (archiver    (if bootstrap?
-                                %bootstrap-coreutils&co
-                                tar))
+               (archiver    (if (equal? pack-format 'squashfs)
+                                squashfs-tools-next
+                                (if bootstrap?
+                                    %bootstrap-coreutils&co
+                                    tar)))
                (symlinks    (assoc-ref opts 'symlinks))
                (build-image (match (assq-ref %formats pack-format)
                               ((? procedure? proc) proc)
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Fri, 25 May 2018 15:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31592 <at> debbugs.gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: [PATCH 1/4] gnu: Add squashfs-tools-next.
Date: Fri, 25 May 2018 17:47:27 +0200
* gnu/packages/compression.scm (squashfs-tools-next): New variable.
---
 gnu/packages/compression.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 1cb0d208a..f53b817c2 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli <at> gmail.com>
 ;;; Copyright © 2015, 2016 Eric Bavier <bavier <at> member.fsf.org>
-;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2015 Jeff Mickey <j <at> codemac.net>
 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim <at> flashner.co.il>
@@ -843,6 +843,23 @@ systems where low overhead is needed.  This package allows you to create and
 extract such file systems.")
     (license license:gpl2+)))
 
+;; We need this for building squashfs images with symlinks.
+(define-public squashfs-tools-next
+  (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
+        (revision "1"))
+    (package (inherit squashfs-tools)
+      (name "squashfs-tools-next")
+      (version (string-append "4.3-" revision (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/plougher/squashfs-tools.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1x2skf8hxzfch978nzx5mh46d4hhi6gl22270hiarjszsjk3bnsx")))))))
+
 (define-public pigz
   (package
     (name "pigz")
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Fri, 25 May 2018 15:50:03 GMT) Full text and rfc822 format available.

Message #17 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31592 <at> debbugs.gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: [PATCH 3/4] pack: Rename "tar" to "archiver".
Date: Fri, 25 May 2018 17:47:29 +0200
* guix/scripts/pack.scm (self-contained-tarball, docker-image): Accept
"archiver" argument; remove "tar" argument.
(guix-pack): Invoke "build-image" with "archiver" argument.
---
 guix/scripts/pack.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 1e84459e7..980aef0ed 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -93,7 +93,7 @@ found."
                                  (compressor (first %compressors))
                                  localstatedir?
                                  (symlinks '())
-                                 (tar tar))
+                                 (archiver tar))
   "Return a self-contained tarball containing a store initialized with the
 closure of PROFILE, a derivation.  The tarball contains /gnu/store; if
 LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db
@@ -142,7 +142,7 @@ added to the pack."
           ;; 2014-07-28.  For testing, we use the bootstrap tar, which is
           ;; older and doesn't support it.
           (define tar-supports-sort?
-            (zero? (system* (string-append #+tar "/bin/tar")
+            (zero? (system* (string-append #+archiver "/bin/tar")
                             "cf" "/dev/null" "--files-from=/dev/null"
                             "--sort=name")))
 
@@ -151,7 +151,7 @@ added to the pack."
                   (string-append #$(if localstatedir?
                                        (file-append guix "/sbin:")
                                        "")
-                                 #$tar "/bin"))
+                                 #$archiver "/bin"))
 
           ;; Note: there is not much to gain here with deduplication and there
           ;; is the overhead of the '.links' directory, so turn it off.
@@ -220,7 +220,7 @@ added to the pack."
                        (compressor (first %compressors))
                        localstatedir?
                        (symlinks '())
-                       (tar tar))
+                       (archiver tar))
   "Return a derivation to construct a Docker image of PROFILE.  The
 image is a tarball conforming to the Docker Image Specification, compressed
 with COMPRESSOR.  It can be passed to 'docker load'.  If TARGET is true, it
@@ -268,7 +268,7 @@ the image."
 
           (use-modules (guix docker) (srfi srfi-19) (guix build store-copy))
 
-          (setenv "PATH" (string-append #$tar "/bin"))
+          (setenv "PATH" (string-append #$archiver "/bin"))
 
           (build-docker-image #$output
                               (call-with-input-file "profile"
@@ -626,7 +626,7 @@ Create a bundle of PACKAGE.\n"))
                (compressor  (if bootstrap?
                                 bootstrap-xz
                                 (assoc-ref opts 'compressor)))
-               (tar         (if bootstrap?
+               (archiver    (if bootstrap?
                                 %bootstrap-coreutils&co
                                 tar))
                (symlinks    (assoc-ref opts 'symlinks))
@@ -654,8 +654,8 @@ Create a bundle of PACKAGE.\n"))
                                                    symlinks
                                                    #:localstatedir?
                                                    localstatedir?
-                                                   #:tar
-                                                   tar)))
+                                                   #:archiver
+                                                   archiver)))
               (mbegin %store-monad
                 (show-what-to-build* (list drv)
                                      #:use-substitutes?
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 12:51:01 GMT) Full text and rfc822 format available.

Message #20 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: ludovic.courtes <at> inria.fr (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 1/4] gnu: Add squashfs-tools-next.
Date: Sun, 27 May 2018 14:50:16 +0200
Hello!

Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:

> * gnu/packages/compression.scm (squashfs-tools-next): New variable.

[...]

> +;; We need this for building squashfs images with symlinks.
> +(define-public squashfs-tools-next
> +  (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
> +        (revision "1"))

Does it mean that the current version does not support symlinks in the
image?

> +    (package (inherit squashfs-tools)
> +      (name "squashfs-tools-next")
> +      (version (string-append "4.3-" revision (string-take commit 7)))

Nitpick: you can use (git-version …) here.

Otherwise LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 12:53:01 GMT) Full text and rfc822 format available.

Message #23 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: ludovic.courtes <at> inria.fr (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 2/4] gnu: Add singularity.
Date: Sun, 27 May 2018 14:52:19 +0200
Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:

> * gnu/packages/linux.scm (singularity): New variable.

[...]

> +    (propagated-inputs
> +     `(("squashfs-tools" ,squashfs-tools)))

Could we patch the code that invokes mksquashfs to use an absolute file
name?  That way we wouldn’t need to propagate it.

> +    (home-page "https://singularity.lbl.gov/")
> +    (synopsis "Container platform")
> +    (description "Singularity is a container platform supporting a number of
> +container image formats.")

Would be nice to expound a little bit, like mentioning that it can
be used to build images, to run code from Docker images, etc.

Thanks!  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 12:58:01 GMT) Full text and rfc822 format available.

Message #26 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: ludovic.courtes <at> inria.fr (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 4/4] pack: Add support for squashfs images.
Date: Sun, 27 May 2018 14:57:45 +0200
Woohoo!

Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:

> * guix/scripts/pack.scm (%formats): Add "squashfs" format.
> (guix-pack): Adjust "archiver" dependent on pack-format.
> (squashfs-image): New procedure.

[...]

> +          (exit
> +           (and
> +            ;; Add all store items.  Unfortunately mksquashfs throws away all
> +            ;; ancestor directories and only keeps the basename.  We fix this
> +            ;; in the following invocations of mksquashfs.
> +            (zero? (apply system* "mksquashfs"

This code should use ‘invoke’ everywhere, which would alleviate the need
for the clumsy (exit (and …)) idiom.

> +                   (reverse (filter (negate string-null?)
> +                                    (string-split (%store-directory) #\/))))

I think this is equivalent to:

  (reverse (string-tokenize (%store-directory)
                            (char-set-complement (char-set #\/))))

Alternately, you can use (remove …) instead of (filter (negate …) …).

:-)

One last thing: could you update guix.texi and the ‘--help’ output?

I suppose using the squashfs format allows us to bypass the bug
described at
<https://github.com/singularityware/singularity/issues/1487>, right?

Thanks a lot for working on this!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 18:12:02 GMT) Full text and rfc822 format available.

Message #29 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 1/4] gnu: Add squashfs-tools-next.
Date: Sun, 27 May 2018 20:11:05 +0200
Ludovic Courtès <ludovic.courtes <at> inria.fr> writes:

>> +;; We need this for building squashfs images with symlinks.
>> +(define-public squashfs-tools-next
>> +  (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
>> +        (revision "1"))
>
> Does it mean that the current version does not support symlinks in the
> image?

Yes, the latest release does not support pseudo file specs for symbolic
links.

>> +    (package (inherit squashfs-tools)
>> +      (name "squashfs-tools-next")
>> +      (version (string-append "4.3-" revision (string-take commit 7)))
>
> Nitpick: you can use (git-version …) here.

Right!  I keep forgetting this.

--
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 18:15:02 GMT) Full text and rfc822 format available.

Message #32 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 2/4] gnu: Add singularity.
Date: Sun, 27 May 2018 20:14:34 +0200
Ludovic Courtès <ludovic.courtes <at> inria.fr> writes:

> Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:
>
>> * gnu/packages/linux.scm (singularity): New variable.
>
> [...]
>
>> +    (propagated-inputs
>> +     `(("squashfs-tools" ,squashfs-tools)))
>
> Could we patch the code that invokes mksquashfs to use an absolute file
> name?  That way we wouldn’t need to propagate it.

Maybe.  It uses a shell function “singularity_which” to find it in the
PATH at runtime.  I don’t know in how many places this is done, but I
can try to patch all instances to use the absolute file name.

>> +    (home-page "https://singularity.lbl.gov/")
>> +    (synopsis "Container platform")
>> +    (description "Singularity is a container platform supporting a number of
>> +container image formats.")
>
> Would be nice to expound a little bit, like mentioning that it can
> be used to build images, to run code from Docker images, etc.

True.  I tried to get information on features from the Singularity
website, but it’s all very vague and uses too many marketing phrases.
I’ll try to come up with a better description.

--
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Sun, 27 May 2018 18:19:01 GMT) Full text and rfc822 format available.

Message #35 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 4/4] pack: Add support for squashfs images.
Date: Sun, 27 May 2018 20:17:46 +0200
Ludovic Courtès <ludovic.courtes <at> inria.fr> writes:

> Woohoo!
>
> Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:
>
>> * guix/scripts/pack.scm (%formats): Add "squashfs" format.
>> (guix-pack): Adjust "archiver" dependent on pack-format.
>> (squashfs-image): New procedure.
>
> [...]
>
>> +          (exit
>> +           (and
>> +            ;; Add all store items.  Unfortunately mksquashfs throws away all
>> +            ;; ancestor directories and only keeps the basename.  We fix this
>> +            ;; in the following invocations of mksquashfs.
>> +            (zero? (apply system* "mksquashfs"
>
> This code should use ‘invoke’ everywhere, which would alleviate the need
> for the clumsy (exit (and …)) idiom.

Okay.

>> +                   (reverse (filter (negate string-null?)
>> +                                    (string-split (%store-directory) #\/))))
>
> I think this is equivalent to:
>
>   (reverse (string-tokenize (%store-directory)
>                             (char-set-complement (char-set #\/))))
>
> Alternately, you can use (remove …) instead of (filter (negate …) …).

Good points.

> One last thing: could you update guix.texi and the ‘--help’ output?

Absolutely!

> I suppose using the squashfs format allows us to bypass the bug
> described at
> <https://github.com/singularityware/singularity/issues/1487>, right?

I generated an image containing “emacs”, “bash”, and “coreutils” and
both “singularity shell” and “singularity exec” worked fine, so I think
this problem does not affect squashfs images.

Thanks for the review!

I’ll update the patches, write some documentation, and push them in the
coming days.

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Mon, 28 May 2018 07:50:02 GMT) Full text and rfc822 format available.

Message #38 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: ludovic.courtes <at> inria.fr (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Cc: 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 4/4] pack: Add support for squashfs images.
Date: Mon, 28 May 2018 09:49:06 +0200
Heya,

Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> skribis:

> Ludovic Courtès <ludovic.courtes <at> inria.fr> writes:

[...]

>> I suppose using the squashfs format allows us to bypass the bug
>> described at
>> <https://github.com/singularityware/singularity/issues/1487>, right?
>
> I generated an image containing “emacs”, “bash”, and “coreutils” and
> both “singularity shell” and “singularity exec” worked fine, so I think
> this problem does not affect squashfs images.

Good.

> I’ll update the patches, write some documentation, and push them in the
> coming days.

Awesome, thank you!

Ludo’.




Reply sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
You have taken responsibility. (Mon, 28 May 2018 15:38:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>:
bug acknowledged by developer. (Mon, 28 May 2018 15:38:02 GMT) Full text and rfc822 format available.

Message #43 received at 31592-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31592-done <at> debbugs.gnu.org>
Subject: Re: [PATCH 1/4] gnu: Add squashfs-tools-next.
Date: Mon, 28 May 2018 17:37:37 +0200
I just pushed all four patches to the “master” branch.

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Wed, 06 Jun 2018 08:33:01 GMT) Full text and rfc822 format available.

Message #46 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 31592 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Subject: Re: [bug#31592] [PATCH 2/4] gnu: Add singularity.
Date: Wed, 6 Jun 2018 10:31:53 +0200
Hi Ricardo,

I've tested this by installing it into my user profile and then invoking

  singularity

and I get:

/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 48: cat: command not found

GENERAL COMMANDS:
/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 62: egrep: command not found

CONTAINER USAGE COMMANDS:
/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 73: egrep: command not found

CONTAINER MANAGEMENT COMMANDS:
/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 84: egrep: command not found

COMMAND GROUPS:
/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 95: egrep: command not found


/gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 106: cat: command not found


That's because there's a PATH="/bin..." inside /home/dannym/.guix-profile/bin/singularity .





Information forwarded to guix-patches <at> gnu.org:
bug#31592; Package guix-patches. (Wed, 06 Jun 2018 09:58:01 GMT) Full text and rfc822 format available.

Message #49 received at 31592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ludovic Courtès <ludovic.courtes <at> inria.fr>,
 31592 <at> debbugs.gnu.org
Subject: Re: [bug#31592] [PATCH 2/4] gnu: Add singularity.
Date: Wed, 6 Jun 2018 11:57:07 +0200
Hi Danny,

> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 48: cat: command not found
>
> GENERAL COMMANDS:
> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 62: egrep: command not found
>
> CONTAINER USAGE COMMANDS:
> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 73: egrep: command not found
>
> CONTAINER MANAGEMENT COMMANDS:
> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 84: egrep: command not found
>
> COMMAND GROUPS:
> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 95: egrep: command not found
>
>
> /gnu/store/18xq9sc79j81zlzhdm7kamq71vlivi59-singularity-2.5.1/libexec/singularity/cli/help.exec: line 106: cat: command not found

Oh, sorry about that.  I only tried this on a Fedora workstation, where
PATH="/bin…" would be no problem.  Thanks for reporting this!

-- 
Ricardo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Jul 2018 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.