setup-miniconda
setup-miniconda copied to clipboard
Change default behavior for profile deletion to be False
See https://github.com/conda-incubator/setup-miniconda/issues/151
Is it possible to make this change sooner? It just turned my self-hosted runner upside down. I guess others might encounter this as well.
fyi @singhbal-baljinder
Do we want to change the default globally or only for self hosted instances?
Or maybe being a bit more conservative and just renaming files (and undoing at the end)?
Do we want to change the default globally or only for self hosted instances?
Maybe only for self hosted instances
Besides removing .bashrc
, even the flag remove-profiles
is set to false
, it still edits .profile
.
Besides removing
.bashrc
, even the flagremove-profiles
is set tofalse
, it still edits.profile
.
Same here!
Thanks for the input. There is no way around proper environment activation if those files are not edited, so what could be the workaround?
I've made some improvements with https://github.com/conda-incubator/setup-miniconda/pull/209. If accepted it won't try to mv ~/.bashrc ~/.profile
when remove-profiles: false
!
But as noted by others it will still edit .profile
to add conda activate envName
.
This is really a problem for self-hosted runners where one non-ephemeral VM runs several GHA runners. Usually people use powerful VM and it would be a waste to run just one job/runner at a time!
The workaround is to use separate OS users for each self-hosted runner. This way different build jobs do not change the activated environment for another runner in the middle of the job.
There is one more issue though: each job appends conda activate envName
to the bottom of ~/.profile
. It would be good to undo
the addition at the end of a job. Or to remove any such lines from previous runs.
Here the workaround is to add a step before setup-miniconda
that does sed -i '/conda activate/d' $HOME/.profile
It would be good to undo the addition at the end of a job.
That is a good idea!
This is very dangerous behaviour, happening without any clear warning.
The action completely cleared my ~/.bashrc
, ~/.zshrc
and ~/.profile
files on a self-hosted runner.