Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jupyter-host/controller-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ f_install_miniconda() {
conda_repo="https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-Linux-x86_64.sh"
fi
ID=$(date +%s)-${RANDOM} # This script may run at the same time!
nohup wget --no-check-certificate ${conda_repo} -O /tmp/miniconda-${ID}.sh 2>&1 > /tmp/miniconda_wget-${ID}.out
mkdir -p ${PWD}/tmp
nohup wget --no-check-certificate ${conda_repo} -O ${PWD}/tmp/miniconda-${ID}.sh 2>&1 > ${PWD}/tmp/miniconda_wget-${ID}.out
rm -rf ${install_dir}
mkdir -p $(dirname ${install_dir})
nohup bash /tmp/miniconda-${ID}.sh -b -p ${install_dir} 2>&1 > /tmp/miniconda_sh-${ID}.out
nohup bash ${PWD}/tmp/miniconda-${ID}.sh -b -p ${install_dir} 2>&1 > ${PWD}/tmp/miniconda_sh-${ID}.out
}

f_set_up_conda_from_yaml() {
Expand Down
4 changes: 3 additions & 1 deletion jupyter-host/start-template-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ if sudo -n true 2>/dev/null && which docker >/dev/null 2>&1; then
sudo docker logs ${container_name}
elif which singularity >/dev/null 2>&1; then
echo "Running singularity container ${service_nginx_sif}"
# We need to mount $PWD/tmp:/tmp because otherwise nginx writes the file /tmp/nginx.pid
# We need to mount $PWD/tmp:/tmp because otherwise nginx writes the file /tmp/nginx.pid
# and other users cannot use the node. Was not able to change this in the config.conf.
export TMPDIR=${PWD}/tmp
export SINGULARITY_TMPDIR=${PWD}/tmp
mkdir -p ./tmp
# Need to overwrite default configuration!
touch empty
Expand Down
5 changes: 3 additions & 2 deletions jupyterlab-host/controller-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ f_install_miniconda() {
conda_repo="https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-Linux-x86_64.sh"
fi
ID=$(date +%s)-${RANDOM} # This script may run at the same time!
nohup wget --no-check-certificate ${conda_repo} -O /tmp/miniconda-${ID}.sh 2>&1 > /tmp/miniconda_wget-${ID}.out
mkdir -p ${PWD}/tmp
nohup wget --no-check-certificate ${conda_repo} -O ${PWD}/tmp/miniconda-${ID}.sh 2>&1 > ${PWD}/tmp/miniconda_wget-${ID}.out
rm -rf ${install_dir}
mkdir -p $(dirname ${install_dir})
nohup bash /tmp/miniconda-${ID}.sh -b -p ${install_dir} 2>&1 > /tmp/miniconda_sh-${ID}.out
nohup bash ${PWD}/tmp/miniconda-${ID}.sh -b -p ${install_dir} 2>&1 > ${PWD}/tmp/miniconda_sh-${ID}.out
source ${install_dir}/etc/profile.d/conda.sh
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
Expand Down
4 changes: 3 additions & 1 deletion jupyterlab-host/start-template-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ elif sudo -n true 2>/dev/null && which docker >/dev/null 2>&1; then
sudo docker logs ${container_name}
elif which singularity >/dev/null 2>&1; then
echo "Running singularity container ${service_nginx_sif}"
# We need to mount $PWD/tmp:/tmp because otherwise nginx writes the file /tmp/nginx.pid
# We need to mount $PWD/tmp:/tmp because otherwise nginx writes the file /tmp/nginx.pid
# and other users cannot use the node. Was not able to change this in the config.conf.
export TMPDIR=${PWD}/tmp
export SINGULARITY_TMPDIR=${PWD}/tmp
mkdir -p ./tmp
# Need to overwrite default configuration!
touch empty
Expand Down
11 changes: 6 additions & 5 deletions kasmvnc-docker/start-template-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,19 @@ echo "kill ${kasmvnc_container_pid} | true #kasmvnc_container_pid" >> cancel.sh
echo "$(date) KasmVNC container started with PID ${kasmvnc_container_pid}"

echo "$(date) Copy .Xauthority from container to host..."
mkdir -p ${PWD}/tmp
for i in $(seq 1 30); do
if ${docker_cmd} cp "${container_name}:/home/packer/.Xauthority" "/tmp/.xauth${XdisplayNumber}" \
|| ${docker_cmd} cp "${container_name}:/home/metauser/.Xauthority" "/tmp/.xauth${XdisplayNumber}"
if ${docker_cmd} cp "${container_name}:/home/packer/.Xauthority" "${PWD}/tmp/.xauth${XdisplayNumber}" \
|| ${docker_cmd} cp "${container_name}:/home/metauser/.Xauthority" "${PWD}/tmp/.xauth${XdisplayNumber}"
then
break
fi
echo "$(date) Attempt $i/30 failed, retrying in 2s..."
sleep 2
done
sudo chown "$USER" "/tmp/.xauth${XdisplayNumber}" || chown "$USER" "/tmp/.xauth${XdisplayNumber}"
echo "rm /tmp/.xauth${XdisplayNumber}" >> cancel.sh
export XAUTHORITY=/tmp/.xauth${XdisplayNumber}
sudo chown "$USER" "${PWD}/tmp/.xauth${XdisplayNumber}" || chown "$USER" "${PWD}/tmp/.xauth${XdisplayNumber}"
echo "rm ${PWD}/tmp/.xauth${XdisplayNumber}" >> cancel.sh
export XAUTHORITY=${PWD}/tmp/.xauth${XdisplayNumber}

echo "$(date) Starting xterm on the host..."
run_xterm_loop(){
Expand Down
3 changes: 3 additions & 0 deletions kasmvnc-singularity/start-template-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ else
WRITABLE_TMPFS_FLAG="--writable-tmpfs"
fi

export TMPDIR=${PWD}/tmp
export SINGULARITY_TMPDIR=${PWD}/tmp
mkdir -p ${PWD}/tmp
mkdir -p $PWD/container_tmp

set -x
Expand Down
11 changes: 9 additions & 2 deletions vncserver/start-template-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ elif [[ "${service_vnc_type}" == "SingularityTurboVNC" ]]; then
# Start service
mkdir -p ~/.vnc
export TMPDIR=${PWD}/tmp
export SINGULARITY_TMPDIR=${PWD}/tmp
mkdir -p $TMPDIR
${singularity_exec} ${PW_PARENT_JOB_DIR}/vncserver.sh | tee -a vncserver.out &
#echo "kill $! # singularity run" >> cancel.sh
Expand All @@ -376,7 +377,10 @@ elif [[ "${service_vnc_type}" == "KasmVNC" ]]; then
# KasmVNC #
###########
export kasmvnc_port=$(pw agent open-port)
export XDG_RUNTIME_DIR=""
mkdir -p ${PWD}/tmp/.X11-unix
mkdir -p ${PWD}/.run
chmod 700 ${PWD}/.run
export XDG_RUNTIME_DIR=${PWD}/.run

if [ "${service_set_password}" != true ]; then
service_password=password
Expand Down Expand Up @@ -500,7 +504,8 @@ sudo chmod +x /usr/lib/kasmvncserver/select-de.sh
vncserver_cmd="${service_vnc_exec} ${DISPLAY} ${disableBasicAuth} \
${desktop_arg} \
-websocketPort ${kasmvnc_port} \
-rfbport ${displayPort}"
-rfbport ${displayPort} \
-tmpdir ${PWD}/tmp"

echo Running:
echo ${vncserver_cmd}
Expand Down Expand Up @@ -663,6 +668,8 @@ HERE
echo "Running singularity container ${service_nginx_sif}"
# We need to mount $PWD/tmp:/tmp because otherwise nginx writes the file /tmp/nginx.pid
# and other users cannot use the node. Was not able to change this in the config.conf.
export TMPDIR=${PWD}/tmp
export SINGULARITY_TMPDIR=${PWD}/tmp
mkdir -p ./tmp
# Need to overwrite default configuration!
touch empty
Expand Down