From 44a5515e2e673231bf4812d06d5b7666110dc949 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 10 Dec 2021 15:21:49 +0300 Subject: [PATCH 1/7] Try to use old mamba version --- base-notebook/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index d550a042..1de61721 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -81,7 +81,11 @@ WORKDIR /tmp # CONDA_MIRROR is a mirror prefix to speed up downloading # For example, people from mainland China could set it as # https://mirrors.tuna.tsinghua.edu.cn/github-release/conda-forge/miniforge/LatestRelease -ARG CONDA_MIRROR=https://github.com/conda-forge/miniforge/releases/latest/download + +# Using fixed version of mamba, because the latest one has problems with arm under qemu +# See: https://github.com/jupyter/docker-stacks/issues/1539 +ARG CONDA_MIRROR=https://github.com/conda-forge/miniforge/releases/download/4.10.3-7 + # ---- Miniforge installer ---- # Check https://github.com/conda-forge/miniforge/releases From 06ad3274610f87255d1b76f451aa85e96014a857 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sat, 11 Dec 2021 16:38:01 +0300 Subject: [PATCH 2/7] Pin mamba version --- base-notebook/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index 1de61721..3cc91fdb 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -81,11 +81,7 @@ WORKDIR /tmp # CONDA_MIRROR is a mirror prefix to speed up downloading # For example, people from mainland China could set it as # https://mirrors.tuna.tsinghua.edu.cn/github-release/conda-forge/miniforge/LatestRelease - -# Using fixed version of mamba, because the latest one has problems with arm under qemu -# See: https://github.com/jupyter/docker-stacks/issues/1539 -ARG CONDA_MIRROR=https://github.com/conda-forge/miniforge/releases/download/4.10.3-7 - +ARG CONDA_MIRROR=https://github.com/conda-forge/miniforge/releases/latest/download # ---- Miniforge installer ---- # Check https://github.com/conda-forge/miniforge/releases @@ -106,6 +102,10 @@ RUN set -x && \ conda config --system --set show_channel_urls true && \ if [[ "${PYTHON_VERSION}" != "default" ]]; then mamba install --quiet --yes python="${PYTHON_VERSION}"; fi && \ mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \ + # Using fixed version of mamba, because the latest one has problems with arm under qemu + # See: https://github.com/jupyter/docker-stacks/issues/1539 + mamba install --quiet --yes 'mamba<0.18' && \ + mamba list mamba | grep '^mamba ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \ # Using conda to update all packages: https://github.com/mamba-org/mamba/issues/1092 conda update --all --quiet --yes && \ conda clean --all -f -y && \ From 323307422c062274c049d6491de0760347255566 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 12 Dec 2021 12:42:14 +0300 Subject: [PATCH 3/7] Try to free up space --- .github/workflows/docker.yml | 9 +++++++++ base-notebook/Dockerfile | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8eb2473b..aaabb62e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,6 +55,15 @@ jobs: contents: write steps: + - name: Maximize build space + uses: easimon/maximize-build-space@b4d02c14493a9653fe7af06cc89ca5298071c66e # dependabot updates to latest release + with: + # root-reserve-mb: 51200 # 50 GB + # build-mount-path: /var/lib/docker/tmp # remaining space + remove-dotnet: "true" + remove-haskell: "true" + remove-android: "true" + # Setup docker to build for multiple platforms, see: # https://github.com/docker/build-push-action/tree/master#usage # https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index 3cc91fdb..d550a042 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -102,10 +102,6 @@ RUN set -x && \ conda config --system --set show_channel_urls true && \ if [[ "${PYTHON_VERSION}" != "default" ]]; then mamba install --quiet --yes python="${PYTHON_VERSION}"; fi && \ mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \ - # Using fixed version of mamba, because the latest one has problems with arm under qemu - # See: https://github.com/jupyter/docker-stacks/issues/1539 - mamba install --quiet --yes 'mamba<0.18' && \ - mamba list mamba | grep '^mamba ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \ # Using conda to update all packages: https://github.com/mamba-org/mamba/issues/1092 conda update --all --quiet --yes && \ conda clean --all -f -y && \ From c84c1b26ebd7aedcc2ca758efc466417e2a306c7 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 12 Dec 2021 12:48:29 +0300 Subject: [PATCH 4/7] Better config --- .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 aaabb62e..04e8bdcc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,8 +58,8 @@ jobs: - name: Maximize build space uses: easimon/maximize-build-space@b4d02c14493a9653fe7af06cc89ca5298071c66e # dependabot updates to latest release with: - # root-reserve-mb: 51200 # 50 GB - # build-mount-path: /var/lib/docker/tmp # remaining space + root-reserve-mb: 51200 # 50 GB + build-mount-path: /var/lib/docker # remaining space remove-dotnet: "true" remove-haskell: "true" remove-android: "true" From 686fa136720b0bcf7b0dfe8d7bbe3032e2e33d87 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 12 Dec 2021 15:28:16 +0300 Subject: [PATCH 5/7] Simple implementation --- .github/workflows/docker.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 04e8bdcc..3302a641 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -56,13 +56,10 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@b4d02c14493a9653fe7af06cc89ca5298071c66e # dependabot updates to latest release - with: - root-reserve-mb: 51200 # 50 GB - build-mount-path: /var/lib/docker # remaining space - remove-dotnet: "true" - remove-haskell: "true" - remove-android: "true" + run: | + rm -rf /usr/share/dotnet + rm -rf /usr/local/lib/android + rm -rf /opt/ghc # Setup docker to build for multiple platforms, see: # https://github.com/docker/build-push-action/tree/master#usage From 4ae1d3e11dc52abfd404759b66938a13b7b4d9ce Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 12 Dec 2021 15:33:53 +0300 Subject: [PATCH 6/7] Fix --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3302a641..26d24726 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,9 +57,9 @@ jobs: steps: - name: Maximize build space run: | - rm -rf /usr/share/dotnet - rm -rf /usr/local/lib/android - rm -rf /opt/ghc + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc # Setup docker to build for multiple platforms, see: # https://github.com/docker/build-push-action/tree/master#usage From 57156de45b35c88803810a6e854b42d72d765fc3 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 12 Dec 2021 22:54:52 +0300 Subject: [PATCH 7/7] Older mamba for arm --- base-notebook/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index d550a042..dd824e02 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -109,6 +109,18 @@ RUN set -x && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}" +# Using fixed version of mamba in arm, because the latest one has problems with arm under qemu +# See: https://github.com/jupyter/docker-stacks/issues/1539 +RUN set -x && \ + arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + mamba install --quiet --yes \ + 'mamba<0.18' && \ + mamba clean --all -f -y && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}"; \ + fi; + # Install Jupyter Notebook, Lab, and Hub # Generate a notebook server config # Cleanup temporary files