Commit 1de86ae1 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Added support for shared slurmtestuser home folder.

parent ee9076f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ fi
#---------------------

if [ "x$SAFEMODE" == "xFalse" ]; then
    echo "[INFO] Executing  prestartup scripts (current + parents):"
    echo "[INFO] Executing  prestartup scripts (parents + current):"
    python /prestartup.py
else
    echo "[INFO] Not executing prestartup scripts as we are in safemode"
+3 −1
Original line number Diff line number Diff line
@@ -34,7 +34,9 @@ def shell(command, interactive=False):
prestartup_scripts_path='/prestartup'
def sorted_ls(path):
    mtime = lambda f: os.stat(os.path.join(path, f)).st_mtime
    return list(sorted(os.listdir(path), key=mtime))
    file_list = list(sorted(os.listdir(path), key=mtime))
    file_list.reverse()
    return file_list

for item in sorted_ls(prestartup_scripts_path):
    if item.endswith('.sh'):
+3 −0
Original line number Diff line number Diff line
@@ -28,3 +28,6 @@ RUN useradd slurmtestuser
RUN mkdir -p /home/slurmtestuser/.ssh
RUN cat /rosetta/.ssh/id_rsa.pub >> /home/slurmtestuser/.ssh/authorized_keys
RUN chown -R slurmtestuser:slurmtestuser /home/slurmtestuser   

# Add prestartup
COPY prestartup_slurmbase.sh /prestartup/
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
#!/bin/bash
set -e

# "Deactivate" local slurmtestuser home
mv /home/slurmtestuser /home_slurmtestuser_vanilla

# Link slurmtestuser against the home in the shared folder (which will be setup by the master node)
ln -s /shared/home_slurmtestuser /home/slurmtestuser
+4 −0
Original line number Diff line number Diff line
#!/bin/bash
set -e

# Generic rosetta user shared folder
mkdir -p /shared/rosetta && chown rosetta:rosetta /shared/rosetta

# Shared home for slurmtestuser to simulate a shared home folders filesystem
cp -a /home_slurmtestuser_vanilla /shared/home_slurmtestuser