diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76068c8..1e1057d 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: @@ -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 958e04a..0ba2289 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 @@ -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 d9ebdf9..22ec6fe 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: @@ -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: @@ -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,9 +40,9 @@ services: args: base: daskdev python: "3.8" - release: "2022.10.2" + 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..c5300e7 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 @@ -39,19 +39,28 @@ RUN mamba install -y \ ipywidgets \ cachey \ streamz \ + 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 \ && (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 + +# 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 \ @@ -65,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"]