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

Change default behavior for profile deletion to be False #172

Open
goanpeca opened this issue Apr 26, 2021 · 10 comments
Open

Change default behavior for profile deletion to be False #172

goanpeca opened this issue Apr 26, 2021 · 10 comments
Labels
type:enhancement New feature or request
Milestone

Comments

@goanpeca
Copy link
Member

See #151

@goanpeca goanpeca added this to the v3.0.0 milestone Apr 26, 2021
@goanpeca goanpeca added the type:enhancement New feature or request label Apr 26, 2021
@jackalcooper
Copy link

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.

@traversaro
Copy link

fyi @singhbal-baljinder

@jaimergp
Copy link
Member

jaimergp commented Aug 27, 2021

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

@jackalcooper
Copy link

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

Maybe only for self hosted instances

@jackalcooper
Copy link

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

@HosameldinMohamed
Copy link

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

Same here!

@goanpeca
Copy link
Member Author

goanpeca commented Dec 27, 2021

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

@martin-g
Copy link
Contributor

martin-g commented Dec 30, 2021

I've made some improvements with #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

@goanpeca
Copy link
Member Author

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

That is a good idea!

@epignatelli
Copy link

epignatelli commented May 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants