From c3b0a5de5b1425ca63b66013ca3c211ffc8d682c Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:13:25 -0800 Subject: [PATCH 1/7] Bump dask to 2022.11.0 --- .github/workflows/build.yml | 2 +- README.md | 12 ++++++------ build/docker-compose.yml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76068c8..6e46fcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: - release: "2022.10.2" + release: "2022.11.0" defaultpython: "3.8" strategy: diff --git a/README.md b/README.md index 958e04a..369fe1e 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ | `ghcr.io/dask/dask-notebook` | Jupyter Notebook image to use as helper entrypoint | [![][daskdev-dask-notebook-py38-release] ![][daskdev-dask-notebook-release] ![][daskdev-dask-notebook-latest]
![][daskdev-dask-notebook-py39-release]](https://github.com/dask/dask-docker/pkgs/container/dask-notebook) | [daskdev-dask-latest]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-latest-blue -[daskdev-dask-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.10.2-blue -[daskdev-dask-py38-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.10.2--py3.8-blue -[daskdev-dask-py39-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.10.2--py3.9-blue +[daskdev-dask-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.11.0-blue +[daskdev-dask-py38-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.11.0--py3.8-blue +[daskdev-dask-py39-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask-2022.11.0--py3.9-blue [daskdev-dask-notebook-latest]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-latest-blue -[daskdev-dask-notebook-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.10.2-blue -[daskdev-dask-notebook-py38-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.10.2--py3.8-blue -[daskdev-dask-notebook-py39-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.10.2--py3.9-blue +[daskdev-dask-notebook-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.11.0-blue +[daskdev-dask-notebook-py38-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.11.0--py3.8-blue +[daskdev-dask-notebook-py39-release]: https://img.shields.io/badge/ghcr.io%2Fdask%2Fdask--notebook-2022.11.0--py3.9-blue ## Example diff --git a/build/docker-compose.yml b/build/docker-compose.yml index d9ebdf9..c7a8d15 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -6,7 +6,7 @@ services: context: ../base dockerfile: Dockerfile args: - release: "2022.10.2" + release: "2022.11.0" image: ghcr.io/dask/dask:latest hostname: dask-scheduler ports: @@ -28,7 +28,7 @@ services: dockerfile: Dockerfile args: python: "3.8" - release: "2022.10.2" + release: "2022.11.0" image: ghcr.io/dask/dask:latest hostname: dask-worker command: ["dask-worker", "tcp://scheduler:8786"] @@ -40,7 +40,7 @@ services: args: base: daskdev python: "3.8" - release: "2022.10.2" + release: "2022.11.0" depends_on: - base-notebook image: ghcr.io/dask/dask-notebook:latest From c9ad261d587c7f7763a17a690b4971fa2a4c6419 Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:14:17 -0800 Subject: [PATCH 2/7] Use docker-stacks-foundation image instead of base-notebook --- .github/workflows/build.yml | 4 ++-- README.md | 8 ++++---- build/docker-compose.yml | 8 ++++---- notebook/Dockerfile | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e46fcc..1e1057d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,11 +100,11 @@ jobs: uses: docker/build-push-action@v2 if: contains(matrix.image.tag, 'dask-notebook') with: - context: ./docker-stacks/base-notebook + context: ./docker-stacks/docker-stacks-foundation push: false load: true platforms: linux/amd64 - tags: daskdev/base-notebook:lab + tags: daskdev/docker-stacks-foundation:lab build-args: | PYTHON_VERSION=${{ matrix.python }} diff --git a/README.md b/README.md index 369fe1e..0ba2289 100644 --- a/README.md +++ b/README.md @@ -80,19 +80,19 @@ docker-compose build notebook ### Cross building -The images can be cross-built using `docker buildx bake`. However buildx bake does not listen to `depends_on` (since in theory that is only a runtime not a build time constraint https://github.com/docker/buildx/issues/447). To work around this we first need to build the "base-notebook" image. +The images can be cross-built using `docker buildx bake`. However buildx bake does not listen to `depends_on` (since in theory that is only a runtime not a build time constraint https://github.com/docker/buildx/issues/447). To work around this we first need to build the "docker-stacks-foundation" image. ```bash cd build # If you have permission to push to daskdev/ -docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --push base-notebook +docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --push docker-stacks-foundation docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --push # If you don'tset DOCKERUSER to your dockerhub username. export DOCKERUSER=holdenk -docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --set base-notebook.tags.image=${DOCKERUSER}/base-notebook:lab-py38 --push base-notebook -docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --set scheduler.tags=${DOCKERUSER}/dask --set worker.tags=${DOCKERUSER}/dask --set notebook.tags=${DOCKERUSER}/dask-notebook --set base-notebook.tags=${DOCKERUSER}/base-notebook:lab-py38 --set notebook.args.base=${DOCKERUSER} --push +docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --set docker-stacks-foundation.tags.image=${DOCKERUSER}/docker-stacks-foundation:lab-py38 --push docker-stacks-foundation +docker buildx bake --progress=plain --set *.platform=linux/arm64,linux/amd64 --set scheduler.tags=${DOCKERUSER}/dask --set worker.tags=${DOCKERUSER}/dask --set notebook.tags=${DOCKERUSER}/dask-notebook --set docker-stacks-foundation.tags=${DOCKERUSER}/docker-stacks-foundation:lab-py38 --set notebook.args.base=${DOCKERUSER} --push ``` ## Releasing diff --git a/build/docker-compose.yml b/build/docker-compose.yml index c7a8d15..22ec6fe 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -14,13 +14,13 @@ services: - "8787:8787" command: ["dask-scheduler"] - base-notebook: + docker-stacks-foundation: build: - context: github.com/jupyter/docker-stacks.git#main:base-notebook + context: github.com/jupyter/docker-stacks.git#main:docker-stacks-foundation dockerfile: Dockerfile args: PYTHON_VERSION: "3.8" - image: daskdev/base-notebook:lab + image: daskdev/docker-stacks-foundation:lab worker: build: @@ -42,7 +42,7 @@ services: python: "3.8" release: "2022.11.0" depends_on: - - base-notebook + - docker-stacks-foundation image: ghcr.io/dask/dask-notebook:latest hostname: notebook ports: diff --git a/notebook/Dockerfile b/notebook/Dockerfile index d3a8891..c47c32a 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -1,6 +1,6 @@ ARG base -FROM $base/base-notebook:lab +FROM $base/docker-stacks-foundation:lab ARG release ARG python From 9aec2cc4d24457575c9aec13e14057611b503893 Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:33:30 -0800 Subject: [PATCH 3/7] Remove erroring jlpm cleanup --- notebook/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/notebook/Dockerfile b/notebook/Dockerfile index c47c32a..f1dc6f3 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -42,7 +42,6 @@ RUN mamba install -y \ "dask-labextension>=5" \ && mamba clean -tipy \ && jupyter lab clean \ - && jlpm cache clean \ && npm cache clean --force \ && find /opt/conda/ -type f,l -name '*.a' -delete \ && find /opt/conda/ -type f,l -name '*.pyc' -delete \ From 2ba40c896ccdddbe2eb5f30c127caa04cf23877a Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:39:34 -0800 Subject: [PATCH 4/7] Revert "Remove erroring jlpm cleanup" This reverts commit 9aec2cc4d24457575c9aec13e14057611b503893. --- notebook/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/notebook/Dockerfile b/notebook/Dockerfile index f1dc6f3..c47c32a 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -42,6 +42,7 @@ RUN mamba install -y \ "dask-labextension>=5" \ && mamba clean -tipy \ && jupyter lab clean \ + && jlpm cache clean \ && npm cache clean --force \ && find /opt/conda/ -type f,l -name '*.a' -delete \ && find /opt/conda/ -type f,l -name '*.pyc' -delete \ From 15ff3c97c3ef0f2e68a2898db2f14e60e1f60266 Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:41:41 -0800 Subject: [PATCH 5/7] Install lab / notebook deps explicitly --- notebook/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notebook/Dockerfile b/notebook/Dockerfile index c47c32a..992a639 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -39,6 +39,9 @@ RUN mamba install -y \ ipywidgets \ cachey \ streamz \ + notebook \ + jupyterhub \ + jupyterlab \ "dask-labextension>=5" \ && mamba clean -tipy \ && jupyter lab clean \ From cce76494da5ea85b48415662320deb71e4a52e27 Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:55:15 -0800 Subject: [PATCH 6/7] Expose port 8888 explicitly --- notebook/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notebook/Dockerfile b/notebook/Dockerfile index 992a639..69dd657 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -53,6 +53,8 @@ RUN mamba install -y \ && (find /opt/conda/lib/python*/site-packages/bokeh/server/static -type f,l -name '*.js' -not -name '*.min.js' -delete || echo "no bokeh static files to cleanup") \ && rm -rf /opt/conda/pkgs +EXPOSE 8888 + USER root # Create the /opt/app directory, and assert that Jupyter's NB_UID/NB_GID values From 60750c5e9060157168875919f38a1b2b0739a79d Mon Sep 17 00:00:00 2001 From: Charles Blackmon-Luca <20627856+charlesbluca@users.noreply.github.com> Date: Wed, 16 Nov 2022 11:44:04 -0800 Subject: [PATCH 7/7] Add more required changes from base-notebook --- notebook/Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/notebook/Dockerfile b/notebook/Dockerfile index 69dd657..c5300e7 100644 --- a/notebook/Dockerfile +++ b/notebook/Dockerfile @@ -39,14 +39,10 @@ RUN mamba install -y \ ipywidgets \ cachey \ streamz \ - notebook \ - jupyterhub \ jupyterlab \ "dask-labextension>=5" \ && mamba clean -tipy \ && jupyter lab clean \ - && jlpm cache clean \ - && npm cache clean --force \ && find /opt/conda/ -type f,l -name '*.a' -delete \ && find /opt/conda/ -type f,l -name '*.pyc' -delete \ && find /opt/conda/ -type f,l -name '*.js.map' -delete \ @@ -55,8 +51,16 @@ RUN mamba install -y \ EXPOSE 8888 +# jupyter server config pulled from upstream `base-notebook` +ADD https://raw.githubusercontent.com/jupyter/docker-stacks/main/base-notebook/jupyter_server_config.py /etc/jupyter/jupyter_server_config.py + USER root +# legacy jupyter notebook server support pulled from upstream `base-notebook` +RUN sed -re "s/c.ServerApp/c.NotebookApp/g" \ + /etc/jupyter/jupyter_server_config.py > /etc/jupyter/jupyter_notebook_config.py && \ + fix-permissions /etc/jupyter/ + # Create the /opt/app directory, and assert that Jupyter's NB_UID/NB_GID values # haven't changed. RUN mkdir /opt/app \ @@ -70,6 +74,11 @@ RUN mkdir /opt/app \ COPY --chown=1000:100 examples/ /home/$NB_USER/examples COPY prepare.sh /usr/bin/prepare.sh +# HEALTHCHECK pulled from upstream `base-notebook` +HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \ + CMD wget -O- --no-verbose --tries=1 --no-check-certificate \ + http${GEN_CERT:+s}://localhost:8888${JUPYTERHUB_SERVICE_PREFIX:-/}api || exit 1 + USER $NB_USER ENTRYPOINT ["tini", "--", "/usr/bin/prepare.sh"]