Skip to content

Commit

Permalink
Set umask in container (#480)
Browse files Browse the repository at this point in the history
Performing an editable install on a shared filesystem scratch area
causes cache/version files to be written in the source repository.

With the container's default umask of 0022 the files are not group
writable which can lead to frustration when attempting to clean up the
scratch area.

Use the DLS "standard" of 0002.

Additionally modify the looping to only pickup directories within the
scratch area.

Fixes #478.
  • Loading branch information
joeshannon committed May 24, 2024
1 parent a3f023f commit 6f08f68
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions container-startup.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/usr/bin/env bash

# Set umask to DLS standard
umask 0002

if [[ -z "${SCRATCH_AREA}" ]]; then
SCRATCH_AREA="/blueapi-plugins/scratch"
fi

mkdir -p ${SCRATCH_AREA}

DIRS=`ls -1 ${SCRATCH_AREA}`

echo "Loading Python packages from from ${DIRS}"

for DIR in ${DIRS}
do
python -m pip install --no-deps -e "${SCRATCH_AREA}/${DIR}"
done
if [[ -d "${SCRATCH_AREA}" ]]; then
echo "Loading Python packages from ${SCRATCH_AREA}"
for DIR in ${SCRATCH_AREA}/*/; do # All directories
python -m pip install --no-deps -e "${DIR}"
done
else
echo "blueapi scratch area not present"
fi

blueapi $@

0 comments on commit 6f08f68

Please sign in to comment.