Skip to content

Avoid polluting service user account with micromamba files #62

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

Merged
merged 2 commits into from
Mar 30, 2025

Conversation

atteggiani
Copy link
Collaborator

@atteggiani atteggiani commented Mar 30, 2025

Background

Currently, the micromamba create command within the testing job creates environment in a custom folder, but still uses/stores cache packages in the default location.
This ends up polluting the ~/.local folder of the service user, which should not happen.

Solution

Before running the micromamba create command, set the MAMBA_ROOT_PREFIX env variable to the temporary folder (deleted at the end of the workflow), so the cache would automatically be stored there instead.

Tasks carried out

  • Added line to export MAMBA_ROOT_PREFIX env variable, to avoid polluting the service user with micromamba-related files
  • Set tmp_dir equal to ${{ steps.create-tmp-dir.outputs.tmp_dir }} and replaced multiple occurrences of ${{ steps.create-tmp-dir.outputs.tmp_dir }} with it

…ng the service user with micromamba-related files
jo-basevi
jo-basevi previously approved these changes Mar 30, 2025
Copy link
Collaborator

@jo-basevi jo-basevi left a comment

Choose a reason for hiding this comment

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

Line 163 has another instance of ${{ steps.create-tmp-dir.outputs.tmp_dir }} in cmd="${{ vars.MICROMAMBA_EXE }} run --prefix $env_prefix ... command. But otherwise, looks good to me!

@atteggiani
Copy link
Collaborator Author

Line 163 has another instance of ${{ steps.create-tmp-dir.outputs.tmp_dir }} in cmd="${{ vars.MICROMAMBA_EXE }} run --prefix $env_prefix ... command. But otherwise, looks good to me!

Oops thank you!

Addressed in 28c63a4cfb346513a046b5f5ba4cddfa35f9586b

@atteggiani atteggiani requested a review from jo-basevi March 30, 2025 23:13
Copy link
Collaborator

@jo-basevi jo-basevi left a comment

Choose a reason for hiding this comment

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

lgtm!

@atteggiani atteggiani merged commit 0e7320a into main Mar 30, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from New Issues to Done ✅ in ACCESS-rAM3 Mar 30, 2025
@atteggiani atteggiani deleted the davide/add_mamba_root_prefix branch March 30, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✅
Development

Successfully merging this pull request may close these issues.

2 participants