From 7581010518d52c959a88eb4fe4655e50eb399578 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 14:51:40 +0000 Subject: [PATCH 01/22] Replace extract-image-names.sh with JS script --- .github/workflows/build.yml | 25 ++++++------ .github/workflows/extract-image-names.sh | 52 ------------------------ 2 files changed, 13 insertions(+), 64 deletions(-) delete mode 100755 .github/workflows/extract-image-names.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5893ced5..42c3a980 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,15 +73,16 @@ jobs: build.json .github/workflows/env.hcl - - name: Set output image names - id: bake_metadata - # bake-action metadata output has gotten too big, so we first write it - # to a file. See https://github.com/aiidalab/aiidalab-docker-stack/issues/491 - run: | - cat << EOF > bake_metadata.json - ${{ steps.build-upload.outputs.metadata }} - EOF - images=$(.github/workflows/extract-image-names.sh bake_metadata.json) - echo "images=${images}" >> "${GITHUB_OUTPUT}" - # Pretty-print for GHA logs - echo "$images" | jq + - name: Set output variables + uses: actions/github-script@v7 + with: + script: | + const data = JSON.parse(process.env.BAKE_METADATA,'utf-8') + for (const key in JSON.parse(process.env.BAKE_METADATA || '{}', 'utf-8')) { + if (data.hasOwnProperty(key)) { + const entry = data[key]; + core.setOutput(`${key.toUpperCase().replace(/-/g, "_")}_IMAGE`, `${entry["image.name"]}@${entry["containerimage.digest"]}`); + } + } + env: + BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} diff --git a/.github/workflows/extract-image-names.sh b/.github/workflows/extract-image-names.sh deleted file mode 100755 index 6d0bed4f..00000000 --- a/.github/workflows/extract-image-names.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -metadata_file=$1 -# Extract image names together with their sha256 digests -# from the docker/bake-action metadata output. -# These together uniquely identify newly built images. - -# The input to this script is a json file (filename passed as first parameter to the script) -# Here's example input (trimmed to relevant bits): -# { -# "base": { -# "containerimage.descriptor": { -# "mediaType": "application/vnd.docker.distribution.manifest.v2+json", -# "digest": "sha256:8e57a52b924b67567314b8ed3c968859cad99ea13521e60bbef40457e16f391d", -# "size": 6170, -# }, -# "containerimage.digest": "sha256:8e57a52b924b67567314b8ed3c968859cad99ea13521e60bbef40457e16f391d", -# "image.name": "ghcr.io/aiidalab/base" -# }, -# "base-with-services": { -# "image.name": "ghcr.io/aiidalab/base-with-services" -# "containerimage.digest": "sha256:6753a809b5b2675bf4c22408e07c1df155907a465b33c369ef93ebcb1c4fec26", -# "...": "" -# } -# "full-stack": { -# "image.name": "ghcr.io/aiidalab/full-stack" -# "containerimage.digest": "sha256:85ee91f61be1ea601591c785db038e5899d68d5fb89e07d66d9efbe8f352ee48", -# "...": "" -# } -# "lab": { -# "image.name": "ghcr.io/aiidalab/lab" -# "containerimage.digest": "sha256:4d9be090da287fcdf2d4658bb82f78bad791ccd15dac9af594fb8306abe47e97", -# "...": "" -# } -# } -# -# Example output with trimmed SHAs (real output is on one line): -# -# { -# "BASE_IMAGE": "ghcr.io/aiidalab/base@sha256:8e57a52b92", -# "BASE_WITH_SERVICES_IMAGE": "ghcr.io/aiidalab/base-with-services@sha256:6753a809", -# "FULL_STACK_IMAGE": "ghcr.io/aiidalab/full-stack@sha256:85ee91f61be", -# "LAB_IMAGE": "ghcr.io/aiidalab/lab@sha256:4d9be090da2" -# } -# -# This json output is later turned to environment variables using fromJson() GHA builtin -# (e.g. BASE_IMAGE=ghcr.io/aiidalab/base@sha256:8e57a52b...) -# and these are in turn read in the docker-compose..yml files for tests. - -jq -c '. as $base |[to_entries[] |{"key": (.key|ascii_upcase|sub("-"; "_"; "g") + "_IMAGE"), "value": [(.value."image.name"|split(",")[0]),.value."containerimage.digest"]|join("@")}] |from_entries' $metadata_file From d916e997002383706692dbb9de7b078f3c67a825 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:22:11 +0000 Subject: [PATCH 02/22] Fix --- .github/workflows/build.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42c3a980..267c3692 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ on: outputs: images: description: Images identified by digests - value: ${{ jobs.build.outputs.images }} + value: ${{ jobs.build.steps.set-output.outputs.result }} jobs: build: @@ -74,15 +74,24 @@ jobs: .github/workflows/env.hcl - name: Set output variables + id: set-output uses: actions/github-script@v7 with: script: | - const data = JSON.parse(process.env.BAKE_METADATA,'utf-8') - for (const key in JSON.parse(process.env.BAKE_METADATA || '{}', 'utf-8')) { - if (data.hasOwnProperty(key)) { - const entry = data[key]; - core.setOutput(`${key.toUpperCase().replace(/-/g, "_")}_IMAGE`, `${entry["image.name"]}@${entry["containerimage.digest"]}`); - } + const bake_output = JSON.parse(process.env.BAKE_METADATA,'utf-8') + images = {} + for (const key in bake_output)) { + const image = bake_output[key]; + console.log(key, image); + // turn e.g. 'full-stack' to 'FULL_STACK_IMAGE' key + const image_envvar = `${key.toUpperCase().replace(/-/g, "_")}_IMAGE`; + // create full canonical path to the image using its digest, i.e. + // ghcr.io/aiidalab/base@sha256:cdad93278a... + const image_digest = `${image["image.name"]}@${image["containerimage.digest"]}`; + images[image_envvar] = image_digest; } + console.log(images); + return images; env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} + #- run: echo "images=${{steps.set-output.outputs.result}}" >> $GITHUB_ENV From 4d2a60a0944bfade6098d81c28f9110965aef295 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:24:08 +0000 Subject: [PATCH 03/22] Try smaller cache --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 267c3692..ce3a8233 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: set: | *.platform=${{ inputs.platforms }} *.output=type=registry,push-by-digest=true,name-canonical=true - *.cache-to=type=gha,scope=${{ github.workflow }},mode=max + *.cache-to=type=gha,scope=${{ github.workflow }},mode=min *.cache-from=type=gha,scope=${{ github.workflow }} files: | docker-bake.hcl From 959b2acfb10c8e923a1ebb4a98a426b64ae53b8f Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:25:46 +0000 Subject: [PATCH 04/22] Fix --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce3a8233..8fec7311 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,11 +78,12 @@ jobs: uses: actions/github-script@v7 with: script: | - const bake_output = JSON.parse(process.env.BAKE_METADATA,'utf-8') - images = {} - for (const key in bake_output)) { + const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); + images = {}; + for (const key in bake_output) { const image = bake_output[key]; - console.log(key, image); + console.log(key); + console.log(image); // turn e.g. 'full-stack' to 'FULL_STACK_IMAGE' key const image_envvar = `${key.toUpperCase().replace(/-/g, "_")}_IMAGE`; // create full canonical path to the image using its digest, i.e. From b5955f0c7e2faa807693fe787f26aac5f0b73209 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:31:48 +0000 Subject: [PATCH 05/22] Try setting outputs --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fec7311..119a9ebc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ on: outputs: images: description: Images identified by digests - value: ${{ jobs.build.steps.set-output.outputs.result }} + value: ${{ jobs.build.outputs.images }} jobs: build: @@ -95,4 +95,5 @@ jobs: return images; env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - #- run: echo "images=${{steps.set-output.outputs.result}}" >> $GITHUB_ENV + + - run: echo "images=${{ steps.set-output.outputs.result }}" >> $GITHUB_ENV From 579864c4f49f7a9ae804ea8781ceb5f772145454 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:36:16 +0000 Subject: [PATCH 06/22] Ugh --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 119a9ebc..d531b478 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,4 +96,4 @@ jobs: env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - - run: echo "images=${{ steps.set-output.outputs.result }}" >> $GITHUB_ENV + - run: echo "images=${{ steps.set-output.outputs.result }}" >> "$GITHUB_OUTPUT" From a34335a883e86f93e0081129d080964245a502c6 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:37:46 +0000 Subject: [PATCH 07/22] Revert "Try smaller cache" This reverts commit 4d2a60a0944bfade6098d81c28f9110965aef295. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d531b478..0d6a6c0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: set: | *.platform=${{ inputs.platforms }} *.output=type=registry,push-by-digest=true,name-canonical=true - *.cache-to=type=gha,scope=${{ github.workflow }},mode=min + *.cache-to=type=gha,scope=${{ github.workflow }},mode=max *.cache-from=type=gha,scope=${{ github.workflow }} files: | docker-bake.hcl From 00493c98ee469d2df321e1112a5923d7b6cfb58b Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:43:30 +0000 Subject: [PATCH 08/22] Add comment --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d6a6c0f..deb65708 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,13 +77,20 @@ jobs: id: set-output uses: actions/github-script@v7 with: + # We need to produce the following JSON string as output, + # which is then used in follow-up steps to uniquelly identified the built + # images by their digests, and not by their tags. See e.g. test.yml + # { + # "BASE_IMAGE": "ghcr.io/aiidalab/base@sha256:bc53c...", + # "BASE_WITH_SERVICES_IMAGE":"ghcr.io/aiidalab/base-with-services@sha256:0df1...", + # "FULL_STACK_IMAGE":"ghcr.io/aiidalab/full-stack@sha256:dd04...", + # "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...", + # } script: | const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); images = {}; for (const key in bake_output) { const image = bake_output[key]; - console.log(key); - console.log(image); // turn e.g. 'full-stack' to 'FULL_STACK_IMAGE' key const image_envvar = `${key.toUpperCase().replace(/-/g, "_")}_IMAGE`; // create full canonical path to the image using its digest, i.e. From 225ba4e2b4c5a23d6b0ce5f282379695b3cf1f76 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:45:27 +0000 Subject: [PATCH 09/22] Fix quotes --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index deb65708..ec7c2bd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,4 +103,4 @@ jobs: env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - - run: echo "images=${{ steps.set-output.outputs.result }}" >> "$GITHUB_OUTPUT" + - run: echo 'images=${{ steps.set-output.outputs.result }}' >> "${GITHUB_OUTPUT}" From af95a7bb0c336bba6d0707e0abc7faa95832094d Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:47:34 +0000 Subject: [PATCH 10/22] Fix comment --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec7c2bd0..c745930c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,8 +77,8 @@ jobs: id: set-output uses: actions/github-script@v7 with: - # We need to produce the following JSON string as output, - # which is then used in follow-up steps to uniquelly identified the built + # We need to produce the following JSON string from the bake action output, + # which is then used in follow-up steps to uniquelly identify the built # images by their digests, and not by their tags. See e.g. test.yml # { # "BASE_IMAGE": "ghcr.io/aiidalab/base@sha256:bc53c...", From 722f0ad33a2c8536926a75d66f92de3185b9df97 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 15:59:13 +0000 Subject: [PATCH 11/22] More quotes --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c745930c..38d5b308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,4 +103,5 @@ jobs: env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - - run: echo 'images=${{ steps.set-output.outputs.result }}' >> "${GITHUB_OUTPUT}" + - name: Set workflow output + run: echo 'images=\'${{ steps.set-output.outputs.result }}\'' >> "${GITHUB_OUTPUT}" From e549c8692a242871395c89b711c3cc364eea3226 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:09:26 +0000 Subject: [PATCH 12/22] Bloody bash quoting --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38d5b308..9a5c2f1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,4 +104,4 @@ jobs: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - name: Set workflow output - run: echo 'images=\'${{ steps.set-output.outputs.result }}\'' >> "${GITHUB_OUTPUT}" + run: echo images="'"'${{ steps.set-output.outputs.result }}'"'" >> "${GITHUB_OUTPUT}" From b759dd3159873b9874ead90e6fbfa1bd0018a2a0 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:27:55 +0000 Subject: [PATCH 13/22] Set job output --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a5c2f1b..30e05437 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: timeout-minutes: 120 outputs: - images: ${{ steps.bake_metadata.outputs.images }} + images: ${{ steps.set-output.outputs.result }} # Make sure we fail if any command in a piped command sequence fails defaults: @@ -104,4 +104,5 @@ jobs: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - name: Set workflow output + id: set-job-output run: echo images="'"'${{ steps.set-output.outputs.result }}'"'" >> "${GITHUB_OUTPUT}" From 147a8cdcb9814f94a15f91a610930bd3b98b92fe Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:32:29 +0000 Subject: [PATCH 14/22] Remove extra step --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30e05437..c80c0170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,7 +102,3 @@ jobs: return images; env: BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} - - - name: Set workflow output - id: set-job-output - run: echo images="'"'${{ steps.set-output.outputs.result }}'"'" >> "${GITHUB_OUTPUT}" From 7313517b9a0fc3ee3486814194641adf83a594b7 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:36:17 +0000 Subject: [PATCH 15/22] Bump bake-action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c80c0170..8639e768 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: id: build-upload # We need to pin exact version here, since updates can break # the extract-image-names.sh script - uses: docker/bake-action@v5.5.0 + uses: docker/bake-action@v6.3.0 with: push: true # Using provenance to disable default attestation so it will build only desired images: From 1eef2f07029e9896555bea6a0ab7abdade766f88 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:49:24 +0000 Subject: [PATCH 16/22] Sigh --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8639e768..7f7b5833 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,7 +87,9 @@ jobs: # "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...", # } script: | - const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); + //const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); + console.log(context.workflow); + const bake_output = JSON.parse(context.workflow.steps.build-upload.outputs.metadata, 'utf-8'); images = {}; for (const key in bake_output) { const image = bake_output[key]; @@ -100,5 +102,5 @@ jobs: } console.log(images); return images; - env: - BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} + #env: + # BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} From 728bb1beebe4832d67132f5c86c5ba6e65830eec Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 16:54:36 +0000 Subject: [PATCH 17/22] Huh? --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f7b5833..8aed1217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,7 +88,7 @@ jobs: # } script: | //const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); - console.log(context.workflow); + console.log(context); const bake_output = JSON.parse(context.workflow.steps.build-upload.outputs.metadata, 'utf-8'); images = {}; for (const key in bake_output) { From 0cf882241e0fd2e454791b5dd48460b4ae7ef310 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 17:01:35 +0000 Subject: [PATCH 18/22] How about this? --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8aed1217..e4c81abd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,9 +87,7 @@ jobs: # "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...", # } script: | - //const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); - console.log(context); - const bake_output = JSON.parse(context.workflow.steps.build-upload.outputs.metadata, 'utf-8'); + const bake_output = JSON.parse('${{ steps.build-upload.outputs.metadata }}', 'utf-8'); images = {}; for (const key in bake_output) { const image = bake_output[key]; From 43aaf0a1fec35560c11a56c97f1456ddc8344204 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 17:19:41 +0000 Subject: [PATCH 19/22] Get rid of Docker warnings --- stack/base/Dockerfile | 16 ++++++++-------- stack/full-stack/Dockerfile | 2 +- stack/lab/Dockerfile | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/stack/base/Dockerfile b/stack/base/Dockerfile index 00257807..dc274078 100644 --- a/stack/base/Dockerfile +++ b/stack/base/Dockerfile @@ -11,7 +11,7 @@ USER root # rsync: needed to support the new AiiDA backup command # povray: rendering engine used in aiidalab-widgets-base # bc: needed to compute the resources for computer setup -ENV EXTRA_APT_PACKAGES "curl povray rsync build-essential bc" +ENV EXTRA_APT_PACKAGES="curl povray rsync build-essential bc" # For ARM64 we need to install erlang as it is not available on conda-forge # (this is needed later as rabbitmq dependency in base-with-services image, @@ -41,7 +41,7 @@ RUN echo "notebook==$(jupyter-notebook --version)" >> /opt/requirements.txt RUN cat /opt/requirements.txt | xargs -I{} conda config --system --add pinned_packages {} # Configure pip to use the same requirements file as constraints file. -ENV PIP_CONSTRAINT /opt/requirements.txt +ENV PIP_CONSTRAINT=/opt/requirements.txt # Ensure that pip installs packages to '~/.local/lib/python3.X/site-packages/' by default # by implicitly passing the '--user' option to 'pip install' # Otherwise, pip would install into /opt/conda and such packages would be lost @@ -79,12 +79,12 @@ COPY config-quick-setup.yaml . COPY before-notebook.d/* /usr/local/bin/before-notebook.d/ # Configure AiiDA. -ENV SETUP_DEFAULT_AIIDA_PROFILE true -ENV AIIDA_PROFILE_NAME default -ENV AIIDA_USER_EMAIL aiida@localhost -ENV AIIDA_USER_FIRST_NAME Giuseppe -ENV AIIDA_USER_LAST_NAME Verdi -ENV AIIDA_USER_INSTITUTION Khedivial +ENV SETUP_DEFAULT_AIIDA_PROFILE=true +ENV AIIDA_PROFILE_NAME=default +ENV AIIDA_USER_EMAIL=aiida@localhost +ENV AIIDA_USER_FIRST_NAME=Giuseppe +ENV AIIDA_USER_LAST_NAME=Verdi +ENV AIIDA_USER_INSTITUTION=Khedivial # Install the load-singlesshagent.sh script as described here: # https://aiida.readthedocs.io/projects/aiida-core/en/v2.0.0/howto/ssh.html#starting-the-ssh-agent diff --git a/stack/full-stack/Dockerfile b/stack/full-stack/Dockerfile index 61ea23a5..530a6efc 100644 --- a/stack/full-stack/Dockerfile +++ b/stack/full-stack/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM base-with-services as base +FROM base-with-services AS base FROM lab diff --git a/stack/lab/Dockerfile b/stack/lab/Dockerfile index 3bcb97bd..1225ae22 100644 --- a/stack/lab/Dockerfile +++ b/stack/lab/Dockerfile @@ -51,9 +51,9 @@ COPY --chown=${NB_UID}:${NB_GID} gears.svg ${CONDA_DIR}/share/jupyter/nbextensio COPY before-notebook.d/* /usr/local/bin/before-notebook.d/ # Configure AiiDAlab environment. -ENV AIIDALAB_HOME /home/${NB_USER} -ENV AIIDALAB_APPS ${AIIDALAB_HOME}/apps -ENV AIIDALAB_DEFAULT_GIT_BRANCH master +ENV AIIDALAB_HOME=/home/${NB_USER} +ENV AIIDALAB_APPS=${AIIDALAB_HOME}/apps +ENV AIIDALAB_DEFAULT_GIT_BRANCH=master # Specify which apps to install in addition to the home app. The # AIIDALAB_DEFAULT_APPS variable should be a whitespace-delimited variable @@ -66,10 +66,10 @@ ENV AIIDALAB_DEFAULT_GIT_BRANCH master # Please note that multiple entries must be whitespace delimited. # Please see `aiidalab install --help` for more information. # ENV AIIDALAB_DEFAULT_APPS "aiidalab-widgets-base~=1.0" -ENV AIIDALAB_DEFAULT_APPS "" +ENV AIIDALAB_DEFAULT_APPS="" # Specify default factory reset (not set): -ENV AIIDALAB_FACTORY_RESET "" +ENV AIIDALAB_FACTORY_RESET="" USER ${NB_USER} @@ -87,7 +87,7 @@ RUN mkdir -p /home/${NB_USER}/apps # but that may come with other problems for people with flaky internet connections. # Instead, here we configure Jupyter to kill all kernels that have been alive for # more than 12 hours. We also close all inactive terminals after 10 minutes. -ENV NOTEBOOK_ARGS \ +ENV NOTEBOOK_ARGS=\ "--NotebookApp.default_url='/apps/apps/home/start.ipynb'" \ "--ContentsManager.allow_hidden=True" \ "--MappingKernelManager.buffer_offline_messages=True" \ From 802e3d5b4e6696389149fddae0a28ccbf2fbcdbd Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 17:20:56 +0000 Subject: [PATCH 20/22] Revert "How about this?" This reverts commit 0cf882241e0fd2e454791b5dd48460b4ae7ef310. --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4c81abd..8aed1217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,7 +87,9 @@ jobs: # "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...", # } script: | - const bake_output = JSON.parse('${{ steps.build-upload.outputs.metadata }}', 'utf-8'); + //const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); + console.log(context); + const bake_output = JSON.parse(context.workflow.steps.build-upload.outputs.metadata, 'utf-8'); images = {}; for (const key in bake_output) { const image = bake_output[key]; From b1b520268413fa74bdf9e18c12040d81162de807 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 17:23:13 +0000 Subject: [PATCH 21/22] Revert back to bake-action@5.5.0 --- .github/workflows/build.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8aed1217..c80c0170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: id: build-upload # We need to pin exact version here, since updates can break # the extract-image-names.sh script - uses: docker/bake-action@v6.3.0 + uses: docker/bake-action@v5.5.0 with: push: true # Using provenance to disable default attestation so it will build only desired images: @@ -87,9 +87,7 @@ jobs: # "LAB_IMAGE":"ghcr.io/aiidalab/lab@sha256:e8c7b3a662660ad20fef7...", # } script: | - //const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); - console.log(context); - const bake_output = JSON.parse(context.workflow.steps.build-upload.outputs.metadata, 'utf-8'); + const bake_output = JSON.parse(process.env.BAKE_METADATA, 'utf-8'); images = {}; for (const key in bake_output) { const image = bake_output[key]; @@ -102,5 +100,5 @@ jobs: } console.log(images); return images; - #env: - # BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} + env: + BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} From c924fc6d5fcfb223415bf981f213293a27906edb Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 4 Feb 2025 17:41:53 +0000 Subject: [PATCH 22/22] Fix? --- stack/lab/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stack/lab/Dockerfile b/stack/lab/Dockerfile index 1225ae22..22335e05 100644 --- a/stack/lab/Dockerfile +++ b/stack/lab/Dockerfile @@ -88,15 +88,15 @@ RUN mkdir -p /home/${NB_USER}/apps # Instead, here we configure Jupyter to kill all kernels that have been alive for # more than 12 hours. We also close all inactive terminals after 10 minutes. ENV NOTEBOOK_ARGS=\ - "--NotebookApp.default_url='/apps/apps/home/start.ipynb'" \ - "--ContentsManager.allow_hidden=True" \ - "--MappingKernelManager.buffer_offline_messages=True" \ - "--MappingKernelManager.cull_busy=True" \ - "--MappingKernelManager.cull_connected=True" \ - "--MappingKernelManager.cull_idle_timeout=64800" \ - "--MappingKernelManager.cull_interval=300" \ - "--TerminalManager.cull_inactive_timeout=3600" \ - "--TerminalManager.cull_interval=300" +"--NotebookApp.default_url=/apps/apps/home/start.ipynb "\ +"--ContentsManager.allow_hidden=True "\ +"--MappingKernelManager.buffer_offline_messages=True "\ +"--MappingKernelManager.cull_busy=True "\ +"--MappingKernelManager.cull_connected=True "\ +"--MappingKernelManager.cull_idle_timeout=64800 "\ +"--MappingKernelManager.cull_interval=300 "\ +"--TerminalManager.cull_inactive_timeout=3600 "\ +"--TerminalManager.cull_interval=300" # Set up the logo of notebook interface ARG PYTHON_MINOR_VERSION