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

setup-micromamba should fail when restoring an existing conda environment #219

Open
0xbe7a opened this issue Jul 4, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@0xbe7a
Copy link
Contributor

0xbe7a commented Jul 4, 2024

setup-micromamba currently does not fail when restoring a cached environment on top of an existing one. Instead, all files from the cache override the existing ones, while all other files from the existing environment persist. This leads to multiple issues; for example, the conda-meta folder can contain multiple files for the same package with different versions, or imports may break (such as utils.py from a dependency getting split into utils/__init__.py while utils.py persists and takes precedence over utils/).

While setup-micromamba could attempt to rectify the situation by pruning the target folder before restoring the cached environment, I believe it should instead produce an error. The better fix is to use either:

  1. Runner hooks to automatically clean the shared micromamba root prefix folder after every job using a job-completed shell hook (removing the burden from users), or
  2. Set post-cleanup to environment to instruct setup-micromamba to do this automatically.

Ideally, setup-micromamba would detect that it is running inside a long-living self-hosted runner, but I could not find any provided environment variables or similar indicators that would facilitate this elegantly.

@pavelzw pavelzw added the bug Something isn't working label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants