Skip to content

Commit

Permalink
Enable Stackinator's --no-bwrap option in CI (for Eiger) (#88)
Browse files Browse the repository at this point in the history
eth-cscs/stackinator#183 added a `--no-bwrap` option to the Stackinator. This option is now needed to build on Eiger.

This PR adds this option, which can be enabled as an (optional) `no_bwrap` field for each cluster.

This PR also fixes the usage of the `--develop` option (see #55).
  • Loading branch information
RMeli authored Apr 29, 2024
1 parent 2e76789 commit 601285a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
6 changes: 5 additions & 1 deletion ci/config/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ def job_template(self, env):
develop = ""
version = self.uenv(env["uenv"]).version(env["version"])
if version.spack_develop:
develop = "--develop"
develop = "-d"

no_bwrap = ""
if cluster["no_bwrap"]:
no_bwrap = "-w"

use_f7t = (cluster["runner"] == "f7t")
runner = {"f7t": use_f7t}
Expand All @@ -227,6 +230,7 @@ def job_template(self, env):
"uarch": env["uarch"],
"recipe_path": env["recipe"],
"spack_develop": develop,
"no_bwrap": no_bwrap,
"mount": version.mount,
"system": env["system"],
"partition": target["partition"],
Expand Down
3 changes: 2 additions & 1 deletion ci/config/schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
{"enum": ["f7t"]}
],
"default": "fjt"
}
},
"no_bwrap": {"type": "boolean", "default": false}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion ci/config/templates/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stages:
SLURM_TIMELIMIT: 180
script:
- echo "==== RECIPE $STACK_RECIPE"
- ./stack-build -n $STACK_NAME -s $STACK_SYSTEM -r $STACK_RECIPE -b /dev/shm/jenkssl $SPACK_DEVELOP -m $STACK_MOUNT -u $STACK_UARCH
- ./stack-build -n $STACK_NAME -s $STACK_SYSTEM -r $STACK_RECIPE -b /dev/shm/jenkssl $SPACK_DEVELOP -m $STACK_MOUNT -u $STACK_UARCH $NO_BWRAP
after_script:
- rm -Rf /dev/shm/jenkssl

Expand All @@ -34,6 +34,7 @@ build-{{job.uenv}}/{{job.version}}-{{job.system}}/{{job.uarch}}:
variables:
STACK_MOUNT: "{{job.mount}}"
SPACK_DEVELOP: "{{job.spack_develop}}"
NO_BWRAP: "{{job.no_bwrap}}"
STACK_NAME: "{{job.uenv}}/{{job.version}}"
STACK_SYSTEM: "{{job.system}}"
STACK_RECIPE: "{{job.recipe_path}}"
Expand Down
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ clusters:
variables:
SLURM_CONSTRAINT: 'mc'
runner: f7t
no_bwrap: True
clariden:
targets:
-
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-stackinator
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tool_base_path="$(pwd)"
# builds in the same pipeline do not conflict
tool_path=`mktemp -d`
tool_repo=https://github.com/eth-cscs/stackinator.git
tool_version=v4.0
tool_version=master

log "installing stackinator from git in '${tool_path}'"

Expand Down
11 changes: 7 additions & 4 deletions stack-build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ get_build_id () {
}

usage () {
echo "usage: stack-build -n name -r recipe-path -s system -b build-root -u uarch -m mount [-d]"
echo "usage: stack-build -n name -r recipe-path -s system -b build-root -u uarch -m mount [-d] [-w]"
echo ""
echo "where:"
echo " name: the name of the stack"
Expand All @@ -53,10 +53,11 @@ build_root="-"
uarch="-"
mount="-"
spack_develop=""
no_bwrap=""

echo "====== parsing arguments $@"

while getopts n:s:r:b:u:m:d: flag
while getopts n:s:r:b:u:m:dw flag
do
case "${flag}" in
n) name=${OPTARG};;
Expand All @@ -66,6 +67,7 @@ do
u) uarch=${OPTARG};;
m) mount=${OPTARG};;
d) spack_develop="--develop";;
w) no_bwrap="--no-bwrap";;
esac
done

Expand All @@ -91,6 +93,7 @@ log "build-path ${build_path}"
log "ci-path ${ci_path}"
log "mount ${mount}"
[[ ! -z ${spack_develop} ]] && log "develop"
[[ ! -z ${no_bwrap} ]] && log "no bwrap"

# Check if the recipe path exists
[[ -d "${recipe_path}" ]] || err "recipe path '$recipe_path' does not exist"
Expand Down Expand Up @@ -140,8 +143,8 @@ source ${ci_path}/scripts/setup-stackinator
# call stackinator
log "configuring stack"

echo "stack-config -r ${recipe_path} -b ${build_path} -s $cluster_path/${system} -m ${mount} $cache_flags ${spack_develop}"
stack-config -r "${recipe_path}" -b "${build_path}" -s "$cluster_path/${system}" -m "${mount}" $cache_flags ${spack_develop}
echo "stack-config -r ${recipe_path} -b ${build_path} -s $cluster_path/${system} -m ${mount} $cache_flags ${spack_develop} ${no_bwrap}"
stack-config -r "${recipe_path}" -b "${build_path}" -s "$cluster_path/${system}" -m "${mount}" $cache_flags ${spack_develop} ${no_bwrap}

if [ ! $? -eq 0 ]; then
# delete stackinator tool once it is no longer needed
Expand Down

0 comments on commit 601285a

Please sign in to comment.