Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Singularity guide #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nathanweeks
Copy link
Contributor

Updates the Singularity guide:

  • Set rserver --server-user in job script (singularity on HPC with slurm rocker-versioned2#837)
  • Show where R_PROFILE_USER and R_LIBS_USER can be set
    (Specify .Rprofile and .Renviron when using singularity  rocker-versioned2#855)
  • Use rocker/rstudio:4.4.2
  • Specify python3 instead of python (the latter may be python 2 or absent on some hosts)
  • Mention Apptainer
  • mktemp is simpler and portable-enough (GNU coreutils) for creating temp dirs
  • Simplify creation of various writable directories in container with --scratch and --workdir
  • Ensure R_LIBS_USER directory exists
  • no longer need to create readable database.conf (sqlite seems to be the default)
  • SLURM_CPUS_ON_NODE technically more correct than SLURM_JOB_CPUS_PER_NODE
    (though shouldn't make a difference with a single-node allocation)

Copy link
Member

@cboettig cboettig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

## Importing a Rocker Image

Use the `singularity pull` command to import the desired Rocker image from Docker Hub into a (compressed, read-only) Singularity Image File:

```bash
singularity pull docker://rocker/rstudio:4.2
singularity pull docker://rocker/rstudio:4.4.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about rocker/rstudio:4?

/usr/lib/rstudio-server/bin/rserver --www-address=127.0.0.1
--scratch /run,/var/lib/rstudio-server \
--workdir $(mktemp -d) \
rstudio_4.4.2.sif \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

rstudio_4.2.sif \
/usr/lib/rstudio-server/bin/rserver --auth-none=0 --auth-pam-helper-path=pam-helper --server-user=$(whoami)
--scratch /run,/var/lib/rstudio-server \
rstudio_4.4.2.sif \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

# personal libraries from any R installation in the host environment

R_LIBS_USER=${HOME}/R/rocker-rstudio/4.4.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

singularity exec --cleanenv \
--scratch /run,/tmp,/var/lib/rstudio-server \
--workdir ${workdir} \
rstudio_4.4.2.sif \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Comment on lines +11 to +14
:::{.callout-note}
In this guide, *Singularity* can refer to either [SingularityCE](https://sylabs.io/singularity/) or [Apptainer](https://apptainer.org/).
While Apptainer is generally [compatible with Singularity commands and environment variables](https://apptainer.org/docs/user/latest/singularity_compatibility.html), Apptainer users may wish to replace the `singularity` command with `apptainer`, and `SINGULARITY` with `APPTAINER` in environment variables.
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty lines are needed around :::

Suggested change
:::{.callout-note}
In this guide, *Singularity* can refer to either [SingularityCE](https://sylabs.io/singularity/) or [Apptainer](https://apptainer.org/).
While Apptainer is generally [compatible with Singularity commands and environment variables](https://apptainer.org/docs/user/latest/singularity_compatibility.html), Apptainer users may wish to replace the `singularity` command with `apptainer`, and `SINGULARITY` with `APPTAINER` in environment variables.
:::
:::{.callout-note}
In this guide, *Singularity* can refer to either [SingularityCE](https://sylabs.io/singularity/) or [Apptainer](https://apptainer.org/).
While Apptainer is generally [compatible with Singularity commands and environment variables](https://apptainer.org/docs/user/latest/singularity_compatibility.html), Apptainer users may wish to replace the `singularity` command with `apptainer`, and `SINGULARITY` with `APPTAINER` in environment variables.
:::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants