Enhance Dockerfile to create a writable workspace under /srv/LeafWeb and update piscal_manager.sh to check for write permissions on working directories.

This commit is contained in:
2026-03-19 21:44:23 -04:00
parent 9be068962c
commit fa2029b1cb
2 changed files with 12 additions and 1 deletions
+7
View File
@@ -67,6 +67,13 @@ RUN set -xe \
RUN set -xe \ RUN set -xe \
&& mkdir /run/sshd && mkdir /run/sshd
# Ensure the job/workspace base under /srv is writable.
# The client uses `/srv/${PiscalDirectoryName}/input` and `PiscalDirectoryName`
# can itself be prefixed with `LeafWeb/...`.
RUN set -xe \
&& mkdir -p /srv/LeafWeb \
&& chown -R ${SSH_USERNAME}:${SSH_GROUP} /srv/LeafWeb
# Create storage directory structure with proper ownership # Create storage directory structure with proper ownership
RUN set -xe \ RUN set -xe \
&& mkdir -p ${STORAGE_PATH}/input \ && mkdir -p ${STORAGE_PATH}/input \
+5 -1
View File
@@ -88,7 +88,7 @@ for candidate in \
"$PWD/$directory_name" \ "$PWD/$directory_name" \
"/srv/$directory_name" "/srv/$directory_name"
do do
if [ -d "$candidate/$input_directory_name" ]; then if [ -d "$candidate/$input_directory_name" ] && [ -w "$candidate" ]; then
working_directory="$candidate" working_directory="$candidate"
break break
fi fi
@@ -109,6 +109,10 @@ if [ "$task" = "launch" ] || [ "$task" = "get_status" ] || [ "$task" = "get_stat
echo "working directory $working_directory not found" echo "working directory $working_directory not found"
exit 1 exit 1
fi fi
if [ ! -w "$working_directory" ]; then
echo "working directory $working_directory is not writable"
exit 1
fi
if [ ! -d "$input_directory" ]; then if [ ! -d "$input_directory" ]; then
echo "input directory $input_directory not found" echo "input directory $input_directory not found"
exit 1 exit 1