#!/bin/sh #SBATCH --job-name=rstudio-server #SBATCH --account=coenv #SBATCH --partition=cpu-g2 #update this line - use hyakalloc to find partitions you can use #SBATCH --time=00-08:00:00 #SBATCH --ntasks=1 # Number of tasks #SBATCH --cpus-per-task=14 # Increased threads from 4 to 8 #SBATCH --nodes=1 #SBATCH --mem=200G #SBATCH --signal=USR2 #SBATCH --output=%x_%j.out ## Specify the working directory for this job #SBATCH --chdir=/gscratch/scrubbed/strigg/analyses/20250808_rstudio # This script will request a single CPU with four threads with 20GB of RAM for 2 hours. # You can adjust --time, --nodes, --ntasks, and --mem above to adjust these settings for your session. # --output=%x_%j.out creates a output file called rstudio-server_NNNNNNNN.out # where the %x is short hand for --job-name above and the N's are an 8-digit # jobID assigned by SLURM when our job is submitted. RSTUDIO_CWD="/gscratch/srlab/strigg/bin/R" # UPDATE THIS LINE RSTUDIO_SIF="srlab-R4.4-bioinformatics-container-72d71cd.sif" # UPDATE THIS LINE # Create temp directory for ephemeral content to bind-mount in the container RSTUDIO_TMP=$(/usr/bin/python3 -c 'import tempfile; print(tempfile.mkdtemp())') mkdir -p -m 700 \ ${RSTUDIO_TMP}/run \ ${RSTUDIO_TMP}/tmp \ ${RSTUDIO_TMP}/var/lib/rstudio-server cat > ${RSTUDIO_TMP}/database.conf < ${RSTUDIO_TMP}/rsession.sh <&2 <&2 exit $APPTAINER_EXIT_CODE