49 Commits

Author SHA1 Message Date
Philip Taron 62742e9d5e singularity-tools: enable __structuredAttrs and pass contents directly (#358723) 2024-11-25 10:05:42 -08:00
Someone 40f086a50e Revert "singularity-tools: don't preserve store content ownership" (#358817) 2024-11-25 14:15:13 +00:00
Wolfgang Walther c4461bbe1c singularity-tools: remove deprecated shellScript and mkLayer
Scheduled for 25.05.
2024-11-24 21:09:34 +01:00
Yueh-Shun Li f663b14524 Revert "singularity-tools: don't preserve store content ownership"
Use `cp -ar` instead of `cp -r` to preserve symbolic links
and other attributes whenever possible.

This reverts commit c2eb0aa56e.
2024-11-25 02:21:45 +08:00
Yueh-Shun Li eff53a2135 singularity-tools: enable __structuredAttrs and pass contents directly 2024-11-24 22:19:31 +08:00
Maximilian Bosch 4e2ce1ba94 apptainer.tests.image-hello-cowsay: remove obsolete rmdir "$out" 2024-11-24 14:25:09 +01:00
Yueh-Shun Li 51ef09110b singularity-tools: make runscript modifiable 2024-08-18 00:37:37 +08:00
Yueh-Shun Li c2eb0aa56e singularity-tools: don't preserve store content ownership
Don't preserve store content ownership to prepare for unprivileged-build
workflow.
2024-08-15 21:33:18 +08:00
Yueh-Shun Li c229d14f50 singularity-tools: proper line looping with while-read 2024-08-15 21:33:06 +08:00
Yueh-Shun Li 5396a84b1d singularity-tools: string-interpolate and and quote members in contents
String-interpolation converts path objects inside `contents` into store
paths to ensure they are properly included in the result image.

See tests.trivial-builders.references for the necessity of
string-interpolation.

Quote each string-interpolated content member to accomodates spaces
inside.
2024-08-15 20:09:56 +08:00
Yueh-Shun Li 7487a6207d singularity-tools: quote shell variables 2024-08-11 13:22:39 +08:00
Yueh-Shun Li 4be1e115d6 singularity-tools: rename the VM mountpoint as "workspace" 2024-08-11 13:22:39 +08:00
Yueh-Shun Li a7b54b36c5 singularity-tools: create VM disk image outside $out
Place the VM disk image in a local directory "disk-image" instead of
"$out", so that we don't have to delete it to reserve "$out" for the
container image.
2024-08-11 13:22:39 +08:00
Yueh-Shun Li e8360a61bc singularity-tools: make extensible 2024-08-11 13:22:39 +08:00
Yueh-Shun Li 3ca6a8c60e singularity-tools: add bashInteractive and runScript into layerClosure 2024-08-11 13:22:02 +08:00
Yueh-Shun Li a1318915d3 singularity-tools: deprecate build helpers mkLayer and shellScript
Deprecate singularity-tools.mkLayer and singularity-tools.shellScript,
for they are no longer related to image building.

Use writers.writeBash instead of singularity-tools.shellScript.
2024-08-09 09:15:52 +00:00
Yueh-Shun Li d3692ddf54 singularity-tools: drop override argument storeDir 2024-08-09 09:09:52 +00:00
Yueh-Shun Li c2fa248bca singularity-tools: fix singularity run with bashInteractive 2024-08-09 09:07:46 +00:00
Yueh-Shun Li ae8017ec0b singularity-tools: move defaultSingularity let-in to the top 2024-08-05 08:24:56 +08:00
Yueh-Shun Li 41061c6754 singularity-tools.buildImage: remove gawk from nativeBuildInputs 2024-08-05 08:24:55 +08:00
Yueh-Shun Li 912bf66199 singularity-tools.buildIname: use nativeBuildInputs and strictDeps 2024-08-05 08:24:55 +08:00
Yueh-Shun Li 99b7831572 singularity-tools.buildImage: use .sif instead of .img as image name suffix 2024-08-05 08:24:54 +08:00
Yueh-Shun Li fd956cc3a9 singularity-tools: name sandboxed meta directory .singularity.d
Name the directory inside SIF (the SquashFS image) ".singularity.d"
instead of ".${projectName}.d" for compatibility across Apptainer and
Singularity.
2024-08-05 08:24:54 +08:00
Yueh-Shun Li d17eef519d singularity-tools: rearrarnge the input parameters 2024-08-04 13:38:47 +08:00
Yueh-Shun Li bcece72177 singularity-tools: format with nixfmt-rfc-style (Nix RFC 166) 2024-08-04 13:24:18 +08:00
Yueh-Shun Li d09aedb1a0 singularity-tools.buildImage: increase default memSize
Increase the default RAM size for image-building QEMU VM.

Make singularity.tests.image-hello-cowsay build on aarch64-linux.
2024-04-26 14:56:52 +08:00
Yueh-Shun Li 5c1a3b619d singularity-tools.buildImages: use writeClosure 2024-03-19 05:30:54 +08:00
Yueh-Shun Li 7ccd495465 apptainer, singularity: drop obsolete LOCALSTATEDIR dirs
Leave only the SESSIONDIR, which is "$LOCALSTATEDIR/$projectName/mnt/session"
2023-08-23 18:20:25 +08:00
Yueh-Shun Li 50788d2fb0 apptainer, singularity: fix defaultPath and reflect upstream changes
Upstream changes:
singularity 3.8.7 (the legacy) -> apptainer 1.1.3 (the renamed) / singularity 3.10.4 (Sylabs's fork)

Build process:
*   Share between different sources
*   Fix the sed regexp to make defaultPath patch work
*   allowGoReference is now true
*   Provied input parameter removeCompat (default to false)
    that removes the compatible "*singularity*" symbolic links
    and related autocompletion files when projectName != "singularity"
*   Change localstatedir to /var/lib
*   Format with nixpkgs-fmt
*   Fix the defaultPath patching
    and use it instead of the `<executable> path` config directive
    deprecated in Apptainer
*   Provide dependencies for new functionalities such as
    squashfuse (unprivileged squashfs mount)
*   Provide an attribute `defaultPathInputs` to override
    prefix of container runtime default PATH

NixOS module programs.singularity:
*   Allow users to specify packages
*   Place related directories to /var/lib
*   Format with nixpkgs-fmt

singularity-tools:
*   Allow users to specify packages
*   Place related directories to /var/lib when building images in VM
2023-02-08 18:03:11 +08:00
Yueh-Shun Li b33d6407cc singularity-tool: format expression 2023-02-08 17:42:03 +08:00
Chris Hammill 976d703d23 singularity: enable setting vm mem in buildImage 2022-03-03 17:09:48 -05:00
Dmitry Kalinkin 777a4ba508 singularity-tools.buildImage: fix building from non-standard store paths 2021-10-27 02:11:44 -04:00
Pavol Rusnak 90f7338112 treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
Graham Christensen bc49a0815a utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Anderson Torres 6740a5998b Merge pull request #93082 from cfhammill/cfh/fix-singularity-shell-copy
singularity-tools: Check for /bin/sh existence before symlink
2020-09-19 00:42:29 -03:00
Justin Bedo 712f1ee9aa singularity: 3.2.1 -> 3.6.1 2020-07-22 08:51:37 +10:00
cfhammill 8975b7b0e2 singularity-tools: Check for /bin/sh existence before symlink
Fixes the case where the user has bashInteractive in the
container contents
2020-07-13 17:20:14 -04:00
Justin Bedo 56c22350c0 singularity-tools: fix buildImage 2020-02-02 09:18:39 +11:00
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Jörg Thalheim dadc7eb329 treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00
Justin Bedő 05ab1a6e5a Merge branch 'master' into singularity 2019-02-17 21:49:37 +00:00
Justin Bedo 5611397f33 singularity: 2.6.0 -> 3.0.1 2019-01-31 09:21:18 +11:00
Dmitry Kalinkin 6b81768297 Merge pull request #30479 from obsidiansystems/singularity-tools
singularity-tools: Only copy into /bin what is specified in contents
2019-01-09 19:39:08 -05:00
volth 52f53c69ce pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
Justin Bedő 1e0a2eafbf singularity-tools: create mount points for image building (#41470) 2018-06-18 23:50:06 +02:00
Justin Bedo 5c1e42276d singularity: 2.4 -> 2.4.2 2018-03-12 15:13:31 +11:00
Justin Bedo db927ea35b singularity: 2.2 -> 2.4 2017-12-21 10:50:06 +11:00
Dan Haraj 9cf47fb1c8 singularity-tools: Only copy into /bin what is specified in contents 2017-10-10 14:45:39 -04:00
Justin Bedo 04121437be singularity: init 2.2 2016-11-15 09:11:53 +11:00