setup-miniconda icon indicating copy to clipboard operation
setup-miniconda copied to clipboard

Change default behavior for profile deletion to be False

Open goanpeca opened this issue 3 years ago • 10 comments

See https://github.com/conda-incubator/setup-miniconda/issues/151

goanpeca avatar Apr 26 '21 18:04 goanpeca

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.

jackalcooper avatar Aug 27 '21 03:08 jackalcooper

fyi @singhbal-baljinder

traversaro avatar Aug 27 '21 06:08 traversaro

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)?

jaimergp avatar Aug 27 '21 08:08 jaimergp

Do we want to change the default globally or only for self hosted instances?

Maybe only for self hosted instances

jackalcooper avatar Aug 27 '21 23:08 jackalcooper

Besides removing .bashrc, even the flag remove-profiles is set to false, it still edits .profile.

jackalcooper avatar Aug 27 '21 23:08 jackalcooper

Besides removing .bashrc, even the flag remove-profiles is set to false, it still edits .profile.

Same here!

HosameldinMohamed avatar Dec 23 '21 16:12 HosameldinMohamed

Thanks for the input. There is no way around proper environment activation if those files are not edited, so what could be the workaround?

goanpeca avatar Dec 27 '21 15:12 goanpeca

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

martin-g avatar Dec 30 '21 13:12 martin-g

It would be good to undo the addition at the end of a job.

That is a good idea!

goanpeca avatar Jan 21 '22 02:01 goanpeca

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.

epignatelli avatar May 19 '23 20:05 epignatelli