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

Timing issue when renaming ~/.bashrc to ~/.profile

Open martin-g opened this issue 2 years ago • 6 comments

I use the action on a self-hosted runner. The VM is powerful and I run several Github Action runner instances on it.

From time to time the job fails with:

Initializing conda shell integration...
  /home/ubuntu/miniconda/condabin/conda init --all
  no change     /home/ubuntu/miniconda/condabin/conda
  no change     /home/ubuntu/miniconda/bin/conda
  no change     /home/ubuntu/miniconda/bin/conda-env
  no change     /home/ubuntu/miniconda/bin/activate
  no change     /home/ubuntu/miniconda/bin/deactivate
  no change     /home/ubuntu/miniconda/etc/profile.d/conda.sh
  no change     /home/ubuntu/miniconda/etc/fish/conf.d/conda.fish
  no change     /home/ubuntu/miniconda/shell/condabin/Conda.psm1
  no change     /home/ubuntu/miniconda/shell/condabin/conda-hook.ps1
  no change     /home/ubuntu/miniconda/lib/python3.8/site-packages/xontrib/conda.xsh
  no change     /home/ubuntu/miniconda/etc/profile.d/conda.csh
  no change     /home/ubuntu/.bashrc
  no change     /home/ubuntu/.zshrc
  no change     /home/ubuntu/.config/fish/config.fish
  no change     /home/ubuntu/.xonshrc
  no change     /home/ubuntu/.tcshrc
  No action taken.
  Renaming "/home/ubuntu/.bashrc" to "/home/ubuntu/.profile"
  
Error: ENOENT: no such file or directory, rename '/home/ubuntu/.bashrc' -> '/home/ubuntu/.profile'

I use remove-profiles: false but it seems this does not prevent the renaming.

Could this be improved to be more friendly to such self-hosted setups ?

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

Is there any workaround for this issue ? Almost half of the job runs fail because of this: https://github.com/martin-g/zeppelin/runs/4618065075?check_suite_focus=true

I tried touching these files before running setup-miniconda but it does not help too:

https://github.com/martin-g/zeppelin/blob/1a6ffb862a20f28fb66d43ace21b1f9052caa9f6/.github/workflows/core.yml#L63-L74

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

It renamed also my .bashrc to .profile. The problem: .profile already existed and was overridden! This is not Ok and should at least be mentioned as important. .profile is used by our web shell and was broken for some hours. Too much hidden system modifications for a github action.

schudoku avatar Oct 19 '22 08:10 schudoku

A workaround for my case was to use different OS user for each self-hosted Github runner.

martin-g avatar Oct 19 '22 08:10 martin-g

Hi @martin-g sorry for the late reply. We will look into it!

goanpeca avatar Oct 20 '22 21:10 goanpeca

+1 on at least adding more docs regarding self-hosted runners. Just naively ran this on my laptop because I'd run out of action minutes. Now my .bashrc is gone...

Ideally, the action would not meddle with anything outside of $PWD and $CONDA. Although I see how bash -l {0} may not initialize right then.

Is there a way to run this action in a self-hosted runner that uses a regular working account on a multi-user system?

epruesse avatar Nov 02 '22 23:11 epruesse

Ideally, the action would not meddle with anything outside of $PWD and $CONDA. Although I see how bash -l {0} may not initialize right then.

Correct

Is there a way to run this action in a self-hosted runner that uses a regular working account on a multi-user system?

Have not tried it

goanpeca avatar Nov 03 '22 16:11 goanpeca