From b81af117763da42419cdc08575bb5f1df3ad188f Mon Sep 17 00:00:00 2001 From: Matthew Gaughan Date: Thu, 23 Jan 2025 13:01:26 -0800 Subject: [PATCH] setting up the gitignore and Rstudio docker image for hyak --- .gitignore | 2 + rstudio-server.job | 100 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .gitignore create mode 100644 rstudio-server.job diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65294d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore the R studio docker image needed by hyak +rstudio_latest.sif diff --git a/rstudio-server.job b/rstudio-server.job new file mode 100644 index 0000000..e7081d0 --- /dev/null +++ b/rstudio-server.job @@ -0,0 +1,100 @@ +#!/bin/sh + +#SBATCH --job-name=mgaughan-rstudio-server +#SBATCH --partition=cpu-g2-mem2x + +#SBATCH --time=02:00:00 +#SBATCH --nodes=1 +#SBATCH --ntasks=4 +#SBATCH --mem=20G + +#SBATCH --signal=USR2 +#SBATCH --output=%x_%j.out + +# 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_XXXXXXXX.out +# where the %x is short hand for --job-name above and the X's are an 8-digit +# jobID assigned by SLURM when our job is submitted. + +RSTUDIO_CWD="/mmfs1/home/mjilg/git/mw-lifecycle-analysis" +RSTUDIO_SIF="/mmfs1/home/mjilg/rstudio_latest.sif" + +# 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