Generate trebuchet from nix
This commit is contained in:
parent
e8d884a627
commit
66a5e06ada
@ -12,14 +12,23 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "trebuchet";
|
||||
phases = [ "installPhase" ];
|
||||
preferLocalBuild = true;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
dontPatchShebangs = true;
|
||||
src = ./.;
|
||||
inherit sshHost nixPrefix nixtools targetCluster program;
|
||||
installPhase = ''
|
||||
substituteAllInPlace trebuchet
|
||||
cp trebuchet $out
|
||||
cat > $out <<EOF
|
||||
#!/bin/sh -e
|
||||
# Using the token @upload-to-mn@ we instruct the post-build hook to upload
|
||||
# this script and it's closure to the MN4 cluster, so it can run there.
|
||||
# Take a look at ${program}
|
||||
# to see what is being executed.
|
||||
|
||||
nixtools=${nixPrefix}${nixtools}/bin
|
||||
runexp=\$nixtools/${targetCluster}/runexp
|
||||
|
||||
>&2 echo "Launching \"\$runexp ${program}\" in MN4"
|
||||
ssh ${sshHost} \$runexp ${program}
|
||||
EOF
|
||||
chmod +x $out
|
||||
'';
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
# @upload-to-mn@
|
||||
|
||||
# This program runs the current experiment in the ./result symlink in
|
||||
# MareNostrum. Requires that you define a "mn" host in the ssh config file
|
||||
# (usually in ~/.ssh/config).
|
||||
|
||||
nixPrefix=@nixPrefix@
|
||||
nixtools=$nixPrefix@nixtools@/bin
|
||||
runexp=$nixtools/@targetCluster@/runexp
|
||||
|
||||
>&2 echo "Launching \"$runexp @program@\" in MN"
|
||||
|
||||
ssh mn $runexp @program@
|
Loading…
Reference in New Issue
Block a user