From 1a05dda00c1f5d124bfa15443c6cdc68232704a4 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 20 Jul 2021 16:28:30 -0400 Subject: [PATCH] Make singularity suid in arvbox, crunch-dispatch-local runs as user no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../docker/service/crunch-dispatch-local/run | 28 +++++------------ .../service/crunch-dispatch-local/run-service | 30 +++++++++++++++++++ 2 files changed, 37 insertions(+), 21 deletions(-) create mode 100755 tools/arvbox/lib/arvbox/docker/service/crunch-dispatch-local/run-service diff --git a/tools/arvbox/lib/arvbox/docker/service/crunch-dispatch-local/run b/tools/arvbox/lib/arvbox/docker/service/crunch-dispatch-local/run index 821afdce50..3ce2220d0e 100755 --- a/tools/arvbox/lib/arvbox/docker/service/crunch-dispatch-local/run +++ b/tools/arvbox/lib/arvbox/docker/service/crunch-dispatch-local/run @@ -6,25 +6,11 @@ exec 2>&1 set -ex -o pipefail -. /usr/local/lib/arvbox/common.sh -. /usr/local/lib/arvbox/go-setup.sh +# singularity can use suid +chown root /var/lib/arvados/bin/singularity \ + /var/lib/arvados/etc/singularity/singularity.conf \ + /var/lib/arvados/etc/singularity/capability.json \ + /var/lib/arvados/etc/singularity/ecl.toml +chmod u+s /var/lib/arvados/bin/singularity -flock /var/lib/gopath/gopath.lock go install "git.arvados.org/arvados.git/services/crunch-dispatch-local" -install $GOPATH/bin/crunch-dispatch-local /usr/local/bin -ln -sf arvados-server /usr/local/bin/crunch-run - -if test "$1" = "--only-deps" ; then - exit -fi - -cat > /usr/local/bin/crunch-run.sh <&1 +set -ex -o pipefail + +. /usr/local/lib/arvbox/common.sh +. /usr/local/lib/arvbox/go-setup.sh + +flock /var/lib/gopath/gopath.lock go install "git.arvados.org/arvados.git/services/crunch-dispatch-local" +install $GOPATH/bin/crunch-dispatch-local /usr/local/bin +ln -sf arvados-server /usr/local/bin/crunch-run + +if test "$1" = "--only-deps" ; then + exit +fi + +cat > /usr/local/bin/crunch-run.sh <