-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changes in $HOME lost after restarting workspace #19529
Comments
Also edits to |
Hi @Adamtaranto, I've followed up on your support ticket, please take a look there. |
Hi @axonasif, please reopen this issue. It is not solved. I have tried installing miniconda into the root directory of my project using the env variable How can I specify a location for miniconda that will persist between restarts? |
Hi @Adamtaranto, please try this dockerfile: # Image source code: https://github.com/axonasif/workspace-images/tree/tmp
# Also see https://github.com/gitpod-io/workspace-images/issues/1071
FROM axonasif/workspace-python@sha256:f5ba627a31505ea6cf100abe8e552d7ff9e0abd6ba46745b6d6dab349c001430
# Set user
USER gitpod
# Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p $HOME/miniconda && \
rm ~/miniconda.sh
# Add Miniconda to PATH
ENV PATH="$HOME/miniconda/bin:$PATH"
# Initialize conda in bash config files:
RUN conda init bash
# Set up Conda channels
RUN conda config --add channels conda-forge && \
conda config --add channels bioconda && \
conda config --set channel_priority strict
# Set libmamba as solver
RUN conda config --set solver libmamba
# Persist ~/miniconda
RUN echo 'create-overlay $HOME/miniconda' > "$HOME/.runonce/1-miniconda" Or, you can also create a workspace from here to try: https://github.com/allforks/nbgrader-gitpod-template/tree/patch
Yes, it doesn't. It's only mounted after you enter a running workspace |
Hi Aminur, Thanks! It looks like changes in Is it possible to also preserve changes to the |
Hi @Adamtaranto Yes! Just add the following to your dockerfile: # Persist ~/.condarc
RUN echo 'create-overlay $HOME/.condarc' > "$HOME/.runonce/2-condarc" The command is essentially this: But here we're creating a startup script at |
I had to do the same thing with Is it safe to remove the pyenv dirs from my PATH? I forget what the exact issue was but at some point having
Will the new workspace image at |
If I remember correctly, this custom image does not add the shims dir to the path, do you still see it in |
As long as my dockerhub account exists, it should be there. There is a proposal to add this patch to the official image: gitpod-io/workspace-images#1071 |
Yep, I just tested it with the |
In that case it's probably coming from pyenv side and not something we hooked into. Maybe there's a flag to disable that on pyenv but I don't remember it now. What you're doing also works just fine if you need to remove it from PATH. |
This was working earlier, but now
Could The current test repo is at: |
Definitely something weird going on. I'm using the code below in my
First echo $PATH in init (shims 3rd item):
Remove shims in init block (no shims):
Echo $PATH at start of command block (shims is back!):
I'm now forcing packages to be installed with the miniconda pip3 with @axonasif do you have any idea why shims is no longer removed from the path by this line in my Dockerfile?:
|
Also, the alias that I am adding to
I have this line in my Dockerfile to persist the .bashrc file:
|
Update: The unwanted I can't see anything in obvious in |
@Adamtaranto talking a look now. Edit: check the support ticket. |
FYI, for future readers, the fixes can be found here: https://github.com/allforks/nbgrader-gitpod-template |
Bug description
I have been using the Dockerfile below for the last year without issue to create workspaces with miniconda.
Miniconda is installed into the $HOME (/home/gitpod) dir. Recently changes in this dir such as installed packages or new envs have been failing to persist after restarting the workspace.
Has something changed on your end?
Should I install miniconda somewhere else now?
Steps to reproduce
Create new Gitpod workspace using these config files. Create a test env (i.e. conda env create -n testenv). Stop and restart the workspace.
Startup will give error on "jupyter nbextension" commands from .gitpod.yml as packages previously install by
init: pip3 install -r requirements.txt
are gone. Alsoconda env list
will show that testenv is gone..gitpod.Dockerfile
.gitpod.yml
requirements.txt
Workspace affected
melbournebi-comp9001620-96dowtuzt7i
Expected behavior
New envs and installed packages in $HOME should persist after restarting a stopped workspace.
Example repository
No response
Anything else?
This seems to have become an issue some time after November last year.
The text was updated successfully, but these errors were encountered: