Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

env:
release: "2022.10.2"
release: "2022.11.0"
defaultpython: "3.8"

strategy:
Expand Down Expand Up @@ -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 }}

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] <br /> ![][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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ services:
context: ../base
dockerfile: Dockerfile
args:
release: "2022.10.2"
release: "2022.11.0"
image: ghcr.io/dask/dask:latest
hostname: dask-scheduler
ports:
- "8786:8786"
- "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:
context: ../base
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"]
Expand All @@ -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:
Expand Down
20 changes: 17 additions & 3 deletions notebook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG base

FROM $base/base-notebook:lab
FROM $base/docker-stacks-foundation:lab

ARG release
ARG python
Expand Down Expand Up @@ -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 \
Expand All @@ -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"]