-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
singularity: init 2.2 #20408
singularity: init 2.2 #20408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpicks, otherwise looks good.
I'm not familiar with virtualization, so I haven't reviewed build-support/singularity well.
@@ -0,0 +1,32 @@ | |||
{ stdenv | |||
, sudo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used
./autogen.sh | ||
''; | ||
|
||
meta = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to maintain the package?
@@ -281,6 +281,8 @@ in | |||
nixBufferBuilders = import ../build-support/emacs/buffer.nix { inherit (pkgs) lib writeText; inherit (emacsPackagesNg) inherit-local; }; | |||
|
|||
pathsFromGraph = ../build-support/kernel/paths-from-graph.pl; | |||
|
|||
singularityTools = callPackage ../build-support/singularity { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
singularity-tools
is preferred spelling. (We're moving from camelCase to this-one for package names.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to rename to build-support/singularity-tools
, so attribute path matches the file name.
cd disk | ||
|
||
# Run root script | ||
${if runAsRoot != null then '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use lib.optionalString
here:
''
${lib.optionalString (runAsRoot != null) ''
string contents
''}
''
Thanks for the feedback! I have made changes to address your comments. I'm happy to be the maintainer, so I have added myself as the maintainers list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me ;)
|
||
buildInputs = [ autoconf automake libtool ]; | ||
|
||
preConfigure = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use the autoreconfHook
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed to autoreconfHook and retested, works perfectly :).
@@ -60,6 +60,7 @@ | |||
bcarrell = "Brandon Carrell <brandoncarrell@gmail.com>"; | |||
bcdarwin = "Ben Darwin <bcdarwin@gmail.com>"; | |||
bdimcheff = "Brandon Dimcheff <brandon@dimcheff.com>"; | |||
bedoj = "Justin Bedő <cu@cua0.org>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbedo, could you rename to jbedo
, so it matches your GitHub nick?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry muscle memory, fixed!
name = "singularity-${version}"; | ||
version = "2.2"; | ||
|
||
src = fetchFromGitHub { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realise that was preferable to fetchFromGitHub; I'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done & retested :)
@FRidh, @jbedo, let # fix syntax highlight
fetchFromGitHub = {
owner, repo, rev, name ? "${repo}-${rev}-src",
... # For hash agility
}@args: fetchzip ({
inherit name;
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
meta.homepage = "https://github.com/${owner}/${repo}/";
} // removeAttrs args [ "owner" "repo" "rev" ]) // { inherit rev; }; |
There is always something new to learn with Nix(pkgs). I was under the impression it was a wrapper around |
Ok, reverted back to fetchFromGitHub :). |
Thanks for your contribution! Sorry for so many review rounds ;) |
Motivation for this change
Singularity is a container system similar to docker for mobile compute. It has a strong focus on HPC use. I have added a build expression for Singularity and also some support for building Singularity images. The image building interface is inspired by dockerTools.buildImage.
I have tested images produced by my buildImage function both on my NixOS install using the Singularity expression in this pull request. I have also tested the images running on my HPC cluster on a standard Linux setup.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)