Skip to content

Commit 0e41a8e

Browse files
vevetronV
and
V
authored
Update image and packages for 2025 (#3643)
* feat(jupyter-singleuser): Update image and packages for 2025 * feat(jupyterhub): deploy the next image to the testing slot --------- Co-authored-by: V <[email protected]>
1 parent 07498e7 commit 0e41a8e

File tree

5 files changed

+3237
-2786
lines changed

5 files changed

+3237
-2786
lines changed

images/jupyter-singleuser/Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM jupyter/datascience-notebook:python-3.11.6
22

3-
LABEL org.opencontainers.image.source https://github.com/cal-itp/data-infra
3+
LABEL org.opencontainers.image.source=https://github.com/cal-itp/data-infra
44

55
USER root
66
RUN apt-get update
@@ -15,8 +15,7 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | s
1515
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
1616
RUN apt update \
1717
&& apt install -y gh
18-
19-
18+
RUN apt-get install -y gdal-bin libgdal-dev # for rasterio
2019
# create these ahead of time, then chown to to the notebook user
2120
ENV GCLOUD_HOME=/gcloud
2221
ENV POETRY_HOME="/poetry"
@@ -29,9 +28,10 @@ USER $NB_UID
2928

3029
RUN curl -sSL https://install.python-poetry.org | python3 -
3130
ENV PATH="$POETRY_HOME/bin:$PATH"
32-
33-
RUN npm install -g --unsafe-perm=true --allow-root netlify-cli vega-cli vega-lite sql-language-server
34-
31+
RUN npm install -g --unsafe-perm=true --allow-root netlify-cli
32+
# RUN npm install -g --unsafe-perm=true --allow-root vega-cli # Can't get these to work
33+
# RUN npm install -g --unsafe-perm=true --allow-root vega-lite
34+
RUN npm install -g --unsafe-perm=true --allow-root sql-language-server
3535
# gcloud CLI https://cloud.google.com/sdk/docs/install#deb
3636
RUN cd $GCLOUD_HOME \
3737
&& curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-423.0.0-linux-x86_64.tar.gz \
@@ -42,7 +42,9 @@ ENV PATH="$GCLOUD_HOME/google-cloud-sdk/bin:$PATH"
4242
COPY ./pyproject.toml /reqs/pyproject.toml
4343
COPY ./poetry.lock /reqs/poetry.lock
4444
RUN poetry config virtualenvs.create false
45+
# RUN gdalinfo --version # for debugging, use this to figure out which rasterio to support
4546
RUN cd /reqs && poetry install --with=shared_utils --with=portfolio
47+
RUN cd /reqs && poetry show # print out the package versions for documentation
4648
RUN poetry config virtualenvs.create true
4749

4850
ENV DBT_PROFILES_DIR=/home/jovyan/.dbt/

images/jupyter-singleuser/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,24 @@ via JupyterHub.
77

88
A person with Docker set up locally can build a new version of the image at any time after making changes.
99

10+
This can check for any significant security issues with this build
11+
```
12+
pip install safety
13+
safety scan
14+
```
15+
Take the package versions from the build file and document with the PR. Do a cleanup step before you make a final build.
16+
17+
```
18+
docker system prune -a #
19+
docker build . 2>&1 | tee build.log
20+
```
21+
22+
1023
```bash
1124
docker build -t ghcr.io/cal-itp/data-infra/jupyter-singleuser:[NEW VERSION TAG] .
1225
```
1326

27+
1428
## Deploying Changes to Production
1529

1630
When changes are finalized, a new version number should be specified in [pyproject.toml](./pyproject.toml). When changes to this directory are merged into `main`, [a GitHub Action](../../.github/workflows/build-jupyter-singleuser-image.yml) automatically publishes an updated version of the image. A contributor with proper GHCR permissions can also manually deploy a new version of the image via the CLI:

0 commit comments

Comments
 (0)