Skip to content

Conversation

@pansapiens
Copy link
Contributor

@pansapiens pansapiens commented Jul 1, 2025

This commit addresses several issues encountered when running the rstudio.sh script.

The script would fail under two conditions:

  1. If conda was not available, the conda deactivate command would raise a non-zero exit code. This has been removed as it's not essential for the script's operation any longer.
    1. The apptainer exec command was using an incorrect syntax for the --env flag, passing a comma-separated list instead of individual key=value pairs.
      This commit corrects the --env flag usage and introduces --cleanenv to ensure a predictable environment within the container. Additional env vars, including RENV_PATHS_CACHE have been added.

Additionally, in some cases the RStudio server would fail to start because it couldn't find the host user inside the container. This is resolved by bind-mounting the host's /etc/passwd and /etc/group files in read-only mode.

Fixes #6

This commit addresses several issues encountered when running the rstudio.sh script.

The script would fail under two conditions:
1. If `conda` was not initialized, the `conda deactivate` command would error out. This has been removed as it's not essential for the script's operation.
2. The `apptainer exec` command was using an incorrect syntax for the `--env` flag, passing a comma-separated list instead of individual `key=value` pairs.

This commit corrects the `--env` flag usage and introduces `--cleanenv` to ensure a predictable environment within the container.

Additionally, the RStudio server would fail to start because it couldn't find the host user inside the container. This is resolved by bind-mounting the host's `/etc/passwd` and `/etc/group` files in read-only mode.
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.

Set appropriate RENV_ environment variables and bind-paths for renv cache

2 participants