diff --git a/rstudio/form.yml b/rstudio/form.yml index b2aebab..7a40586 100644 --- a/rstudio/form.yml +++ b/rstudio/form.yml @@ -11,6 +11,8 @@ form: - exclusive - use_cgw - cgw + - use_custom_container + - custom_container attributes: bc_account: label: "ACCRE Slurm Group" @@ -77,3 +79,20 @@ attributes: - [ "Any Node", "any" ] - [ "119GB Memory", "119g" ] - [ "246GB Memory", "246g" ] + use_custom_container: + widget: check_box + checked_value: 1 + unchecked_value: 0 + label: "Use your own custom Container" + help: | + Check this box if you wish to run your job using a custom singularity + container that you provide rather than one available in the list above. + Your container must contain or have access to a working R environment + and RStudio installation and the resssion executable must be in the user path. + custom_container: + label: "Custom Container" + value: "" + help: | + Leave blank unless using a custom Singularity container. If using a custom + singularity container, enter the absolute path to your container + file which must be accessible by the ACCRE compute nodes. diff --git a/rstudio/template/script.sh.erb b/rstudio/template/script.sh.erb index b4bc53c..2d5de4e 100755 --- a/rstudio/template/script.sh.erb +++ b/rstudio/template/script.sh.erb @@ -4,6 +4,9 @@ setup_env () { module purge +<%- if context.use_custom_container.to_i == 1 -%> +RSTUDIO_SERVER_IMAGE=<%= context.custom_container %> +<%- else -%> accre_rversion=<%= context.version %> if [[ "$accre_rversion" == "r3.6.0.v3" ]] then @@ -15,7 +18,7 @@ elif [[ "$accre_rversion" == "r4.0.5.v1" ]] then export RSTUDIO_SERVER_IMAGE="/accre/common/singularity/accre.internal.rstudio.4.0.5.v1.sif" fi - +<%- end -%> } setup_env