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

Upgrade jupyterhub-singleuser custom image deps so it can build w/ Python 3.11 #3352

Closed
themightychris opened this issue May 23, 2024 · 11 comments · Fixed by #3359
Closed

Upgrade jupyterhub-singleuser custom image deps so it can build w/ Python 3.11 #3352

themightychris opened this issue May 23, 2024 · 11 comments · Fixed by #3359

Comments

@themightychris
Copy link
Contributor

After upgrading JupyterHub, we need to upgrade our custom docker image to incorporate the latest jupyterhub library. It appears that this dependency comes is as part of the jupyter/datascience-notebook base image we use. In #3350 I upgraded it from :python-3.9 to the latest :python-3.11.6 since the :python-3.9 tag hasn't been updated in over 2 years, but now the image fails to build:

 => [15/23] COPY ./pyproject.toml /reqs/pyproject.toml                                                                                                                                                                                 0.2s
 => [16/23] COPY ./poetry.lock /reqs/poetry.lock                                                                                                                                                                                       0.0s
 => [17/23] RUN poetry config virtualenvs.create false                                                                                                                                                                                 0.7s
 => ERROR [18/23] RUN cd /reqs && poetry install --with=shared_utils --with=portfolio                                                                                                                                                  0.8s
------
 > [18/23] RUN cd /reqs && poetry install --with=shared_utils --with=portfolio:
0.600 The currently activated Python version 3.11.6 is not supported by the project (~3.9).
0.600 Trying to find and use a compatible version. 
0.691 
0.691 Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.
------
Dockerfile:45
--------------------
  43 |     COPY ./poetry.lock /reqs/poetry.lock
  44 |     RUN poetry config virtualenvs.create false
  45 | >>> RUN cd /reqs && poetry install --with=shared_utils --with=portfolio
  46 |     RUN poetry config virtualenvs.create true
  47 |     
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c cd /reqs && poetry install --with=shared_utils --with=portfolio" did not complete successfully: exit code: 1

To reproduce locally, check out the latest main branch and:

cd images/jupyter-singleuser/Dockerfile
docker build .

It appears that some poetry work will need to be done to upgrade dependencies to be compatible with Python 3.11

@mjumbewu
Copy link
Contributor

@themightychris have you tried updating the Python version in the pyproject.toml file? That might be enough to fix, but there may also be additional package version changes needed with the Python upgrade.

@themightychris
Copy link
Contributor Author

@mjumbewu good catch, after changing that line to python = "~3.11" I get:

Screenshot 2024-05-23 at 5 43 11 PM

@mjumbewu
Copy link
Contributor

@themightychris Ooh, looks like the calitp-map-utils package is pinned to Python 3.9.x. Will have to take a look at that.

@mjumbewu
Copy link
Contributor

Yep, it's pinned. That will have to be updated and pushed up to PyPI.

@themightychris
Copy link
Contributor Author

@mjumbewu I might have fixed it in #3354

@mjumbewu
Copy link
Contributor

We'll run into the same issue for calitp-data-analysis.

@themightychris
Copy link
Contributor Author

@mjumbewu yep just spotted that, already on it :-)

@themightychris
Copy link
Contributor Author

themightychris commented May 24, 2024

Now we're deeper into the deps failing:

Screenshot 2024-05-24 at 6 13 44 PM

This repo is also full of dependabot PRs relating to this and the calitp-* packages, so a more thorough sweep of dependencies might be needed @mjumbewu

Latest work is in #3359

@vevetron
Copy link
Contributor

vevetron commented May 24, 2024

Yea i'm testing out different combos - building it on my local mac using docker.

Right now i'm running into a dask 2022 not working with python 3.11. Also dask seems to be both in the calitp-data-analysis package as well as the base jupyter-single-user-image. I'm not sure why.

Tiffany says dask wasn't working when it was just in the image, "dependencies needed weren't getting installed / weren't passing tests," they needed to install it to the package

I propopse we remove it from the caltip-data-analysis package and just trying to have the requirements in the jupyter-single-user-image for now. The higher dask version. Then assuming we get this image working, can test out dask, and install the packages back in and test later.

@vevetron
Copy link
Contributor

OOf except calitp-data-analysis doesn't like that:
https://github.com/cal-itp/data-infra/actions/runs/9230746834/job/25399500299?pr=3359#step:6:176

@vevetron
Copy link
Contributor

Okay a version of the image is complete:
#3359

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 a pull request may close this issue.

3 participants