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

Fix image build and bump base image version #197

Merged
merged 5 commits into from
Nov 15, 2021
Merged

Conversation

ableuler
Copy link
Contributor

@ableuler ableuler commented Oct 25, 2021

This bumps the notebooks base image from lab-3.0.16 to lab-3.2.1, so a good look from the @SwissDataScienceCenter/poc squad to check if that breaks something would be appreciated.

@@ -6,5 +6,4 @@ jupyterlab~=3.0.0
papermill~=2.3.0
powerline-shell~=0.7.0
requests>=2.20.0
setuptools==57.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this? it will be globally available and would make sure that the user's environment uses the same setuptools as the renku venv.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also pin the pip and wheel versions in fact

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I had pinned it only very recently when replacing pipx with a handmade virtual env, believing that this would determine also the version used inside the virtual env and thus prevent the 2-to-3 bug when installing renku.
This assumption was wrong, therefore I'm removing this line again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see, it always uses the latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to go even further and strictly pin everything in the users environment, but for now I just wanted to fix the build and not pin a package version based on a renku requirement in an env that doesn't install renku.

Copy link
Contributor Author

@ableuler ableuler Oct 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure which version it will use for the venv if nothing is specified, but you can determine it through the virtualenv command (which I didn't know before but I was pleased to find out).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - is setuptools 57.5.0 still needed for renku to install properly? In that case I would say we should pin it also in the global environment in case the user wants to pip install it to use renku as a library in python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is still needed. good point, I added it to the user python env.

@gavin-k-lee
Copy link
Contributor

I can help out with a review. I notice that the py-batch build fails - should this be looked into first?

@ableuler
Copy link
Contributor Author

I can help out with a review. I notice that the py-batch build fails - should this be looked into first?

Yes, that would be very much appreciated. Thanks a lot! 🙏

@gavin-k-lee
Copy link
Contributor

gavin-k-lee commented Oct 28, 2021

@TaoSunVoyage do we need to replicate pinning the Renku version in the batch Docker? I.e. like this:

ARG RENKU_VERSION
RUN mkdir -p $HOME/.renku/bin && \
virtualenv --pip 21.3.1 --setuptools 57.5.0 --wheel 0.36.2 --no-periodic-update $HOME/.renku/venv && \
source $HOME/.renku/venv/bin/activate && \
pip install --no-cache renku==$RENKU_VERSION sentry-sdk && \
deactivate && \
ln -s $HOME/.renku/venv/bin/renku $HOME/.renku/bin/renku

instead of
RUN python3 -m pip install --no-cache pipenv
RUN virtualenv /share/.renku && \
. /share/.renku/bin/activate && \
pip install --no-cache renku && \
deactivate && \
ln -s /share/.renku/bin/renku /share/bin

@TaoSunVoyage
Copy link
Contributor

@TaoSunVoyage do we need to replicate pinning the Renku version in the batch Docker? I.e. like this:

ARG RENKU_VERSION
RUN mkdir -p $HOME/.renku/bin && \
virtualenv --pip 21.3.1 --setuptools 57.5.0 --wheel 0.36.2 --no-periodic-update $HOME/.renku/venv && \
source $HOME/.renku/venv/bin/activate && \
pip install --no-cache renku==$RENKU_VERSION sentry-sdk && \
deactivate && \
ln -s $HOME/.renku/venv/bin/renku $HOME/.renku/bin/renku

instead of

RUN python3 -m pip install --no-cache pipenv
RUN virtualenv /share/.renku && \
. /share/.renku/bin/activate && \
pip install --no-cache renku && \
deactivate && \
ln -s /share/.renku/bin/renku /share/bin

Thanks @gavin-k-lee, it looks nice.

just wondering if it's possible to simply copy the folder of $HOME/.renku/ from the base to /share/.renku in the batch? keep the same venv between base and batch, and easy to maintain (maybe).

@gavin-k-lee
Copy link
Contributor

@TaoSunVoyage do we need to replicate pinning the Renku version in the batch Docker? I.e. like this:

ARG RENKU_VERSION
RUN mkdir -p $HOME/.renku/bin && \
virtualenv --pip 21.3.1 --setuptools 57.5.0 --wheel 0.36.2 --no-periodic-update $HOME/.renku/venv && \
source $HOME/.renku/venv/bin/activate && \
pip install --no-cache renku==$RENKU_VERSION sentry-sdk && \
deactivate && \
ln -s $HOME/.renku/venv/bin/renku $HOME/.renku/bin/renku

instead of

RUN python3 -m pip install --no-cache pipenv
RUN virtualenv /share/.renku && \
. /share/.renku/bin/activate && \
pip install --no-cache renku && \
deactivate && \
ln -s /share/.renku/bin/renku /share/bin

Thanks @gavin-k-lee, it looks nice.

just wondering if it's possible to simply copy the folder of $HOME/.renku/ from the base to /share/.renku in the batch? keep the same venv between base and batch, and easy to maintain (maybe).

I think that could work! Do you want to try implementing that fix?

@ableuler
Copy link
Contributor Author

@TaoSunVoyage any chance you could give it a try with the fix that you and @gavin-k-lee have discussed. We should try and get this fix to the users asap.

@TaoSunVoyage
Copy link
Contributor

The simple copy doesn't work as the python executable in the venv is a symbolic link to the conda python. So, I reinstalled it in batch image instead.

Copy link
Contributor Author

@ableuler ableuler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @TaoSunVoyage feel free to approve and merge.

@TaoSunVoyage TaoSunVoyage merged commit 81da834 into master Nov 15, 2021
@TaoSunVoyage TaoSunVoyage deleted the 000-fix-build branch November 15, 2021 22:36
TaoSunVoyage added a commit that referenced this pull request Nov 16, 2021
* fix: pin setuptools, pip, wheel and renku in renku virtualenv

* fix: solve certificate problem by upgrading base image

* chore: pin setuptools also in user python env

* fix: renku install

* fix: typo in base arg

Co-authored-by: Tao Sun <[email protected]>
TaoSunVoyage added a commit that referenced this pull request Nov 17, 2021
* fix: pin setuptools, pip, wheel and renku in renku virtualenv

* fix: solve certificate problem by upgrading base image

* chore: pin setuptools also in user python env

* fix: install renku with venv in batch image

* fix: typo in base arg

Co-authored-by: Tao Sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git client struggling with new letsencrypt root certificate
4 participants