From f85fa2e5159f73e42c5624074dd17eee0d6927e9 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Mar 2024 20:49:47 +0000 Subject: [PATCH 1/6] docs: fix localhost URL - fixes #889 --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 8c4273db..24d45e1e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,7 +16,7 @@ docker run --rm -it -p 9999:8888 ghcr.io/synerbi/sirf:jupyter docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:jupyter-gpu ``` -The Jupyter notebook should be accessible at . +The Jupyter notebook should be accessible at . > [!WARNING] > To sync the container user & host user permissions (useful when sharing folders), use `--user` and `--group-add`. From 936ef17942675cd79e439e37ea3b8bfe6983d2ea Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Mar 2024 21:00:52 +0000 Subject: [PATCH 2/6] docs: docker tags - fixes #890 --- docker/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/README.md b/docker/README.md index 24d45e1e..505e3da4 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,6 +16,17 @@ docker run --rm -it -p 9999:8888 ghcr.io/synerbi/sirf:jupyter docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:jupyter-gpu ``` +> [!TIP] +> docker tag | CIL branch/tag +> :---|:--- +> `latest`, `latest-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) +> `M`, `M.m`, `M.m.p`, `M-gpu`, `M.m-gpu`, `M.m.p-gpu` | tag `vM.m.p` +> `edge`, `edge-gpu` | `master` +> only build & test (no tag) | CI (current commit) +> `devel`, `devel-gpu` | `master` with `cmake -DDEVEL_BUILD=ON -DBUILD_CIL=ON` +> +> See [`ghcr.io/synerbi/sirf`](https://github.com/SyneRBI/SIRF-SuperBuild/pkgs/container/sirf) for a full list of tags. + The Jupyter notebook should be accessible at . > [!WARNING] From 2e2643aa85fc092bf6503fbdc10fa1450d6a88d0 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Mar 2024 21:02:01 +0000 Subject: [PATCH 3/6] docker: fix image tags --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 77b63d61..a7b0a1ba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,7 +40,7 @@ jobs: ghcr.io/synerbi/sirf flavor: | latest=auto - suffix=${{ matrix.type == 'gpu' && 'gpu,onlatest=true' || '' }} + suffix=${{ matrix.type == 'gpu' && '-gpu,onlatest=true' || '' }} tags: | type=edge type=semver,pattern={{version}} @@ -130,7 +130,7 @@ jobs: ghcr.io/synerbi/sirf flavor: | latest=false - suffix=${{ matrix.type == 'gpu' && 'gpu,onlatest=true' || '' }} + suffix=${{ matrix.type == 'gpu' && '-gpu,onlatest=true' || '' }} tags: devel labels: | org.opencontainers.image.licenses=Apache-2.0${{ matrix.type == 'gpu' && ' AND BSD-3-Clause AND GPL-3.0' || '' }} From 16377f2a558eba4119c7922a95a856ee59a6694c Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Mar 2024 21:14:45 +0000 Subject: [PATCH 4/6] docker: add `:jupyter` tag --- .github/workflows/docker.yml | 1 + docker/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a7b0a1ba..310e2868 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,6 +46,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + type=raw,value=jupyter,enable=${{ startsWith(github.ref, 'refs/tags') }} labels: | org.opencontainers.image.licenses=Apache-2.0${{ matrix.type == 'gpu' && ' AND BSD-3-Clause AND GPL-3.0' || '' }} - uses: docker/login-action@v3 diff --git a/docker/README.md b/docker/README.md index 505e3da4..446d7b32 100644 --- a/docker/README.md +++ b/docker/README.md @@ -19,7 +19,7 @@ docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:jupyter-gpu > [!TIP] > docker tag | CIL branch/tag > :---|:--- -> `latest`, `latest-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) +> `latest`, `latest-gpu`, `jupyter`, `jupyter-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) > `M`, `M.m`, `M.m.p`, `M-gpu`, `M.m-gpu`, `M.m.p-gpu` | tag `vM.m.p` > `edge`, `edge-gpu` | `master` > only build & test (no tag) | CI (current commit) From 5168369b87bd988f3d7b5ce43849b40eb9200f94 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Mar 2024 21:19:32 +0000 Subject: [PATCH 5/6] docker: drop `:jupyter` tag --- .github/workflows/docker.yml | 4 ++-- docker-compose.yml | 2 +- docker/README.md | 14 +++++++------- docker/compose.sh | 2 +- docker/devel/shared.txt | 2 +- docker/docker-compose.devel-gpu.yml | 2 +- docker/docker-compose.devel.yml | 2 +- docker/docker-compose.gpu.yml | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 310e2868..20070788 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -90,7 +90,7 @@ jobs: run: | # rebuild sirf image ./docker/compose.sh -bR${{ matrix.type == 'gpu' && 'g' || 'c' }} - image=synerbi/sirf:jupyter${{ steps.pull.outputs.suffix }} + image=synerbi/sirf:latest${{ steps.pull.outputs.suffix }} echo "image=$image" >> "$GITHUB_OUTPUT" # tag potentially newer core image docker tag synerbi/jupyter:scipy-${{ matrix.type }} ${{ steps.pull.outputs.core_image }} @@ -174,7 +174,7 @@ jobs: run: | # rebuild sirf image ./docker/compose.sh -dbR${{ matrix.type == 'gpu' && 'g' || 'c' }} - image=synerbi/sirf:jupyter-devel${{ steps.pull.outputs.suffix }} + image=synerbi/sirf:devel${{ steps.pull.outputs.suffix }} echo "image=$image" >> "$GITHUB_OUTPUT" - name: test CIL run: > diff --git a/docker-compose.yml b/docker-compose.yml index 04d8dd52..623c13be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: BUILD_GPU: 0 sirf: container_name: sirf # for scaling, comment this out https://github.com/docker/compose/issues/3729 - image: synerbi/sirf:jupyter + image: synerbi/sirf:latest build: context: . args: diff --git a/docker/README.md b/docker/README.md index 446d7b32..cd129591 100644 --- a/docker/README.md +++ b/docker/README.md @@ -11,15 +11,15 @@ The image contains SIRF & all dependencies required by JupyterHub. ```sh # CPU version -docker run --rm -it -p 9999:8888 ghcr.io/synerbi/sirf:jupyter +docker run --rm -it -p 9999:8888 ghcr.io/synerbi/sirf:latest # GPU version -docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:jupyter-gpu +docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:latest-gpu ``` > [!TIP] > docker tag | CIL branch/tag > :---|:--- -> `latest`, `latest-gpu`, `jupyter`, `jupyter-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) +> `latest`, `latest-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) > `M`, `M.m`, `M.m.p`, `M-gpu`, `M.m-gpu`, `M.m.p-gpu` | tag `vM.m.p` > `edge`, `edge-gpu` | `master` > only build & test (no tag) | CI (current commit) @@ -35,7 +35,7 @@ The Jupyter notebook should be accessible at . > ```sh > docker run --rm -it -p 9999:8888 --user $(id -u) --group-add users \ > -v ./devel:/home/jovyan/work \ -> ghcr.io/synerbi/sirf:jupyter +> ghcr.io/synerbi/sirf:latest > ``` More config: . @@ -46,7 +46,7 @@ More config: ```sh > docker run --rm -it -p 9999:8888 --user $(id -u) --group-add users \ > -v /mnt/data:/share -e SIRF_DOWNLOAD_DATA_ARGS="-pm -D /share" \ -> ghcr.io/synerbi/sirf:jupyter +> ghcr.io/synerbi/sirf:latest > ``` ### Extending @@ -55,9 +55,9 @@ You can build custom images on top of the SIRF ones, likely needing to switch be ```Dockerfile # CPU version -# FROM synerbi/sirf:jupyter +# FROM synerbi/sirf:latest # GPU version -FROM synerbi/sirf:jupyter-gpu +FROM synerbi/sirf:latest-gpu USER root RUN mamba install pytorch && fix-permissions "${CONDA_DIR}" /home/${NB_USER} USER ${NB_UID} diff --git a/docker/compose.sh b/docker/compose.sh index 96517f0e..bad86d9e 100755 --- a/docker/compose.sh +++ b/docker/compose.sh @@ -3,7 +3,7 @@ set -euo pipefail print_help(){ cat < Date: Wed, 20 Mar 2024 14:19:25 +0000 Subject: [PATCH 6/6] docs: intermediate (cache) docker tags --- docker/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index cd129591..f832394c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -17,15 +17,19 @@ docker run --rm -it -p 9999:8888 --gpus all ghcr.io/synerbi/sirf:latest-gpu ``` > [!TIP] -> docker tag | CIL branch/tag +> docker tag | git branch/tag > :---|:--- > `latest`, `latest-gpu` | [latest tag `v*.*.*`](https://github.com/SyneRBI/SIRF-SuperBuild/releases/latest) > `M`, `M.m`, `M.m.p`, `M-gpu`, `M.m-gpu`, `M.m.p-gpu` | tag `vM.m.p` > `edge`, `edge-gpu` | `master` -> only build & test (no tag) | CI (current commit) > `devel`, `devel-gpu` | `master` with `cmake -DDEVEL_BUILD=ON -DBUILD_CIL=ON` > > See [`ghcr.io/synerbi/sirf`](https://github.com/SyneRBI/SIRF-SuperBuild/pkgs/container/sirf) for a full list of tags. +> +> The [`docker.yml` workflow](../.github/workflows/docker.yml) builds & pushes all the docker tags above. +> Additionally, `core` & `core-gpu` intermediate (cache) docker tags are built & pushed by the workflow, but are not intended for users. + +The workflow will also build & test all PRs (without pushing any new image tags). The Jupyter notebook should be accessible at . @@ -165,3 +169,6 @@ Note that this cache is different from the "normal" `ccache` of your host. (If y + Install [`requirements.yml`](requirements.yml) + Clone & setup & + Set some environment variables (e.g. `PYTHONPATH=/opt/SIRF-SuperBuild/INSTALL/python`, `OMP_NUM_THREADS=$(( cpu_count/2 ))`) + +> [!NOTE] +> `synerbi/jupyter:*` are only intermediate (cache) images not intended for users.