From f4af5805828245157eab03f3d2244293ac904dd3 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Wed, 9 Oct 2024 23:48:26 +0200 Subject: [PATCH 001/110] feat: add initial Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..01407e2bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:24.04 +LABEL authors="Finn Hering " + +WORKDIR /app +COPY . /app + +RUN apt-get -y update && apt-get -y upgrade +RUN apt-get -y install \ + git \ + python3 \ + meson \ + ninja-build \ + libglib2.0-dev \ + libbson-dev \ + libfabric-dev \ + libfuse3-dev \ + libgdbm-dev \ + libleveldb-dev \ + libmongoc-dev \ + librados-dev \ + liblmdb-dev \ + libmariadb-dev \ + librocksdb-dev \ + libsqlite3-dev + +RUN meson setup --prefix="${HOME}/julea-install" -Db_sanitize=address,undefined bld +RUN ninja -C bld + +# Copy all created executables to /usr/bin +RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file From 532dd06850e937a29bf503d872dc27dbe83ff7f4 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 10 Oct 2024 00:02:03 +0200 Subject: [PATCH 002/110] build: change containers to create julea-prebuild containers scheduled build is also disabled to prevent excessive CI build times --- .github/workflows/containers.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index f31e450c1..1f94504df 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -19,24 +19,18 @@ on: push: branches: - master - paths: - - '.github/workflows/containers.yml' - - 'containers/*' pull_request: branches: - master - paths: - - '.github/workflows/containers.yml' - - 'containers/*' - schedule: - - cron: '0 0 * * 0' +# schedule: +# - cron: '0 0 * * 0' jobs: - ubuntu-dev: - name: Ubuntu Development Container + julea-prebuild-container: + name: JULEA Prebuild Container runs-on: ubuntu-24.04 permissions: packages: write - timeout-minutes: 60 + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v4 @@ -53,7 +47,7 @@ jobs: - name: Build and Push to GitHub Container Registry uses: docker/build-push-action@v5 with: - context: containers - file: containers/ubuntu-22.04-dev + context: . + file: Dockerfile push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/parcio/ubuntu-dev:22.04 + tags: ghcr.io/parcio/julea-prebuilt:latest From 0f5ba21a0f33c2acac911a7593ca7e33876ea0a6 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 10 Oct 2024 00:08:25 +0200 Subject: [PATCH 003/110] build: add workflow_dispatch trigger for container builds --- .github/workflows/containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 1f94504df..909dd4da9 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -16,6 +16,7 @@ name: Containers on: + workflow_dispatch: push: branches: - master From 5be511964d1abcd23b9d810a5582a82a5ebe1877 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 10 Oct 2024 00:19:54 +0200 Subject: [PATCH 004/110] build: add Docker meta step for better tagging/labeling of docker images --- .github/workflows/containers.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 909dd4da9..21a39c15b 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -45,10 +45,21 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + flavor: | + latest=auto + images: | + ghcr.io/FinnHering/julea-prebuilt + tags: | + type=sha - name: Build and Push to GitHub Container Registry uses: docker/build-push-action@v5 with: context: . file: Dockerfile push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/parcio/julea-prebuilt:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 55a08bed1b6545820e08018363449b51bede55c2 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 10 Oct 2024 00:27:57 +0200 Subject: [PATCH 005/110] build(fix): also create latest tag everytime the image is build in the default branch --- .github/workflows/containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 21a39c15b..c5a7b6b60 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -55,6 +55,7 @@ jobs: ghcr.io/FinnHering/julea-prebuilt tags: | type=sha + type=raw,value=latest,enable={{is_default_branch}} - name: Build and Push to GitHub Container Registry uses: docker/build-push-action@v5 with: From bb168ade7657e6df3340c24f7bdb998f5407a139 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 18 Oct 2024 23:47:32 +0200 Subject: [PATCH 006/110] chore: use matrix to build containers for multiple platforms --- .github/workflows/containers.yml | 60 ++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index c5a7b6b60..3a9b97a40 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -26,9 +26,15 @@ on: # schedule: # - cron: '0 0 * * 0' jobs: - julea-prebuild-container: - name: JULEA Prebuild Container + julea-build-container: + name: Build Julea Containers runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm64 permissions: packages: write timeout-minutes: 10 @@ -38,13 +44,10 @@ jobs: with: persist-credentials: false show-progress: false - - name: Login to GitHub Container Registry - if: ${{ github.event_name != 'pull_request' }} - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -61,6 +64,43 @@ jobs: with: context: . file: Dockerfile - push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + + + merge: + name: Publish Julea Containers + runs-on: ubuntu-latest + needs: + - julea-build-container + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + + - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) From fbbe051d38e337d1f8736b1a193e1435b48039ca Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 18 Oct 2024 23:52:09 +0200 Subject: [PATCH 007/110] fix(ci): add missing steps in container build step --- .github/workflows/containers.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 3a9b97a40..7a27c5632 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -60,6 +60,7 @@ jobs: type=sha type=raw,value=latest,enable={{is_default_branch}} - name: Build and Push to GitHub Container Registry + id: build uses: docker/build-push-action@v5 with: context: . @@ -68,6 +69,20 @@ jobs: labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + merge: name: Publish Julea Containers From dd96aa24cb8445dbbd9b0587ba119ff43cc9d7c9 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 18 Oct 2024 23:55:55 +0200 Subject: [PATCH 008/110] fix(ci): bump docker/build-push-action to v6 --- .github/workflows/containers.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 7a27c5632..336ad7653 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -61,10 +61,8 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - name: Build and Push to GitHub Container Registry id: build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - context: . - file: Dockerfile tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true From a4f257274ff8c3710acd2672a9fb2889c7b9d4b8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:00:45 +0200 Subject: [PATCH 009/110] fix(ci): add env variable --- .github/workflows/containers.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 336ad7653..89c2eb9a9 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -25,6 +25,10 @@ on: - master # schedule: # - cron: '0 0 * * 0' + +env: + REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuilt + jobs: julea-build-container: name: Build Julea Containers @@ -55,7 +59,7 @@ jobs: flavor: | latest=auto images: | - ghcr.io/FinnHering/julea-prebuilt + {{ env.REGISTRY_IMAGE }} tags: | type=sha type=raw,value=latest,enable={{is_default_branch}} From 09da695212969ff563afe17ac6b68e7bbc7cf6ed Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:02:44 +0200 Subject: [PATCH 010/110] fix(ci): reference variable properly --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 89c2eb9a9..6a7672a21 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -59,7 +59,7 @@ jobs: flavor: | latest=auto images: | - {{ env.REGISTRY_IMAGE }} + ${{ env.REGISTRY_IMAGE }} tags: | type=sha type=raw,value=latest,enable={{is_default_branch}} From 9cfd3274f4ce5fa399723a18905c0fe88d085c4d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:08:47 +0200 Subject: [PATCH 011/110] fix(ci): move tags/flavor to merge step --- .github/workflows/containers.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 6a7672a21..3ae13451d 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -56,18 +56,12 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - flavor: | - latest=auto images: | ${{ env.REGISTRY_IMAGE }} - tags: | - type=sha - type=raw,value=latest,enable={{is_default_branch}} - name: Build and Push to GitHub Container Registry id: build uses: docker/build-push-action@v6 with: - tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true @@ -107,6 +101,11 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} + flavor: | + latest=auto + tags: | + type=sha + type=raw,value=latest,enable={{is_default_branch}} - name: Login to GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} From c16d33e621a0c59bb2e1540bc57261e3b4a76fd7 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:11:36 +0200 Subject: [PATCH 012/110] fix(ci): add login to ghcr to build step --- .github/workflows/containers.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 3ae13451d..a292c1dc9 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -58,6 +58,13 @@ jobs: with: images: | ${{ env.REGISTRY_IMAGE }} + - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push to GitHub Container Registry id: build uses: docker/build-push-action@v6 From 093a0e8a65144838f4ebe82a4eae684a2a03ae9b Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:15:00 +0200 Subject: [PATCH 013/110] fix(ci): add missing prep step --- .github/workflows/containers.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index a292c1dc9..d201845cd 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -43,6 +43,13 @@ jobs: packages: write timeout-minutes: 10 steps: + - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v4 with: From 975cddd8b8d62831a4b92d5d66df33937be83749 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:15:29 +0200 Subject: [PATCH 014/110] Revert "fix(ci): add missing prep step" This reverts commit 093a0e8a65144838f4ebe82a4eae684a2a03ae9b. --- .github/workflows/containers.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index d201845cd..a292c1dc9 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -43,13 +43,6 @@ jobs: packages: write timeout-minutes: 10 steps: - - name: Login to GitHub Container Registry - if: ${{ github.event_name != 'pull_request' }} - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v4 with: From 1b5097238a50cde53241343347090e6248c2ed2c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 00:15:37 +0200 Subject: [PATCH 015/110] fix(ci): add missing prep step --- .github/workflows/containers.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index a292c1dc9..9fc80fc3b 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -43,6 +43,10 @@ jobs: packages: write timeout-minutes: 10 steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 with: From 723aa0bf424d71c18f5294a0fc0f45f65ea3327d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:24:01 +0200 Subject: [PATCH 016/110] ci: switch to docker bake for image building --- .dockerignore | 0 .github/workflows/containers.yml | 105 +++++++------------------------ Dockerfile | 5 +- docker-bake.hcl | 36 +++++++++++ 4 files changed, 61 insertions(+), 85 deletions(-) create mode 100644 .dockerignore create mode 100644 docker-bake.hcl diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 9fc80fc3b..d97adc1bc 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -30,38 +30,33 @@ env: REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuilt jobs: - julea-build-container: + + prepare: + runs-on: ubuntu-latest + outputs: + targets: ${{ steps.generate.outputs.targets }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: List targets + uses: docker/bake-action/subaction/list-targets@v4 + with: + target: ci + + build-containesr: name: Build Julea Containers - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + needs: + - prepare strategy: fail-fast: false matrix: - platform: - - linux/amd64 - - linux/arm64 + target: ${{ fromJson(needs.prepare.outputs.targets) }} permissions: packages: write - timeout-minutes: 10 steps: - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 - with: - persist-credentials: false - show-progress: false - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.REGISTRY_IMAGE }} - name: Login to GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 @@ -69,65 +64,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and Push to GitHub Container Registry - id: build - uses: docker/build-push-action@v6 - with: - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - - merge: - name: Publish Julea Containers - runs-on: ubuntu-latest - needs: - - julea-build-container - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - flavor: | - latest=auto - tags: | - type=sha - type=raw,value=latest,enable={{is_default_branch}} - - - name: Login to GitHub Container Registry - if: ${{ github.event_name != 'pull_request' }} - uses: docker/login-action@v3 + - name: Validate + uses: docker/bake-action@v5 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + targets: ${{ matrix.target }} diff --git a/Dockerfile b/Dockerfile index 01407e2bf..2927d4520 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -FROM ubuntu:24.04 +ARG BASE_IMAGE=ubuntu:24.04 +FROM $BASE_IMAGE LABEL authors="Finn Hering " WORKDIR /app COPY . /app +ENV DEBIAN_FRONTEND=noninteractive + RUN apt-get -y update && apt-get -y upgrade RUN apt-get -y install \ git \ diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 000000000..c50b8af0a --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,36 @@ +target "docker-metadata-action" {} + +variable "BASE_TAG" { + default = "ghcr.io/finnhering/julea-prebuilt" +} + + +// Using ubuntu lts version +target "ci" { + name="julea-ubuntu-${versions}-04-${platforms}" + inherits = ["docker-metadata-action"] + matrix={ + versions=["24", "22"] + platforms=["amd64", "arm64"] + } + args = { + BASE_IMAGE = "ubuntu:${versions}.04" + } + tags = ["${BASE_TAG}:ubuntu-${versions}.04"] + platforms=["linux/${platforms}"] +} + + + +// Using image notation +// target "ci" { +// name="julea-${regex_replace(base_images, "\\W", "-")}" +// inherits = ["docker-metadata-action", "platforms"] +// matrix={ +// base_images=["ubuntu:24.04", "ubuntu:22.04"] +// } +// args = { +// BASE_IMAGE = "${base_images}" +// } +// tags = ["${BASE_TAG}:${replace(base_images, ":", "-")}"] +// } \ No newline at end of file From 9fe3ed9bdd67d806e7101b8bdbd3050b8f8028da Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:25:30 +0200 Subject: [PATCH 017/110] fix: add generate --- .github/workflows/containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index d97adc1bc..4373485d6 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -39,6 +39,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: List targets + id: generate uses: docker/bake-action/subaction/list-targets@v4 with: target: ci From 966617aabf5536e16e3068a7ebb361c21b69ee73 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:28:48 +0200 Subject: [PATCH 018/110] fix: add buildx/qemu --- .github/workflows/containers.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 4373485d6..642383d82 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -65,6 +65,10 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Validate uses: docker/bake-action@v5 with: From 5a4e98a0162526db7a67fb70bb53c34e27e908b5 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:31:48 +0200 Subject: [PATCH 019/110] ci: push images --- .github/workflows/containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 642383d82..49a49d788 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -73,3 +73,4 @@ jobs: uses: docker/bake-action@v5 with: targets: ${{ matrix.target }} + push: true From 8f5d98b17dde5f7d1739b486ba5b51038e83ccd2 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:46:55 +0200 Subject: [PATCH 020/110] remove platform from matrix --- docker-bake.hcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index c50b8af0a..c77d284c0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -5,19 +5,20 @@ variable "BASE_TAG" { } + + // Using ubuntu lts version target "ci" { name="julea-ubuntu-${versions}-04-${platforms}" inherits = ["docker-metadata-action"] matrix={ versions=["24", "22"] - platforms=["amd64", "arm64"] } args = { BASE_IMAGE = "ubuntu:${versions}.04" } tags = ["${BASE_TAG}:ubuntu-${versions}.04"] - platforms=["linux/${platforms}"] + platforms=["linux/arm64", "linux/amd64"] } From 5783820ecc3a17f63c36c374393544eb5ef4d4c7 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 19 Oct 2024 17:52:18 +0200 Subject: [PATCH 021/110] fix: remove platforms variable reference --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index c77d284c0..972b7fc1a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -9,7 +9,7 @@ variable "BASE_TAG" { // Using ubuntu lts version target "ci" { - name="julea-ubuntu-${versions}-04-${platforms}" + name="julea-ubuntu-${versions}-04" inherits = ["docker-metadata-action"] matrix={ versions=["24", "22"] From afb343e89066a0765268a0bd3f3d3f410d79c595 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 01:13:01 +0200 Subject: [PATCH 022/110] chore: created docker build/bake system for creation of all required images --- Dockerfile | 99 ++++++++++++++++++++++++++++++++++++++++--------- docker-bake.hcl | 64 +++++++++++++++++--------------- 2 files changed, 117 insertions(+), 46 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2927d4520..a6534f43c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,98 @@ -ARG BASE_IMAGE=ubuntu:24.04 -FROM $BASE_IMAGE -LABEL authors="Finn Hering " +ARG UBUNTU_VERSION="24.04" +ARG JULEA_SPACK_COMPILER="gcc" +ARG CC="gcc" -WORKDIR /app -COPY . /app -ENV DEBIAN_FRONTEND=noninteractive +FROM ubuntu:${UBUNTU_VERSION} AS base +SHELL [ "/bin/bash", "-c" ] +ARG UBUNTU_VERSION="24.04" +ARG JULEA_SPACK_COMPILER="gcc" +ARG CC="gcc" +##################################################### +# Julea build using system dependencies # +##################################################### +FROM base AS julea_system -RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install \ - git \ +# Some scripts require bash to work properly... +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \ + bash \ python3 \ - meson \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + build-essential \ ninja-build \ + pkgconf \ libglib2.0-dev \ libbson-dev \ libfabric-dev \ - libfuse3-dev \ libgdbm-dev \ + liblmdb-dev \ + libsqlite3-dev \ libleveldb-dev \ libmongoc-dev \ - librados-dev \ - liblmdb-dev \ libmariadb-dev \ librocksdb-dev \ - libsqlite3-dev + libfuse3-dev \ + libopen-trace-format-dev \ + librados-dev \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + clang + + +RUN echo UBUNTU_VERSION: $UBUNTU_VERSION +# Install meson from pip if the version is less than 22.04 +RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi + + +WORKDIR /app +COPY . /app/ + +RUN pwd +RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=release --werror bld && \ + ninja -C bld && \ + ninja -C bld install + +##################################################### +# Julea build using spack # +##################################################### +FROM base AS spack_dependencies +WORKDIR /app + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ + git \ + python3 \ + build-essential \ + zstd \ + ca-certificates \ + git \ + gnupg \ + patchelf \ + unzip \ + clang + +COPY ./scripts/ /app/scripts/ + +RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh + + +FROM base AS julea_spack +WORKDIR /app + +COPY ./ /app/ +COPY --from=spack_dependencies /app/dependencies /app/dependencies + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential + +RUN CC=${CC} . /app/scripts/environment.sh && \ + meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + ninja -C bld && \ + ninja -C bld install -RUN meson setup --prefix="${HOME}/julea-install" -Db_sanitize=address,undefined bld -RUN ninja -C bld # Copy all created executables to /usr/bin -RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file +#RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file diff --git a/docker-bake.hcl b/docker-bake.hcl index 972b7fc1a..a329a71fd 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,37 +1,43 @@ -target "docker-metadata-action" {} +target "docker-metadata-action" { + platforms = ["linux/amd64"] +} variable "BASE_TAG" { default = "ghcr.io/finnhering/julea-prebuilt" } - - - -// Using ubuntu lts version -target "ci" { - name="julea-ubuntu-${versions}-04" - inherits = ["docker-metadata-action"] - matrix={ - versions=["24", "22"] - } - args = { - BASE_IMAGE = "ubuntu:${versions}.04" - } - tags = ["${BASE_TAG}:ubuntu-${versions}.04"] - platforms=["linux/arm64", "linux/amd64"] +group "ubuntu" { + targets = ["ubuntu-spack", "ubuntu-system"] } +target "ubuntu-spack" { + name = "julea-ubuntu-spack-${compilers}-${versions}-04" + inherits = ["docker-metadata-action"] + matrix = { + versions = ["24", "22"] + compilers = ["gcc", "clang"] + } + args = { + UBUNTU_VERSION = "${versions}.04" + JULEA_SPACK_COMPILER = compilers + CC = compilers + } + tags = ["${BASE_TAG}:ubuntu-spack-${compilers}-${versions}.04"] + target = "julea_spack" +} - -// Using image notation -// target "ci" { -// name="julea-${regex_replace(base_images, "\\W", "-")}" -// inherits = ["docker-metadata-action", "platforms"] -// matrix={ -// base_images=["ubuntu:24.04", "ubuntu:22.04"] -// } -// args = { -// BASE_IMAGE = "${base_images}" -// } -// tags = ["${BASE_TAG}:${replace(base_images, ":", "-")}"] -// } \ No newline at end of file +target "ubuntu-system" { + name = "julea-ubuntu-system-${compilers}-${versions}-04" + inherits = ["docker-metadata-action"] + matrix = { + versions = ["24", "22"] + compilers = ["gcc", "clang"] + } + args = { + UBUNTU_VERSION = "${versions}.04" + JULEA_SPACK_COMPILER = compilers + CC = compilers + } + tags = ["${BASE_TAG}:ubuntu-system-${compilers}-${versions}.04"] + target = "julea_system" +} \ No newline at end of file From 1d9d0aa9fd9e8bd6ba9ecfcd12e7d1d3e133a68d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 01:14:20 +0200 Subject: [PATCH 023/110] fix: target name changed --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 49a49d788..92b2d139e 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -42,7 +42,7 @@ jobs: id: generate uses: docker/bake-action/subaction/list-targets@v4 with: - target: ci + target: ubuntu build-containesr: name: Build Julea Containers From 47af160abd9122e2daf37f53082678ee6f12f736 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 01:25:14 +0200 Subject: [PATCH 024/110] fix: add missing dependency clang --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a6534f43c..4b80a3e43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,7 +86,7 @@ WORKDIR /app COPY ./ /app/ COPY --from=spack_dependencies /app/dependencies /app/dependencies -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ From f81ff92e20bde64c09f8ae377572837e1888f7e8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 02:09:55 +0200 Subject: [PATCH 025/110] chore: enable layer cache --- .github/workflows/containers.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 92b2d139e..c26b696a3 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -74,3 +74,5 @@ jobs: with: targets: ${{ matrix.target }} push: true + cache-from: type=gha + cache-to: type=gha,mode=max From 87976a6e6121d81f875beae2e3717e24087a3224 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 02:15:13 +0200 Subject: [PATCH 026/110] fix: use proper way to set caching --- .github/workflows/containers.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index c26b696a3..89183c595 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -74,5 +74,6 @@ jobs: with: targets: ${{ matrix.target }} push: true - cache-from: type=gha - cache-to: type=gha,mode=max + set: | + *.cache-from=type=gha + *.cache-to=type=gha,mode=max From 59fd106fd08273e080d78c35e3d2789808aff149 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 21:29:46 +0200 Subject: [PATCH 027/110] chore: change name of docker tag --- .dockerignore | 3 +++ docker-bake.hcl | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index e69de29bb..84a9229ae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -0,0 +1,3 @@ +/dependencies +Dockerfile* +docker-bake* diff --git a/docker-bake.hcl b/docker-bake.hcl index a329a71fd..2b83affc9 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -11,7 +11,7 @@ group "ubuntu" { } target "ubuntu-spack" { - name = "julea-ubuntu-spack-${compilers}-${versions}-04" + name = "julea-ubuntu-${versions}-04-spack-${compilers}" inherits = ["docker-metadata-action"] matrix = { versions = ["24", "22"] @@ -22,12 +22,12 @@ target "ubuntu-spack" { JULEA_SPACK_COMPILER = compilers CC = compilers } - tags = ["${BASE_TAG}:ubuntu-spack-${compilers}-${versions}.04"] + tags = ["${BASE_TAG}:ubuntu-${versions}.04-spack-${compilers}"] target = "julea_spack" } target "ubuntu-system" { - name = "julea-ubuntu-system-${compilers}-${versions}-04" + name = "julea-ubuntu-${versions}-04-system-${compilers}" inherits = ["docker-metadata-action"] matrix = { versions = ["24", "22"] @@ -38,6 +38,6 @@ target "ubuntu-system" { JULEA_SPACK_COMPILER = compilers CC = compilers } - tags = ["${BASE_TAG}:ubuntu-system-${compilers}-${versions}.04"] + tags = ["${BASE_TAG}:ubuntu-${versions}.04-system-${compilers}"] target = "julea_system" } \ No newline at end of file From 0f2bdc11e573331d925212d9de58f58ceb43085f Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 21:34:43 +0200 Subject: [PATCH 028/110] fix: enable caching workaround. see: https://github.com/docker/bake-action/issues/36 --- .github/workflows/containers.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 89183c595..685d4d9ef 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -69,7 +69,9 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Validate + - name: Enable GHA cache + uses: crazy-max/ghaction-github-runtime@v1 + - name: Build and Push uses: docker/bake-action@v5 with: targets: ${{ matrix.target }} From 90f1d5a0ba5d8b89e082906f0b016baa843429b2 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 21:38:17 +0200 Subject: [PATCH 029/110] chore: bump action version --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 685d4d9ef..7ca7e22b9 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -70,7 +70,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Enable GHA cache - uses: crazy-max/ghaction-github-runtime@v1 + uses: crazy-max/ghaction-github-runtime@v3 - name: Build and Push uses: docker/bake-action@v5 with: From ccaff7bf627ed4bcc2f0e3beb8b5ee5034f7f6b1 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 21:58:32 +0200 Subject: [PATCH 030/110] chore: use registry caching as gha caching is broken see: https://github.com/docker/build-push-action/issues/829 --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 7ca7e22b9..72bffad4c 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -77,5 +77,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from=type=gha - *.cache-to=type=gha,mode=max + *.cache-from= type=registry,ref=ghcr.io/org/${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} + *.cache-to= type=registry,ref=ghcr.io/org/${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}, mode=max From e558171dffcd85dc3a5062487aa453bbc5ca0cca Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 21:58:55 +0200 Subject: [PATCH 031/110] fix: remove redundant action step --- .github/workflows/containers.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 72bffad4c..48f59fa72 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -69,8 +69,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Enable GHA cache - uses: crazy-max/ghaction-github-runtime@v3 - name: Build and Push uses: docker/bake-action@v5 with: From 4199d8ed7e8ac914c84b2dcada2ba8c73afc5d36 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:00:39 +0200 Subject: [PATCH 032/110] fix: broken image tag --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 48f59fa72..bd85fa4e8 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from= type=registry,ref=ghcr.io/org/${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} - *.cache-to= type=registry,ref=ghcr.io/org/${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}, mode=max + *.cache-from= type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} + *.cache-to= type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}, mode=max From 4e1e5e62ad72789fdfdd781a145f68a4f78a973d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:04:14 +0200 Subject: [PATCH 033/110] fix: ref must be quoted --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index bd85fa4e8..059b6a624 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from= type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} - *.cache-to= type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}, mode=max + *.cache-from= type=registry,ref="${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}" + *.cache-to= type=registry,ref="${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}", mode=max From 24d183bd22bc58e79b716b684232dbfa7414e9ec Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:09:16 +0200 Subject: [PATCH 034/110] fix: remove quotes and whitespace --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 059b6a624..adca38f7c 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from= type=registry,ref="${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}" - *.cache-to= type=registry,ref="${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }}", mode=max + *.cache-from=type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} + *.cache-to=type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }},mode=max From 092b2d9e3a211f3a64a47f7fbc4b365209951181 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:11:19 +0200 Subject: [PATCH 035/110] chore: use specific container name for caching --- .github/workflows/containers.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index adca38f7c..8b7d4a23d 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -27,7 +27,7 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuilt + REGISTRY_CACHE_IMAGE: ghcr.io/finnhering/julea-buildcache jobs: @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from=type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }} - *.cache-to=type=registry,ref=${{env.REGISTRY_IMAGE}}:buildcache-${{ matrix.target }},mode=max + *.cache-from=type=registry,ref=${{env.REGISTRY_CACHE_IMAGE}}:${{ matrix.target }} + *.cache-to=type=registry,ref=${{env.REGISTRY_CACHE_IMAGE}}:${{ matrix.target }},mode=max From 6b925653bc181fb63acc7219bd74359cb2b62bf7 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:13:02 +0200 Subject: [PATCH 036/110] chore: use previous builds as cache --- .github/workflows/containers.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 8b7d4a23d..a2e21c60f 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -27,7 +27,7 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_CACHE_IMAGE: ghcr.io/finnhering/julea-buildcache + REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuild jobs: @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from=type=registry,ref=${{env.REGISTRY_CACHE_IMAGE}}:${{ matrix.target }} - *.cache-to=type=registry,ref=${{env.REGISTRY_CACHE_IMAGE}}:${{ matrix.target }},mode=max + *.cache-from=type=registry,ref=${{env.REGISTRY_IMAGE}}:${{ matrix.target }} + *.cache-to=type=registry,ref=${{env.REGISTRY_IMAGE}}:${{ matrix.target }},mode=max From 3294e369ebc01be2aa43aec09e0e1a681d5c36a0 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:15:43 +0200 Subject: [PATCH 037/110] chore: change tag to be the same as the target name --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 2b83affc9..e512ff752 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -22,7 +22,7 @@ target "ubuntu-spack" { JULEA_SPACK_COMPILER = compilers CC = compilers } - tags = ["${BASE_TAG}:ubuntu-${versions}.04-spack-${compilers}"] + tags = ["${BASE_TAG}:ubuntu-${versions}-04-spack-${compilers}"] target = "julea_spack" } @@ -38,6 +38,6 @@ target "ubuntu-system" { JULEA_SPACK_COMPILER = compilers CC = compilers } - tags = ["${BASE_TAG}:ubuntu-${versions}.04-system-${compilers}"] + tags = ["${BASE_TAG}:ubuntu-${versions}-04-system-${compilers}"] target = "julea_system" } \ No newline at end of file From 7bc1b94b954d922f94dd43ee9f84e15310a92fa8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:21:32 +0200 Subject: [PATCH 038/110] fix: image name --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index a2e21c60f..52fa7b72b 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -27,7 +27,7 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuild + REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuilt jobs: From becb78956ac35ae478e58b91ba17899e251c9bfd Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:29:09 +0200 Subject: [PATCH 039/110] chore: switch back to gha cache --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 52fa7b72b..89c6b1f08 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from=type=registry,ref=${{env.REGISTRY_IMAGE}}:${{ matrix.target }} - *.cache-to=type=registry,ref=${{env.REGISTRY_IMAGE}}:${{ matrix.target }},mode=max + *.cache-from=type=gha + *.cache-to=type=gha,mode=max From 9b0e91a7faef75f327a310a8f7c3c99eb927a928 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:48:07 +0200 Subject: [PATCH 040/110] fix: improve .dockerignore --- .dockerignore | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 84a9229ae..2591195c3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,6 @@ -/dependencies -Dockerfile* -docker-bake* +# Dependencies folder is not needed in the image (it will be rebuild in there) +dependencies + +# Git(-hub) specific +.git +.github \ No newline at end of file From d20bff1aa09acb0c4023ca1baa8356780ca7696b Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 21 Oct 2024 22:54:59 +0200 Subject: [PATCH 041/110] fix: use scope for hashing --- .github/workflows/containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 89c6b1f08..e1cc8c1ea 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -75,5 +75,5 @@ jobs: targets: ${{ matrix.target }} push: true set: | - *.cache-from=type=gha - *.cache-to=type=gha,mode=max + *.cache-from=type=gha,scope=${{ matrix.target }} + *.cache-to=type=gha,mode=max,scope=${{ matrix.target }} From 18ece74877257ca08cd93beb5a21b07c2328f454 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 00:58:43 +0200 Subject: [PATCH 042/110] chore: rework bake file --- .github/workflows/containers.yml | 3 - Dockerfile | 98 -------------------------------- Dockerfile.spack | 46 +++++++++++++++ Dockerfile.system | 56 ++++++++++++++++++ docker-bake.hcl | 77 +++++++++++++++++++++---- 5 files changed, 167 insertions(+), 113 deletions(-) delete mode 100644 Dockerfile create mode 100644 Dockerfile.spack create mode 100644 Dockerfile.system diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index e1cc8c1ea..4438a2e41 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -74,6 +74,3 @@ jobs: with: targets: ${{ matrix.target }} push: true - set: | - *.cache-from=type=gha,scope=${{ matrix.target }} - *.cache-to=type=gha,mode=max,scope=${{ matrix.target }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4b80a3e43..000000000 --- a/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -ARG UBUNTU_VERSION="24.04" -ARG JULEA_SPACK_COMPILER="gcc" -ARG CC="gcc" - - -FROM ubuntu:${UBUNTU_VERSION} AS base -SHELL [ "/bin/bash", "-c" ] -ARG UBUNTU_VERSION="24.04" -ARG JULEA_SPACK_COMPILER="gcc" -ARG CC="gcc" -##################################################### -# Julea build using system dependencies # -##################################################### -FROM base AS julea_system - -# Some scripts require bash to work properly... -RUN DEBIAN_FRONTEND=noninteractive apt-get update -RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \ - bash \ - python3 \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - build-essential \ - ninja-build \ - pkgconf \ - libglib2.0-dev \ - libbson-dev \ - libfabric-dev \ - libgdbm-dev \ - liblmdb-dev \ - libsqlite3-dev \ - libleveldb-dev \ - libmongoc-dev \ - libmariadb-dev \ - librocksdb-dev \ - libfuse3-dev \ - libopen-trace-format-dev \ - librados-dev \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - clang - - -RUN echo UBUNTU_VERSION: $UBUNTU_VERSION -# Install meson from pip if the version is less than 22.04 -RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi - - -WORKDIR /app -COPY . /app/ - -RUN pwd -RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=release --werror bld && \ - ninja -C bld && \ - ninja -C bld install - -##################################################### -# Julea build using spack # -##################################################### -FROM base AS spack_dependencies -WORKDIR /app - -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ - git \ - python3 \ - build-essential \ - zstd \ - ca-certificates \ - git \ - gnupg \ - patchelf \ - unzip \ - clang - -COPY ./scripts/ /app/scripts/ - -RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh - - -FROM base AS julea_spack -WORKDIR /app - -COPY ./ /app/ -COPY --from=spack_dependencies /app/dependencies /app/dependencies - -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang - -RUN CC=${CC} . /app/scripts/environment.sh && \ - meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ - ninja -C bld && \ - ninja -C bld install - - -# Copy all created executables to /usr/bin -#RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file diff --git a/Dockerfile.spack b/Dockerfile.spack new file mode 100644 index 000000000..49b6b917d --- /dev/null +++ b/Dockerfile.spack @@ -0,0 +1,46 @@ +ARG UBUNTU_VERSION="24.04" + +FROM ubuntu:${UBUNTU_VERSION} AS base +SHELL [ "/bin/bash", "-c" ] +ARG JULEA_SPACK_COMPILER="gcc" +ARG CC="gcc" +##################################################### +# Julea build using spack # +##################################################### +FROM base AS julea_dependencies +WORKDIR /app + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ + git \ + python3 \ + build-essential \ + zstd \ + ca-certificates \ + git \ + gnupg \ + patchelf \ + unzip \ + clang + +COPY ./scripts/ /app/scripts/ + +RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh + + +FROM base AS julea +WORKDIR /app + +COPY ./ /app/ +COPY --from=spack_dependencies /app/dependencies /app/dependencies + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang + +RUN CC=${CC} . /app/scripts/environment.sh && \ + meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + ninja -C bld && \ + ninja -C bld install + + +# Copy all created executables to /usr/bin +#RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file diff --git a/Dockerfile.system b/Dockerfile.system new file mode 100644 index 000000000..2e6824aa9 --- /dev/null +++ b/Dockerfile.system @@ -0,0 +1,56 @@ +ARG UBUNTU_VERSION="24.04" +ARG CC="gcc" + + +FROM ubuntu:${UBUNTU_VERSION} AS julea_dependencies +SHELL [ "/bin/bash", "-c" ] +ARG UBUNTU_VERSION="24.04" +ARG CC="gcc" + +# Some scripts require bash to work properly... +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \ + bash \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + build-essential \ + ninja-build \ + pkgconf \ + libglib2.0-dev \ + libbson-dev \ + libfabric-dev \ + libgdbm-dev \ + liblmdb-dev \ + libsqlite3-dev \ + libleveldb-dev \ + libmongoc-dev \ + libmariadb-dev \ + librocksdb-dev \ + libfuse3-dev \ + libopen-trace-format-dev \ + librados-dev \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + clang + + +RUN echo UBUNTU_VERSION: $UBUNTU_VERSION +# Install meson from pip if the version is less than 22.04 +RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi + + +##################################################### +# Julea build using system dependencies # +##################################################### +FROM base AS julea + +WORKDIR /app +COPY . /app/ + +RUN pwd +RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=release --werror bld && \ + ninja -C bld && \ + ninja -C bld install \ No newline at end of file diff --git a/docker-bake.hcl b/docker-bake.hcl index e512ff752..fcab3a0e2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -7,37 +7,90 @@ variable "BASE_TAG" { } group "ubuntu" { - targets = ["ubuntu-spack", "ubuntu-system"] + targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest"] } +# Target build docker images with prebuild julea + dependencies using spack method target "ubuntu-spack" { - name = "julea-ubuntu-${versions}-04-spack-${compilers}" + name = "julea-ubuntu-${versions}-04-spack-${compilers}-${targets}" inherits = ["docker-metadata-action"] matrix = { - versions = ["24", "22"] + versions = ["24", "22", "20"] compilers = ["gcc", "clang"] + targets = ["julea", "julea_dependencies"] } args = { UBUNTU_VERSION = "${versions}.04" JULEA_SPACK_COMPILER = compilers CC = compilers } - tags = ["${BASE_TAG}:ubuntu-${versions}-04-spack-${compilers}"] - target = "julea_spack" + + # Add -dependencies to the tag if the target is julea_dependencies + tags = ["${BASE_TAG}-spack${targets == "julea_dependencies" ? "-dependencies": ""}:ubuntu-${versions}-04-${compilers}"] + target = "julea" + dockerfile = "Dockerfile.spack" + cache-from = [ + "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" + ] + cache-to = [ + "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" + ] } +# Target build docker images with prebuild julea + dependencies using system method target "ubuntu-system" { - name = "julea-ubuntu-${versions}-04-system-${compilers}" + name = "julea-ubuntu-${versions}-04-system-${compilers}-${targets}" inherits = ["docker-metadata-action"] matrix = { versions = ["24", "22"] compilers = ["gcc", "clang"] + targets = ["julea", "julea_dependencies"] } args = { - UBUNTU_VERSION = "${versions}.04" - JULEA_SPACK_COMPILER = compilers - CC = compilers + UBUNTU_VERSION = "${versions}.04" + CC = compilers } - tags = ["${BASE_TAG}:ubuntu-${versions}-04-system-${compilers}"] - target = "julea_system" -} \ No newline at end of file + tags = ["${BASE_TAG}-system${targets == "julea_dependencies" ? "-dependencies": ""}:ubuntu-${versions}-04-${compilers}"] + target = "julea" + dockerfile = "Dockerfile.system" + + cache-from = [ + "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" + ] + cache-to = [ + "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" + ] +} + +# Build latest image +target "ubuntu-latest" { + inherits = ["docker-metadata-action"] + args = { + UBUNTU_VERSION = "24.04" + CC = "gcc" + } + tags = ["${BASE_TAG}:ubuntu-latest"] + target = "julea_spack" + dockerfile = "Dockerfile.system" + + cache-from = [ + "type=gha,scope=julea-ubuntu-24-04-spack-gcc" + ] + cache-to = [ + "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" + ] +} + +// # Build dependencies spack +// target "ubuntu-dependencies" { +// inherits = ["ubuntu-spack"] +// target = "julea_dependencies" +// tags = ["${BASE_TAG}-spack-dependencies:ubuntu-${versions}-04-${compilers}"] +// } + +// # Build dependencies system +// target "ubuntu-dependencies" { +// inherits = ["ubuntu-system"] +// target = "julea_dependencies" +// tags = ["${BASE_TAG}-system-dependencies:ubuntu-${versions}-04-${compilers}"] +// } \ No newline at end of file From 96e6060e545605654393ab325d4efc6cee115849 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:00:33 +0200 Subject: [PATCH 043/110] fix: specify correct stage name --- Dockerfile.spack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 49b6b917d..4f1e22648 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -32,7 +32,7 @@ FROM base AS julea WORKDIR /app COPY ./ /app/ -COPY --from=spack_dependencies /app/dependencies /app/dependencies +COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang From d3241cbfdbdd14b1af648bee4c37b24037dfdc9d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:02:04 +0200 Subject: [PATCH 044/110] fix: use correct reference --- Dockerfile.system | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.system b/Dockerfile.system index 2e6824aa9..68726d8e7 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -45,7 +45,7 @@ RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing wi ##################################################### # Julea build using system dependencies # ##################################################### -FROM base AS julea +FROM julea_dependencies AS julea WORKDIR /app COPY . /app/ From f14d4a8cbad240fbffa77993967877a8d1f9b5e1 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:03:47 +0200 Subject: [PATCH 045/110] fix: target name --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index fcab3a0e2..287465df5 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -70,7 +70,7 @@ target "ubuntu-latest" { CC = "gcc" } tags = ["${BASE_TAG}:ubuntu-latest"] - target = "julea_spack" + target = "julea" dockerfile = "Dockerfile.system" cache-from = [ From c8e7f79f04b56f2a6a3822116d01fdd852383e2d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:31:34 +0200 Subject: [PATCH 046/110] Revert "fix: specify correct stage name" This reverts commit 96e6060e545605654393ab325d4efc6cee115849. --- Dockerfile.spack | 2 +- Dockerfile.system | 2 +- docker-bake.hcl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 4f1e22648..49b6b917d 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -32,7 +32,7 @@ FROM base AS julea WORKDIR /app COPY ./ /app/ -COPY --from=julea_dependencies /app/dependencies /app/dependencies +COPY --from=spack_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang diff --git a/Dockerfile.system b/Dockerfile.system index 68726d8e7..2e6824aa9 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -45,7 +45,7 @@ RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing wi ##################################################### # Julea build using system dependencies # ##################################################### -FROM julea_dependencies AS julea +FROM base AS julea WORKDIR /app COPY . /app/ diff --git a/docker-bake.hcl b/docker-bake.hcl index 287465df5..fcab3a0e2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -70,7 +70,7 @@ target "ubuntu-latest" { CC = "gcc" } tags = ["${BASE_TAG}:ubuntu-latest"] - target = "julea" + target = "julea_spack" dockerfile = "Dockerfile.system" cache-from = [ From 310bd735d1756f33f9bc00c10d8e1ffd01ae2f1c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:33:16 +0200 Subject: [PATCH 047/110] Reapply "fix: specify correct stage name" This reverts commit c8e7f79f04b56f2a6a3822116d01fdd852383e2d. --- Dockerfile.spack | 2 +- Dockerfile.system | 2 +- docker-bake.hcl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 49b6b917d..4f1e22648 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -32,7 +32,7 @@ FROM base AS julea WORKDIR /app COPY ./ /app/ -COPY --from=spack_dependencies /app/dependencies /app/dependencies +COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang diff --git a/Dockerfile.system b/Dockerfile.system index 2e6824aa9..68726d8e7 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -45,7 +45,7 @@ RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing wi ##################################################### # Julea build using system dependencies # ##################################################### -FROM base AS julea +FROM julea_dependencies AS julea WORKDIR /app COPY . /app/ diff --git a/docker-bake.hcl b/docker-bake.hcl index fcab3a0e2..287465df5 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -70,7 +70,7 @@ target "ubuntu-latest" { CC = "gcc" } tags = ["${BASE_TAG}:ubuntu-latest"] - target = "julea_spack" + target = "julea" dockerfile = "Dockerfile.system" cache-from = [ From fab2864c4a08e6f81dd5d5205a05fbc6dc5d444e Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:34:31 +0200 Subject: [PATCH 048/110] chore: remove target --- docker-bake.hcl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 287465df5..90b10f9f4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -12,12 +12,11 @@ group "ubuntu" { # Target build docker images with prebuild julea + dependencies using spack method target "ubuntu-spack" { - name = "julea-ubuntu-${versions}-04-spack-${compilers}-${targets}" + name = "julea-ubuntu-${versions}-04-spack-${compilers}" inherits = ["docker-metadata-action"] matrix = { versions = ["24", "22", "20"] compilers = ["gcc", "clang"] - targets = ["julea", "julea_dependencies"] } args = { UBUNTU_VERSION = "${versions}.04" @@ -26,7 +25,7 @@ target "ubuntu-spack" { } # Add -dependencies to the tag if the target is julea_dependencies - tags = ["${BASE_TAG}-spack${targets == "julea_dependencies" ? "-dependencies": ""}:ubuntu-${versions}-04-${compilers}"] + tags = ["${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}"] target = "julea" dockerfile = "Dockerfile.spack" cache-from = [ @@ -39,18 +38,17 @@ target "ubuntu-spack" { # Target build docker images with prebuild julea + dependencies using system method target "ubuntu-system" { - name = "julea-ubuntu-${versions}-04-system-${compilers}-${targets}" + name = "julea-ubuntu-${versions}-04-system-${compilers}" inherits = ["docker-metadata-action"] matrix = { versions = ["24", "22"] compilers = ["gcc", "clang"] - targets = ["julea", "julea_dependencies"] } args = { UBUNTU_VERSION = "${versions}.04" CC = compilers } - tags = ["${BASE_TAG}-system${targets == "julea_dependencies" ? "-dependencies": ""}:ubuntu-${versions}-04-${compilers}"] + tags = ["${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}"] target = "julea" dockerfile = "Dockerfile.system" From 66858987ed7a60a4048a8e52714b172fccf834f1 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:50:49 +0200 Subject: [PATCH 049/110] fix: latest; add dev-container image --- docker-bake.hcl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 90b10f9f4..7fef62d32 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -67,7 +67,7 @@ target "ubuntu-latest" { UBUNTU_VERSION = "24.04" CC = "gcc" } - tags = ["${BASE_TAG}:ubuntu-latest"] + tags = ["${BASE_TAG}:latest"] target = "julea" dockerfile = "Dockerfile.system" @@ -79,6 +79,24 @@ target "ubuntu-latest" { ] } +target "ubuntu-dev-container" { + inherits = ["docker-metadata-action"] + args = { + UBUNTU_VERSION = "24.04" + CC = "gcc" + } + tags = ["${BASE_TAG}-dev-container:latest"] + target = "julea_dependencies" + dockerfile = "Dockerfile.spack" + + cache-from = [ + "type=gha,scope=julea-ubuntu-24-04-spack-gcc" + ] + cache-to = [ + "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" + ] +} + // # Build dependencies spack // target "ubuntu-dependencies" { // inherits = ["ubuntu-spack"] From b2ef549962b01bcb772d7877d2041da473e079cc Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 01:59:45 +0200 Subject: [PATCH 050/110] fix: update dockerignore to increase build speed --- .dockerignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 2591195c3..3f312c8e3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,8 @@ dependencies # Git(-hub) specific .git -.github \ No newline at end of file +.github + +# Ignore Docker related things +Dockerfile* +docker-* \ No newline at end of file From 8ef6bba38fa3813006db58bed1fc4b2330c1e663 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 22 Oct 2024 02:07:31 +0200 Subject: [PATCH 051/110] add dev container target --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 7fef62d32..ce1065b44 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -3,11 +3,11 @@ target "docker-metadata-action" { } variable "BASE_TAG" { - default = "ghcr.io/finnhering/julea-prebuilt" + default = "ghcr.io/finnhering/julea" } group "ubuntu" { - targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest"] + targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest", "ubuntu-dev-container"] } # Target build docker images with prebuild julea + dependencies using spack method From 3d7201693c6b268843d9cadc4484f7e41319c31f Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Wed, 23 Oct 2024 02:12:58 +0200 Subject: [PATCH 052/110] chore: add arm64 platform --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index ce1065b44..7bc5da031 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ target "docker-metadata-action" { - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } variable "BASE_TAG" { From 78a546050e90a79b37a3c6aa6186302d95e98f35 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Wed, 23 Oct 2024 02:17:36 +0200 Subject: [PATCH 053/110] chore: remove system build cache --- docker-bake.hcl | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 7bc5da031..a1f0da89b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -52,12 +52,14 @@ target "ubuntu-system" { target = "julea" dockerfile = "Dockerfile.system" - cache-from = [ - "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" - ] - cache-to = [ - "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" - ] + + // Dont cache system builds as they build fast enough anyway + // cache-from = [ + // "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" + // ] + // cache-to = [ + // "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" + // ] } # Build latest image @@ -71,12 +73,14 @@ target "ubuntu-latest" { target = "julea" dockerfile = "Dockerfile.system" - cache-from = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc" - ] - cache-to = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" - ] + + // Dont cache system builds as they build fast enough anyway + // cache-from = [ + // "type=gha,scope=julea-ubuntu-24-04-spack-gcc" + // ] + // cache-to = [ + // "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" + // ] } target "ubuntu-dev-container" { From 421b6740c9aca5a5f5a7b8cd52957dfdf3a8285c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 00:04:52 +0200 Subject: [PATCH 054/110] chore: only target arm64 on devcontainer --- docker-bake.hcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index a1f0da89b..e3f5a69ad 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ target "docker-metadata-action" { - platforms = ["linux/amd64", "linux/arm64"] + platforms = ["linux/amd64"] } variable "BASE_TAG" { @@ -93,6 +93,8 @@ target "ubuntu-dev-container" { target = "julea_dependencies" dockerfile = "Dockerfile.spack" + platforms = [ "linux/amd64", "linux/arm64" ] + cache-from = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc" ] From 165152f93f0e5852e16d6b96d1b8ea2849164c5c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 22:29:59 +0200 Subject: [PATCH 055/110] chore: allow for cross compilation --- Dockerfile.spack | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 4f1e22648..4b9c89fed 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -1,9 +1,13 @@ ARG UBUNTU_VERSION="24.04" +ARG BUILDPLATFORM -FROM ubuntu:${UBUNTU_VERSION} AS base + +FROM --platform=${BUILDPLATFORM} ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" +ARG TARGETPLATFORM + ##################################################### # Julea build using spack # ##################################################### @@ -36,7 +40,7 @@ COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang -RUN CC=${CC} . /app/scripts/environment.sh && \ +RUN TARGETPLATFORM=${TARGETPLATFORM} CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install From 332a9282d13d53c2507e661b04d7e392474360b6 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 22:41:05 +0200 Subject: [PATCH 056/110] fix: use targetarch, remove bad ARCH call --- Dockerfile.spack | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 4b9c89fed..d247f58da 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -1,12 +1,11 @@ ARG UBUNTU_VERSION="24.04" -ARG BUILDPLATFORM FROM --platform=${BUILDPLATFORM} ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" -ARG TARGETPLATFORM +ARG BUILDARCH ##################################################### # Julea build using spack # @@ -40,7 +39,7 @@ COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang -RUN TARGETPLATFORM=${TARGETPLATFORM} CC=${CC} . /app/scripts/environment.sh && \ +RUN BUILDARCH=${BUILDARCH} CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install From 4fe9314b0469c48b5b4f39c88459cb64aa0a1b30 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 22:47:07 +0200 Subject: [PATCH 057/110] fix: variable assignment --- .devcontainer/devcontainer.json | 7 +++++++ = | 0 Dockerfile.spack | 2 +- create_builder.sh | 11 +++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 = create mode 100755 create_builder.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..2895d5fb5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "Julea Dev Container", + "image": "ghcr.io/finnhering/julea-dev-container:latest", + "containerEnv": { + "JULEA_SPACK_DIR": "/app/dependencies" + } +}. \ No newline at end of file diff --git a/= b/= new file mode 100644 index 000000000..e69de29bb diff --git a/Dockerfile.spack b/Dockerfile.spack index d247f58da..55668a783 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -31,7 +31,7 @@ COPY ./scripts/ /app/scripts/ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh -FROM base AS julea +FROM --platform=$TARGETPLATFORM base AS julea WORKDIR /app COPY ./ /app/ diff --git a/create_builder.sh b/create_builder.sh new file mode 100755 index 000000000..274f3c87a --- /dev/null +++ b/create_builder.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +docker buildx rm local_remote_builder || echo "" + + + +echo "creating..." + +docker buildx create --name local_remote_builder --node local_remote_build --platform linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/mips64le,linux/mips64,linux/arm/v8,linux/arm/v7,linux/arm/v6 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000 + +docker buildx create --name local_remote_builder --append --node intelarch --platform linux/amd64,linux/386 'ssh://finn@35.208.102.154' --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000 From 752a23fe6191d917cf479ebbee7755ba09d73275 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 22:58:54 +0200 Subject: [PATCH 058/110] fix: use TARGETARCH instead of BUILDARCH --- Dockerfile.spack | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 55668a783..53f422875 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -5,7 +5,7 @@ FROM --platform=${BUILDPLATFORM} ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" -ARG BUILDARCH +ARG TARGETARCH ##################################################### # Julea build using spack # @@ -39,7 +39,7 @@ COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang -RUN BUILDARCH=${BUILDARCH} CC=${CC} . /app/scripts/environment.sh && \ +RUN TARGETARCH=${TARGETARCH} CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install From 7b87c29bda0dfe8db7214b1c368df829a9786fb8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 23:11:26 +0200 Subject: [PATCH 059/110] fix: install aarch64 buildtools --- Dockerfile.spack | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 53f422875..dcbdbb137 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -24,14 +24,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ gnupg \ patchelf \ unzip \ - clang + clang \ + gcc-aarch64-linux-gnu \ + binutils-aarch64-linux-gnu COPY ./scripts/ /app/scripts/ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh -FROM --platform=$TARGETPLATFORM base AS julea +FROM base AS julea WORKDIR /app COPY ./ /app/ From 0eabedba742fca33d5371d5dee4367b2e04f1ed0 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 23:26:03 +0200 Subject: [PATCH 060/110] switch to clang for cross compilation --- Dockerfile.spack | 4 +--- docker-bake.hcl | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index dcbdbb137..a8e32f38f 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -24,9 +24,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ gnupg \ patchelf \ unzip \ - clang \ - gcc-aarch64-linux-gnu \ - binutils-aarch64-linux-gnu + clang COPY ./scripts/ /app/scripts/ diff --git a/docker-bake.hcl b/docker-bake.hcl index e3f5a69ad..1fbb7ba09 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -87,7 +87,8 @@ target "ubuntu-dev-container" { inherits = ["docker-metadata-action"] args = { UBUNTU_VERSION = "24.04" - CC = "gcc" + CC = "clang" + JULEA_SPACK_COMPILER = "clang" } tags = ["${BASE_TAG}-dev-container:latest"] target = "julea_dependencies" @@ -96,10 +97,10 @@ target "ubuntu-dev-container" { platforms = [ "linux/amd64", "linux/arm64" ] cache-from = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc" + "type=gha,scope=julea-ubuntu-24-04-spack-clang" ] cache-to = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" + "type=gha,scope=julea-ubuntu-24-04-spack-clang,mode=max" ] } From 5b5cf5bf40a4d02de2b06eccd262b30cc233bec8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 23:45:35 +0200 Subject: [PATCH 061/110] Revert "chore: allow for cross compilation" This reverts commit 165152f93f0e5852e16d6b96d1b8ea2849164c5c. --- .devcontainer/devcontainer.json | 7 ------- = | 0 Dockerfile.spack | 9 +++------ create_builder.sh | 11 ----------- docker-bake.hcl | 7 +++---- 5 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 = delete mode 100755 create_builder.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 2895d5fb5..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "Julea Dev Container", - "image": "ghcr.io/finnhering/julea-dev-container:latest", - "containerEnv": { - "JULEA_SPACK_DIR": "/app/dependencies" - } -}. \ No newline at end of file diff --git a/= b/= deleted file mode 100644 index e69de29bb..000000000 diff --git a/Dockerfile.spack b/Dockerfile.spack index a8e32f38f..4f1e22648 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -1,12 +1,9 @@ ARG UBUNTU_VERSION="24.04" - -FROM --platform=${BUILDPLATFORM} ubuntu:${UBUNTU_VERSION} AS base +FROM ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" -ARG TARGETARCH - ##################################################### # Julea build using spack # ##################################################### @@ -24,7 +21,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ gnupg \ patchelf \ unzip \ - clang + clang COPY ./scripts/ /app/scripts/ @@ -39,7 +36,7 @@ COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang -RUN TARGETARCH=${TARGETARCH} CC=${CC} . /app/scripts/environment.sh && \ +RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install diff --git a/create_builder.sh b/create_builder.sh deleted file mode 100755 index 274f3c87a..000000000 --- a/create_builder.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -docker buildx rm local_remote_builder || echo "" - - - -echo "creating..." - -docker buildx create --name local_remote_builder --node local_remote_build --platform linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/mips64le,linux/mips64,linux/arm/v8,linux/arm/v7,linux/arm/v6 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000 - -docker buildx create --name local_remote_builder --append --node intelarch --platform linux/amd64,linux/386 'ssh://finn@35.208.102.154' --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000 diff --git a/docker-bake.hcl b/docker-bake.hcl index 1fbb7ba09..e3f5a69ad 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -87,8 +87,7 @@ target "ubuntu-dev-container" { inherits = ["docker-metadata-action"] args = { UBUNTU_VERSION = "24.04" - CC = "clang" - JULEA_SPACK_COMPILER = "clang" + CC = "gcc" } tags = ["${BASE_TAG}-dev-container:latest"] target = "julea_dependencies" @@ -97,10 +96,10 @@ target "ubuntu-dev-container" { platforms = [ "linux/amd64", "linux/arm64" ] cache-from = [ - "type=gha,scope=julea-ubuntu-24-04-spack-clang" + "type=gha,scope=julea-ubuntu-24-04-spack-gcc" ] cache-to = [ - "type=gha,scope=julea-ubuntu-24-04-spack-clang,mode=max" + "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" ] } From e55b2bccb6554c7dfc54f1cfabfbd3e5c4f56904 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 24 Oct 2024 23:47:07 +0200 Subject: [PATCH 062/110] fix: remove arm64 platform because of slow buildtimes --- docker-bake.hcl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index e3f5a69ad..6b572fdbd 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -92,9 +92,7 @@ target "ubuntu-dev-container" { tags = ["${BASE_TAG}-dev-container:latest"] target = "julea_dependencies" dockerfile = "Dockerfile.spack" - - platforms = [ "linux/amd64", "linux/arm64" ] - + cache-from = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc" ] From 9697faa37ca16cd076c0e80a140e70343f127c46 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 00:15:22 +0200 Subject: [PATCH 063/110] chore: pass base_tag and commit_hash variables to bakefile --- .github/workflows/containers.yml | 19 ++++++++++++++++++- docker-bake.hcl | 14 +++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 4438a2e41..5a9d6b2b5 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -27,7 +27,7 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_IMAGE: ghcr.io/finnhering/julea-prebuilt + REGISTRY_IMAGE: ghcr.io/finnhering/julea jobs: @@ -69,8 +69,25 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + REGISTRY_IMAGE + tags: | + type=sha + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - name: Build and Push uses: docker/bake-action@v5 + env: + COMMIT_SHA: ${{ github.sha }} + BASE_TAG: ${{ env.BASE_TAG}} with: + targets: ${{ matrix.target }} push: true + files: | + ./docker-bake.hcl + ${{ steps.meta.outputs.bake-file }} diff --git a/docker-bake.hcl b/docker-bake.hcl index 6b572fdbd..0ae0d98b3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -6,6 +6,10 @@ variable "BASE_TAG" { default = "ghcr.io/finnhering/julea" } +variable "COMMIT_SHA" { + default = "UNKNOWN" +} + group "ubuntu" { targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest", "ubuntu-dev-container"] } @@ -25,7 +29,7 @@ target "ubuntu-spack" { } # Add -dependencies to the tag if the target is julea_dependencies - tags = ["${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}"] + tags = ["${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}", "${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.spack" cache-from = [ @@ -48,7 +52,7 @@ target "ubuntu-system" { UBUNTU_VERSION = "${versions}.04" CC = compilers } - tags = ["${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}"] + tags = ["${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}", "${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.system" @@ -69,7 +73,7 @@ target "ubuntu-latest" { UBUNTU_VERSION = "24.04" CC = "gcc" } - tags = ["${BASE_TAG}:latest"] + tags = ["${BASE_TAG}:latest", "{BASE_TAG}:latest-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.system" @@ -89,10 +93,10 @@ target "ubuntu-dev-container" { UBUNTU_VERSION = "24.04" CC = "gcc" } - tags = ["${BASE_TAG}-dev-container:latest"] + tags = ["${BASE_TAG}-dev-container:latest", "${BASE_TAG}-dev-container:latest-${COMMIT_SHA}"] target = "julea_dependencies" dockerfile = "Dockerfile.spack" - + cache-from = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc" ] From 48d55dc85f787c5a685512479dfb02ea26a7cd44 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 00:16:42 +0200 Subject: [PATCH 064/110] fix: pass proper variable for base_tag --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 5a9d6b2b5..63432d2eb 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -83,7 +83,7 @@ jobs: uses: docker/bake-action@v5 env: COMMIT_SHA: ${{ github.sha }} - BASE_TAG: ${{ env.BASE_TAG}} + BASE_TAG: ${{ env.REGISTRY_IMAGE }} with: targets: ${{ matrix.target }} From 4b89f31b2324d90ce1c8d4619b1662ede921db40 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 00:18:38 +0200 Subject: [PATCH 065/110] fix: typo --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 0ae0d98b3..43f38ddd0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -73,7 +73,7 @@ target "ubuntu-latest" { UBUNTU_VERSION = "24.04" CC = "gcc" } - tags = ["${BASE_TAG}:latest", "{BASE_TAG}:latest-${COMMIT_SHA}"] + tags = ["${BASE_TAG}:latest", "${BASE_TAG}:latest-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.system" From 2fb74ac953a263981968358c4e67d63beeeff1a2 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 00:32:11 +0200 Subject: [PATCH 066/110] ci: move to containers --- .github/workflows/containers.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 63432d2eb..6816a9706 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -20,9 +20,10 @@ on: push: branches: - master - pull_request: - branches: - - master + # pull_request: + # branches: + # - master + workflow_call: # schedule: # - cron: '0 0 * * 0' From e96fdbf51fa586f0dc2c63f9d944868cd407a049 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 01:47:59 +0200 Subject: [PATCH 067/110] fix: remove duplicate compiler concat --- Dockerfile.spack | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 4f1e22648..9b1ddfb50 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -4,6 +4,7 @@ FROM ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" +ARG BUILDTYPE="release" ##################################################### # Julea build using spack # ##################################################### @@ -37,7 +38,7 @@ COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang RUN CC=${CC} . /app/scripts/environment.sh && \ - meson setup --prefix="/app/julea-install" --buildtype=release --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install From 4be667736ce594cb067a83095442e68090360f4c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 01:51:42 +0200 Subject: [PATCH 068/110] chore: make buildtype dynamic --- Dockerfile.system | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.system b/Dockerfile.system index 68726d8e7..4684ca727 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -6,6 +6,7 @@ FROM ubuntu:${UBUNTU_VERSION} AS julea_dependencies SHELL [ "/bin/bash", "-c" ] ARG UBUNTU_VERSION="24.04" ARG CC="gcc" +ARG BUILDTYPE="release" # Some scripts require bash to work properly... RUN DEBIAN_FRONTEND=noninteractive apt-get update @@ -51,6 +52,6 @@ WORKDIR /app COPY . /app/ RUN pwd -RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=release --werror bld && \ +RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror bld && \ ninja -C bld && \ ninja -C bld install \ No newline at end of file From 3799e023b4c1851a0ccb915d0526dfd373e66984 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 25 Oct 2024 06:47:40 +0000 Subject: [PATCH 069/110] chore: add devcontainer --- .devcontainer/devcontainer.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..3c001dfcb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "Julea Dev Container", + "image": "ghcr.io/finnhering/julea-dev-container:latest", + "containerEnv": { + "JULEA_SPACK_DIR": "/app/dependencies" + } +} \ No newline at end of file From de788819456049eec78185a83ed0aa78ee2712ce Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sun, 12 Jan 2025 16:32:36 +0000 Subject: [PATCH 070/110] update --- Dockerfile.system | 70 ++++++++++++++++++++++------------------------- docker-bake.hcl | 34 +---------------------- 2 files changed, 33 insertions(+), 71 deletions(-) diff --git a/Dockerfile.system b/Dockerfile.system index 4684ca727..b703d1ea9 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -2,56 +2,50 @@ ARG UBUNTU_VERSION="24.04" ARG CC="gcc" +# Stage 0 FROM ubuntu:${UBUNTU_VERSION} AS julea_dependencies SHELL [ "/bin/bash", "-c" ] ARG UBUNTU_VERSION="24.04" ARG CC="gcc" ARG BUILDTYPE="release" -# Some scripts require bash to work properly... -RUN DEBIAN_FRONTEND=noninteractive apt-get update -RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \ - bash \ - python3 \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - build-essential \ - ninja-build \ - pkgconf \ - libglib2.0-dev \ - libbson-dev \ - libfabric-dev \ - libgdbm-dev \ - liblmdb-dev \ - libsqlite3-dev \ - libleveldb-dev \ - libmongoc-dev \ - libmariadb-dev \ - librocksdb-dev \ - libfuse3-dev \ - libopen-trace-format-dev \ - librados-dev \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - clang +# Stage 1-2.1b +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ + bash \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + build-essential \ + ninja-build \ + pkgconf \ + libglib2.0-dev \ + libbson-dev \ + libfabric-dev \ + libgdbm-dev \ + liblmdb-dev \ + libsqlite3-dev \ + libleveldb-dev \ + libmongoc-dev \ + libmariadb-dev \ + librocksdb-dev \ + libfuse3-dev \ + libopen-trace-format-dev \ + librados-dev \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + clang \ + # Install meson with pip if Ubuntu Version is older than 22.04. Otherwise use apt + && if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi - -RUN echo UBUNTU_VERSION: $UBUNTU_VERSION -# Install meson from pip if the version is less than 22.04 -RUN if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi - - -##################################################### -# Julea build using system dependencies # -##################################################### FROM julea_dependencies AS julea WORKDIR /app COPY . /app/ -RUN pwd +# Stage 2.3b RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror bld && \ ninja -C bld && \ ninja -C bld install \ No newline at end of file diff --git a/docker-bake.hcl b/docker-bake.hcl index 43f38ddd0..f08da9d3c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -55,15 +55,6 @@ target "ubuntu-system" { tags = ["${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}", "${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.system" - - - // Dont cache system builds as they build fast enough anyway - // cache-from = [ - // "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" - // ] - // cache-to = [ - // "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" - // ] } # Build latest image @@ -76,15 +67,6 @@ target "ubuntu-latest" { tags = ["${BASE_TAG}:latest", "${BASE_TAG}:latest-${COMMIT_SHA}"] target = "julea" dockerfile = "Dockerfile.system" - - - // Dont cache system builds as they build fast enough anyway - // cache-from = [ - // "type=gha,scope=julea-ubuntu-24-04-spack-gcc" - // ] - // cache-to = [ - // "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" - // ] } target "ubuntu-dev-container" { @@ -103,18 +85,4 @@ target "ubuntu-dev-container" { cache-to = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" ] -} - -// # Build dependencies spack -// target "ubuntu-dependencies" { -// inherits = ["ubuntu-spack"] -// target = "julea_dependencies" -// tags = ["${BASE_TAG}-spack-dependencies:ubuntu-${versions}-04-${compilers}"] -// } - -// # Build dependencies system -// target "ubuntu-dependencies" { -// inherits = ["ubuntu-system"] -// target = "julea_dependencies" -// tags = ["${BASE_TAG}-system-dependencies:ubuntu-${versions}-04-${compilers}"] -// } \ No newline at end of file +} \ No newline at end of file From 08eae41738bd7e5b6148ef07dc945f8f504a6f04 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 27 Jan 2025 17:41:18 +0100 Subject: [PATCH 071/110] fix: build julea in separate stage --- Dockerfile.spack | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 9b1ddfb50..4e55127ed 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -8,7 +8,7 @@ ARG BUILDTYPE="release" ##################################################### # Julea build using spack # ##################################################### -FROM base AS julea_dependencies +FROM base AS julea_build WORKDIR /app RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade @@ -24,18 +24,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ unzip \ clang -COPY ./scripts/ /app/scripts/ - -RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh - - -FROM base AS julea -WORKDIR /app - COPY ./ /app/ -COPY --from=julea_dependencies /app/dependencies /app/dependencies -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install python3 build-essential clang +RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ @@ -43,5 +34,10 @@ RUN CC=${CC} . /app/scripts/environment.sh && \ ninja -C bld install -# Copy all created executables to /usr/bin -#RUN find ./bld -maxdepth 1 ! -name '*.*' -type f -exec cp {} /usr/bin ";" \ No newline at end of file + +FROM base AS julea +WORKDIR /app + +COPY --from=julea_build /app/julea-install /app/julea-install +COPY --from=julea_build /app/dependencies /app/dependencies +COPY --from=julea_build /app/scripts/ /app/scripts/ \ No newline at end of file From 6f54e6a6ba8be190a435b2c240c6fa7d2f54a9de Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 27 Jan 2025 17:42:36 +0100 Subject: [PATCH 072/110] fix --- Dockerfile.spack | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 4e55127ed..511734403 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -8,7 +8,7 @@ ARG BUILDTYPE="release" ##################################################### # Julea build using spack # ##################################################### -FROM base AS julea_build +FROM base AS julea_dependencies WORKDIR /app RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade @@ -24,10 +24,14 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ unzip \ clang -COPY ./ /app/ +COPY ./scripts/ /app/scripts RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh + +FROM base as julea_build +COPY ./ /app + RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ @@ -40,4 +44,4 @@ WORKDIR /app COPY --from=julea_build /app/julea-install /app/julea-install COPY --from=julea_build /app/dependencies /app/dependencies -COPY --from=julea_build /app/scripts/ /app/scripts/ \ No newline at end of file +COPY ./scripts/ /app/scripts/ \ No newline at end of file From ed367b071391e9ee83bc55a1b28a54a14de3ccd0 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 27 Jan 2025 17:54:38 +0100 Subject: [PATCH 073/110] fix: add missing copy --- Dockerfile.spack | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.spack b/Dockerfile.spack index 511734403..b4b675792 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -31,6 +31,7 @@ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependenc FROM base as julea_build COPY ./ /app +COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ From f44910af6841db41dc011af7c21664de92f45129 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 27 Jan 2025 20:53:51 +0100 Subject: [PATCH 074/110] fix: install missing deps --- Dockerfile.spack | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index b4b675792..aafcf9c42 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -11,8 +11,8 @@ ARG BUILDTYPE="release" FROM base AS julea_dependencies WORKDIR /app -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ +RUN DEBIAN_FRONTEND=noninteractive +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install \ git \ python3 \ build-essential \ @@ -33,6 +33,8 @@ FROM base as julea_build COPY ./ /app COPY --from=julea_dependencies /app/dependencies /app/dependencies +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 + RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ From c42e768ef705156bd978d7d9ae80e6b0e3b14fff Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 11 Feb 2025 18:50:10 +0100 Subject: [PATCH 075/110] chore: refactor dockerfile --- Dockerfile.spack | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index aafcf9c42..168e6cd13 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -25,23 +25,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && ap clang COPY ./scripts/ /app/scripts - RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh -FROM base as julea_build +FROM base AS julea_build + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 build-essential clang + COPY ./ /app COPY --from=julea_dependencies /app/dependencies /app/dependencies -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 - RUN CC=${CC} . /app/scripts/environment.sh && \ meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install - FROM base AS julea WORKDIR /app From d34fb900ac280c424bb78b02c06c80cca6aa8366 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 11 Feb 2025 18:53:05 +0100 Subject: [PATCH 076/110] fix: remove sensless RUN --- Dockerfile.spack | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 168e6cd13..3d1c6f219 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -11,7 +11,6 @@ ARG BUILDTYPE="release" FROM base AS julea_dependencies WORKDIR /app -RUN DEBIAN_FRONTEND=noninteractive RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install \ git \ python3 \ From dc154d144ed4dce4b32a47b65a2681ea4d57e117 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 11 Feb 2025 22:18:47 +0100 Subject: [PATCH 077/110] fix: add workdir --- Dockerfile.spack | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.spack b/Dockerfile.spack index 3d1c6f219..03a5fc0b4 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -30,6 +30,7 @@ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependenc FROM base AS julea_build RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 build-essential clang +WORKDIR /app COPY ./ /app COPY --from=julea_dependencies /app/dependencies /app/dependencies From 9744369868633fd92676ee589e7a4971933f0f4b Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 11 Feb 2025 23:16:24 +0100 Subject: [PATCH 078/110] fix: add missing runntime dep python3 --- Dockerfile.spack | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.spack b/Dockerfile.spack index 03a5fc0b4..cf8d01a58 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -44,6 +44,8 @@ RUN CC=${CC} . /app/scripts/environment.sh && \ FROM base AS julea WORKDIR /app +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 + COPY --from=julea_build /app/julea-install /app/julea-install COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ \ No newline at end of file From 2c960c5d200a4e6db70a1feee76ca1fdbe1b47f6 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 11 Feb 2025 23:20:55 +0100 Subject: [PATCH 079/110] fix: change prefix --- Dockerfile.spack | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index cf8d01a58..44ab965a9 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -36,7 +36,7 @@ COPY ./ /app COPY --from=julea_dependencies /app/dependencies /app/dependencies RUN CC=${CC} . /app/scripts/environment.sh && \ - meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + meson setup --prefix="/usr" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ ninja -C bld install @@ -46,6 +46,6 @@ WORKDIR /app RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 -COPY --from=julea_build /app/julea-install /app/julea-install +COPY --from=julea_build /usr/ /usr/ COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ \ No newline at end of file From a58bc61ffb615534d6c658461dd2b2a434634c1e Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Wed, 12 Feb 2025 00:14:35 +0100 Subject: [PATCH 080/110] feat: split runntime deps from build-deps --- Dockerfile.system | 51 ++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/Dockerfile.system b/Dockerfile.system index b703d1ea9..6dc7a4af2 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -3,13 +3,32 @@ ARG CC="gcc" # Stage 0 -FROM ubuntu:${UBUNTU_VERSION} AS julea_dependencies +FROM ubuntu:${UBUNTU_VERSION} AS julea_runtime_dependencies SHELL [ "/bin/bash", "-c" ] ARG UBUNTU_VERSION="24.04" ARG CC="gcc" ARG BUILDTYPE="release" # Stage 1-2.1b +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ + libglib2.0-dev \ + libbson-dev \ + libfabric-dev \ + libgdbm-dev \ + liblmdb-dev \ + libsqlite3-dev \ + libleveldb-dev \ + libmongoc-dev \ + libmariadb-dev \ + librocksdb-dev \ + libfuse3-dev \ + libopen-trace-format-dev \ + librados-dev + + +FROM julea_runtime_dependencies AS julea_dependencies + RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ bash \ @@ -20,32 +39,28 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ build-essential \ ninja-build \ pkgconf \ - libglib2.0-dev \ - libbson-dev \ - libfabric-dev \ - libgdbm-dev \ - liblmdb-dev \ - libsqlite3-dev \ - libleveldb-dev \ - libmongoc-dev \ - libmariadb-dev \ - librocksdb-dev \ - libfuse3-dev \ - libopen-trace-format-dev \ - librados-dev \ python3-pip \ python3-setuptools \ python3-wheel \ - clang \ + clang \ # Install meson with pip if Ubuntu Version is older than 22.04. Otherwise use apt && if awk "BEGIN {exit !($UBUNTU_VERSION >= 22.04)}" ; then echo "installing with apt..." && apt-get --yes install meson ; else pip install meson ; fi -FROM julea_dependencies AS julea +FROM julea_dependencies AS julea_build WORKDIR /app COPY . /app/ # Stage 2.3b -RUN CC=${CC} . /app/scripts/environment.sh && meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror bld && \ +RUN . /app/scripts/environment.sh && \ + CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror --prefix="/usr" bld && \ ninja -C bld && \ - ninja -C bld install \ No newline at end of file + DESTDIR=/app/julea-install/ ninja -C bld install + + +FROM julea_runtime_dependencies AS julea +WORKDIR /app + +COPY --from=julea_build /app/julea-install/ / +# Required for ld to detect the added libraries +RUN ldconfig From 72ce87c9ff144b3de8951d3f0d898e59817cff6c Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 14 Feb 2025 18:47:30 +0100 Subject: [PATCH 081/110] refactor: remake docker image --- Dockerfile.spack | 27 +++++++++++++++++---------- Dockerfile.system | 15 +++++++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 44ab965a9..e520e95e9 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -1,19 +1,22 @@ ARG UBUNTU_VERSION="24.04" +# Stage 0 FROM ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG JULEA_SPACK_COMPILER="gcc" ARG CC="gcc" ARG BUILDTYPE="release" -##################################################### -# Julea build using spack # -##################################################### -FROM base AS julea_dependencies WORKDIR /app +FROM base AS julea_runtime_dependencies + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install \ + python3 + +FROM julea_runtime_dependencies AS julea_dependencies + RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install \ git \ - python3 \ build-essential \ zstd \ ca-certificates \ @@ -41,11 +44,15 @@ RUN CC=${CC} . /app/scripts/environment.sh && \ ninja -C bld install -FROM base AS julea -WORKDIR /app - -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 +FROM julea_runtime_dependencies AS julea COPY --from=julea_build /usr/ /usr/ COPY --from=julea_build /app/dependencies /app/dependencies -COPY ./scripts/ /app/scripts/ \ No newline at end of file +COPY ./scripts/ /app/scripts/ + +FROM julea_dependencies as julea_dev +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + git \ + gdb + diff --git a/Dockerfile.system b/Dockerfile.system index 6dc7a4af2..7b84c6764 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -2,13 +2,15 @@ ARG UBUNTU_VERSION="24.04" ARG CC="gcc" -# Stage 0 -FROM ubuntu:${UBUNTU_VERSION} AS julea_runtime_dependencies +FROM ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] ARG UBUNTU_VERSION="24.04" ARG CC="gcc" ARG BUILDTYPE="release" +# Stage 0 +FROM base AS julea_runtime_dependencies + # Stage 1-2.1b RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ @@ -28,10 +30,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ FROM julea_runtime_dependencies AS julea_dependencies - RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ - bash \ python3 \ python3-pip \ python3-setuptools \ @@ -64,3 +64,10 @@ WORKDIR /app COPY --from=julea_build /app/julea-install/ / # Required for ld to detect the added libraries RUN ldconfig + + +FROM julea_dependencies as julea_dev + RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + git \ + gdb From bdbd298539b2fa973046be8f31ae967a36118a90 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 14 Feb 2025 18:56:13 +0100 Subject: [PATCH 082/110] fix: wrong command --- Dockerfile.spack | 2 +- Dockerfile.system | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index e520e95e9..649e13bbe 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -51,7 +51,7 @@ COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ FROM julea_dependencies as julea_dev -RUN DEBIAN_FRONTEND=noninteractive apt-get update \ +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ git \ gdb diff --git a/Dockerfile.system b/Dockerfile.system index 7b84c6764..6bc5ac383 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -67,7 +67,7 @@ RUN ldconfig FROM julea_dependencies as julea_dev - RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ git \ gdb From 53369e5a72c2b2c15e7552b0793d835e53cc1ea0 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 21 Feb 2025 22:31:26 +0100 Subject: [PATCH 083/110] chore: improve dockerfiles --- Dockerfile.spack | 16 ++++++---------- Dockerfile.system | 16 ++++------------ 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 649e13bbe..0357e1d49 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -30,23 +30,19 @@ COPY ./scripts/ /app/scripts RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependencies" /app/scripts/install-dependencies.sh -FROM base AS julea_build - -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y upgrade && apt-get -y install python3 build-essential clang +FROM julea_dependencies AS julea_build WORKDIR /app -COPY ./ /app -COPY --from=julea_dependencies /app/dependencies /app/dependencies +COPY --exclude=./dependencies ./ /app -RUN CC=${CC} . /app/scripts/environment.sh && \ - meson setup --prefix="/usr" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ +RUN . /app/scripts/environment.sh && \ + CC=${CC} meson setup --prefix="/usr/local" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld && \ - ninja -C bld install + DESTDIR=/app/julea-install/ ninja -C bld install FROM julea_runtime_dependencies AS julea - -COPY --from=julea_build /usr/ /usr/ +COPY --from=julea_build /app/julea-install/ / COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ diff --git a/Dockerfile.system b/Dockerfile.system index 6bc5ac383..d3bce4daa 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -1,6 +1,4 @@ ARG UBUNTU_VERSION="24.04" -ARG CC="gcc" - FROM ubuntu:${UBUNTU_VERSION} AS base SHELL [ "/bin/bash", "-c" ] @@ -8,10 +6,8 @@ ARG UBUNTU_VERSION="24.04" ARG CC="gcc" ARG BUILDTYPE="release" -# Stage 0 -FROM base AS julea_runtime_dependencies -# Stage 1-2.1b +FROM base AS julea_runtime_dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get --yes install \ libglib2.0-dev \ @@ -51,16 +47,12 @@ FROM julea_dependencies AS julea_build WORKDIR /app COPY . /app/ -# Stage 2.3b -RUN . /app/scripts/environment.sh && \ - CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror --prefix="/usr" bld && \ - ninja -C bld && \ - DESTDIR=/app/julea-install/ ninja -C bld install +RUN CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror --prefix="/usr/local" bld +RUN ninja -C bld +RUN DESTDIR=/app/julea-install/ ninja -C bld install FROM julea_runtime_dependencies AS julea -WORKDIR /app - COPY --from=julea_build /app/julea-install/ / # Required for ld to detect the added libraries RUN ldconfig From 88778f6a64ac054a81cd0e0a4947959d12210e69 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Fri, 21 Feb 2025 22:33:58 +0100 Subject: [PATCH 084/110] fix: rely on dockerignore --- Dockerfile.spack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 0357e1d49..7ed1ee81d 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -33,7 +33,7 @@ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependenc FROM julea_dependencies AS julea_build WORKDIR /app -COPY --exclude=./dependencies ./ /app +COPY ./ /app RUN . /app/scripts/environment.sh && \ CC=${CC} meson setup --prefix="/usr/local" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ From 8c763908c0e4aeb4c446b275f3f121f5975bc6ac Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sun, 23 Feb 2025 22:45:05 +0100 Subject: [PATCH 085/110] fix: change prefix and remove install --- Dockerfile.spack | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 7ed1ee81d..0ebf4bcd6 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -36,17 +36,15 @@ WORKDIR /app COPY ./ /app RUN . /app/scripts/environment.sh && \ - CC=${CC} meson setup --prefix="/usr/local" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ - ninja -C bld && \ - DESTDIR=/app/julea-install/ ninja -C bld install - + CC=${CC} meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + ninja -C bld FROM julea_runtime_dependencies AS julea -COPY --from=julea_build /app/julea-install/ / +COPY --from=julea_build /app/julea-install/ /app/julea-install/ COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ -FROM julea_dependencies as julea_dev +FROM julea_dependencies AS julea_dev RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ git \ From 581b6112e6a319bce6faa09d1f8c60d43e253ebd Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sun, 23 Feb 2025 22:51:09 +0100 Subject: [PATCH 086/110] fix: readd install command --- Dockerfile.spack | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 0ebf4bcd6..210a4011b 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -37,7 +37,8 @@ COPY ./ /app RUN . /app/scripts/environment.sh && \ CC=${CC} meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ - ninja -C bld + ninja -C bld && \ + ninja -C bld install FROM julea_runtime_dependencies AS julea COPY --from=julea_build /app/julea-install/ /app/julea-install/ From 333a170847fb2181d7ec04f08d97729a55291efd Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sun, 23 Feb 2025 23:02:30 +0100 Subject: [PATCH 087/110] chore: add entrypoint --- Dockerfile.spack | 3 +++ scripts/docker-spack-entrypoint.sh | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 scripts/docker-spack-entrypoint.sh diff --git a/Dockerfile.spack b/Dockerfile.spack index 210a4011b..2554e27db 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -45,6 +45,9 @@ COPY --from=julea_build /app/julea-install/ /app/julea-install/ COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ +ENTRYPOINT [ "/app/scripts/docker-spack-entrypoint.sh" ] + + FROM julea_dependencies AS julea_dev RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ diff --git a/scripts/docker-spack-entrypoint.sh b/scripts/docker-spack-entrypoint.sh new file mode 100644 index 000000000..9acc5b6db --- /dev/null +++ b/scripts/docker-spack-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +export PATH=$PATH:/app/julea-install +. /app/environment.sh + +# Run CMD +$@ \ No newline at end of file From 97e604354550736879719f32722d2346624869fd Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 20:28:33 +0100 Subject: [PATCH 088/110] fix: make script executable --- scripts/docker-spack-entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/docker-spack-entrypoint.sh diff --git a/scripts/docker-spack-entrypoint.sh b/scripts/docker-spack-entrypoint.sh old mode 100644 new mode 100755 From 917dbcd8b5123721ad9195eee0fe0ce4fdfd5d80 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 21:41:00 +0100 Subject: [PATCH 089/110] fix: move entrypoint script out of script directory to improve caching --- Dockerfile.spack | 3 ++- .../docker-spack-entrypoint.sh => docker-spack-entrypoint.sh | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename scripts/docker-spack-entrypoint.sh => docker-spack-entrypoint.sh (100%) diff --git a/Dockerfile.spack b/Dockerfile.spack index 2554e27db..ef1874ecf 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -44,8 +44,9 @@ FROM julea_runtime_dependencies AS julea COPY --from=julea_build /app/julea-install/ /app/julea-install/ COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ +COPY ./docker-spack-entrypoint.sh /app/docker-spack-entrypoint.sh -ENTRYPOINT [ "/app/scripts/docker-spack-entrypoint.sh" ] +ENTRYPOINT [ "/app/docker-spack-entrypoint.sh" ] FROM julea_dependencies AS julea_dev diff --git a/scripts/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh similarity index 100% rename from scripts/docker-spack-entrypoint.sh rename to docker-spack-entrypoint.sh From 8e5fb5bf0b0922b2f1cf3195990ba46b9e4629a8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 21:42:55 +0100 Subject: [PATCH 090/110] fix: unignore entrypoint script --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 3f312c8e3..6fa37f0f2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,4 +7,6 @@ dependencies # Ignore Docker related things Dockerfile* -docker-* \ No newline at end of file +docker-* + +!docker-spack-entrypoint.sh \ No newline at end of file From 1870f582d6c2115a200331ee601d636669a7fb07 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 21:45:25 +0100 Subject: [PATCH 091/110] fix: use proper path to environment script --- docker-spack-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index 9acc5b6db..a08737abd 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash export PATH=$PATH:/app/julea-install -. /app/environment.sh +. /app/script/environment.sh # Run CMD $@ \ No newline at end of file From aeeb2fa9b3141b4dce9480a7fa75df94c32ecbac Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 21:46:46 +0100 Subject: [PATCH 092/110] fix: fix typo --- docker-spack-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index a08737abd..0896935a3 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash export PATH=$PATH:/app/julea-install -. /app/script/environment.sh +. /app/scripts/environment.sh # Run CMD $@ \ No newline at end of file From aafdbd75bbd8870a3a47b91f3f036d1705e29851 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Mon, 24 Feb 2025 21:52:41 +0100 Subject: [PATCH 093/110] fix: add missing LD_LIBRARY_PATH and fix bin path --- docker-spack-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index 0896935a3..a11373ee3 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/bash -export PATH=$PATH:/app/julea-install +export PATH=$PATH:/app/julea-install/bin +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/julea-install/lib . /app/scripts/environment.sh # Run CMD From 663accc3b0f76316b35448baf55659ab5fee0e81 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:19:34 +0100 Subject: [PATCH 094/110] fix: add all /lib subdirectories to LD_LIBRARY_PATH --- docker-spack-entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index a11373ee3..14d95bd68 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,7 +1,11 @@ #!/bin/bash export PATH=$PATH:/app/julea-install/bin -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/julea-install/lib + +find "$/app/julea-install/lib" -type d | while read -r dir; do + export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH" +done + . /app/scripts/environment.sh # Run CMD From 523080ac9cf5aae0792cb29566fa479e3628924a Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:20:46 +0100 Subject: [PATCH 095/110] fix: typo --- docker-spack-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index 14d95bd68..5eed7ce60 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -2,7 +2,7 @@ export PATH=$PATH:/app/julea-install/bin -find "$/app/julea-install/lib" -type d | while read -r dir; do +find "/app/julea-install/lib" -type d | while read -r dir; do export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH" done From 5d13142c258dbb5a636bc0e787c205e63f90d21a Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:25:18 +0100 Subject: [PATCH 096/110] fix: use bld instead of julea-install --- Dockerfile.spack | 7 +++---- docker-spack-entrypoint.sh | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index ef1874ecf..0837da6ed 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -36,12 +36,11 @@ WORKDIR /app COPY ./ /app RUN . /app/scripts/environment.sh && \ - CC=${CC} meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ - ninja -C bld && \ - ninja -C bld install + CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + ninja -C bld FROM julea_runtime_dependencies AS julea -COPY --from=julea_build /app/julea-install/ /app/julea-install/ +COPY --from=julea_build /app/bld /app/bld COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ COPY ./docker-spack-entrypoint.sh /app/docker-spack-entrypoint.sh diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index 5eed7ce60..bd363db78 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,7 +1,5 @@ #!/bin/bash -export PATH=$PATH:/app/julea-install/bin - find "/app/julea-install/lib" -type d | while read -r dir; do export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH" done From b0dec442a9391471d43c865c9a30f2d6a090173e Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:25:46 +0100 Subject: [PATCH 097/110] refactor: no longer required code --- docker-spack-entrypoint.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index bd363db78..d3d8e8433 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,9 +1,4 @@ #!/bin/bash - -find "/app/julea-install/lib" -type d | while read -r dir; do - export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH" -done - . /app/scripts/environment.sh # Run CMD From 55c26d05d8eb72909cf466cc121e26fc068cd18d Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:40:45 +0100 Subject: [PATCH 098/110] fix: add proper prefix --- Dockerfile.spack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 0837da6ed..ac42e7e07 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -36,7 +36,7 @@ WORKDIR /app COPY ./ /app RUN . /app/scripts/environment.sh && \ - CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ + CC=${CC} meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ ninja -C bld FROM julea_runtime_dependencies AS julea From fdfd611b94e8e6def229acf126a191054908b06a Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:44:34 +0100 Subject: [PATCH 099/110] fix: add missing install --- Dockerfile.spack | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index ac42e7e07..02d01b5a9 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -37,10 +37,11 @@ COPY ./ /app RUN . /app/scripts/environment.sh && \ CC=${CC} meson setup --prefix="/app/julea-install" --buildtype=${BUILDTYPE} --werror "-Dgdbm_prefix=$(spack location --install-dir gdbm)" bld && \ - ninja -C bld + ninja -C bld && \ + DESTDIR="/" ninja -C bld install FROM julea_runtime_dependencies AS julea -COPY --from=julea_build /app/bld /app/bld +COPY --from=julea_build /app/julea-install /app/julea-install COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ COPY ./docker-spack-entrypoint.sh /app/docker-spack-entrypoint.sh From c6fd67155b0264d32d457a8d7c60a1d5be9bc8c3 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Tue, 25 Feb 2025 18:48:44 +0100 Subject: [PATCH 100/110] fix: add missing JULEA_PREFIX --- docker-spack-entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index d3d8e8433..42b5f7201 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -1,4 +1,7 @@ #!/bin/bash + +export JULEA_PREFIX="/app/julea-install" + . /app/scripts/environment.sh # Run CMD From e7e3cd75b0fe45d44b242869e4883cc3dd6c85ba Mon Sep 17 00:00:00 2001 From: Finn Hering <92150718+FinnHering@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:47:39 +0100 Subject: [PATCH 101/110] Update containers.yml fix: remove not needed step --- .github/workflows/containers.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 6816a9706..c9d4c9469 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -70,23 +70,12 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - REGISTRY_IMAGE - tags: | - type=sha - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - name: Build and Push uses: docker/bake-action@v5 env: COMMIT_SHA: ${{ github.sha }} BASE_TAG: ${{ env.REGISTRY_IMAGE }} with: - targets: ${{ matrix.target }} push: true files: | From 64269b5ce785bebc8186ab37d02d8c0e795703e8 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Thu, 17 Apr 2025 17:49:36 +0200 Subject: [PATCH 102/110] fix: set correct target for dev container --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index f08da9d3c..d08b7935f 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -76,7 +76,7 @@ target "ubuntu-dev-container" { CC = "gcc" } tags = ["${BASE_TAG}-dev-container:latest", "${BASE_TAG}-dev-container:latest-${COMMIT_SHA}"] - target = "julea_dependencies" + target = "julea_dev" dockerfile = "Dockerfile.spack" cache-from = [ From 74c3d5c3a7f21b6741b22a324789ce72238616f1 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 10 May 2025 11:30:28 +0200 Subject: [PATCH 103/110] chore: refactor Dockerfiles --- Dockerfile.spack | 6 +++--- Dockerfile.system | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.spack b/Dockerfile.spack index 02d01b5a9..83d4d6362 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -10,7 +10,8 @@ WORKDIR /app FROM base AS julea_runtime_dependencies -RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install \ +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update \ +&& apt-get -y install \ python3 FROM julea_runtime_dependencies AS julea_dependencies @@ -31,7 +32,6 @@ RUN JULEA_SPACK_COMPILER=${JULEA_SPACK_COMPILER} JULEA_SPACK_DIR="/app/dependenc FROM julea_dependencies AS julea_build -WORKDIR /app COPY ./ /app @@ -41,6 +41,7 @@ RUN . /app/scripts/environment.sh && \ DESTDIR="/" ninja -C bld install FROM julea_runtime_dependencies AS julea + COPY --from=julea_build /app/julea-install /app/julea-install COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ @@ -54,4 +55,3 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ git \ gdb - diff --git a/Dockerfile.system b/Dockerfile.system index d3bce4daa..d772ddde3 100644 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -5,6 +5,7 @@ SHELL [ "/bin/bash", "-c" ] ARG UBUNTU_VERSION="24.04" ARG CC="gcc" ARG BUILDTYPE="release" +WORKDIR /app FROM base AS julea_runtime_dependencies @@ -44,7 +45,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ FROM julea_dependencies AS julea_build -WORKDIR /app COPY . /app/ RUN CC=${CC} meson setup --buildtype=${BUILDTYPE} --werror --prefix="/usr/local" bld @@ -58,7 +58,7 @@ COPY --from=julea_build /app/julea-install/ / RUN ldconfig -FROM julea_dependencies as julea_dev +FROM julea_dependencies AS julea_dev RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ git \ From 7c9b23138358c3263da8d560cf5af0d69ceb8ab7 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 10 May 2025 11:31:32 +0200 Subject: [PATCH 104/110] chore: refactor bakefile --- docker-bake.hcl | 113 ++++++++++++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 46 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index d08b7935f..bec1cd20e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,88 +1,109 @@ -target "docker-metadata-action" { - platforms = ["linux/amd64"] -} +target "base" { platforms = ["linux/amd64"] } -variable "BASE_TAG" { - default = "ghcr.io/finnhering/julea" -} +variable "BASE_IMAGE_NAME" { default = "ghcr.io/finnhering/julea" } -variable "COMMIT_SHA" { - default = "UNKNOWN" -} +variable "COMMIT_SHA" { default = "UNKNOWN"} -group "ubuntu" { - targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest", "ubuntu-dev-container"] -} +group "ubuntu" { targets = ["ubuntu-spack", "ubuntu-system", "ubuntu-latest", "ubuntu-spack-dev-container", "ubuntu-system-dev-container", "ubuntu-dev-latest"] } -# Target build docker images with prebuild julea + dependencies using spack method target "ubuntu-spack" { - name = "julea-ubuntu-${versions}-04-spack-${compilers}" - inherits = ["docker-metadata-action"] + name = "julea-ubuntu-${versions}-04-spack-${compilers}" + inherits = ["base"] matrix = { versions = ["24", "22", "20"] compilers = ["gcc", "clang"] } args = { - UBUNTU_VERSION = "${versions}.04" + UBUNTU_VERSION = "${versions}.04" JULEA_SPACK_COMPILER = compilers - CC = compilers + CC = compilers } - # Add -dependencies to the tag if the target is julea_dependencies - tags = ["${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}", "${BASE_TAG}-spack:ubuntu-${versions}-04-${compilers}-${COMMIT_SHA}"] - target = "julea" + tags = ["${BASE_IMAGE_NAME}:${compilers}-spack-ubuntu-${versions}.04", "${BASE_IMAGE_NAME}:${compilers}-spack-ubuntu-${versions}.04-${COMMIT_SHA}"] + target = "julea" dockerfile = "Dockerfile.spack" - cache-from = [ - "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" - ] - cache-to = [ - "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" - ] + cache-from = [ "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" ] + cache-to = [ "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" ] } # Target build docker images with prebuild julea + dependencies using system method target "ubuntu-system" { - name = "julea-ubuntu-${versions}-04-system-${compilers}" - inherits = ["docker-metadata-action"] + name = "julea-ubuntu-${versions}-04-system-${compilers}" + inherits = ["base"] matrix = { versions = ["24", "22"] compilers = ["gcc", "clang"] } args = { UBUNTU_VERSION = "${versions}.04" - CC = compilers + CC = compilers } - tags = ["${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}", "${BASE_TAG}-system:ubuntu-${versions}-04-${compilers}-${COMMIT_SHA}"] - target = "julea" + tags = ["${BASE_IMAGE_NAME}:${compilers}-system-ubuntu-${versions}.04", "${BASE_IMAGE_NAME}:${compilers}-system-ubuntu-${versions}.04-${COMMIT_SHA}"] + target = "julea" dockerfile = "Dockerfile.system" } # Build latest image target "ubuntu-latest" { - inherits = ["docker-metadata-action"] + inherits = ["base"] args = { UBUNTU_VERSION = "24.04" - CC = "gcc" + CC = "gcc" } - tags = ["${BASE_TAG}:latest", "${BASE_TAG}:latest-${COMMIT_SHA}"] - target = "julea" + tags = ["${BASE_IMAGE_NAME}:latest"] + target = "julea" dockerfile = "Dockerfile.system" } -target "ubuntu-dev-container" { - inherits = ["docker-metadata-action"] +target "ubuntu-spack-dev-container" { + inherits = ["base"] + name = "julea-dev-ubuntu-${versions}-04-spack-${compilers}" + args = { + UBUNTU_VERSION = "${versions}.04" + CC = compilers + } + + matrix = { + versions = ["24", "22", "20"] + compilers = ["gcc", "clang"] + } + + tags = ["${BASE_IMAGE_NAME}-dev:${compilers}-spack-ubuntu-${versions}.04", "${BASE_IMAGE_NAME}-dev:${compilers}-spack-ubuntu-${versions}.04-${COMMIT_SHA}"] + target = "julea_dev" + dockerfile = "Dockerfile.spack" + + cache-from = [ "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers}" ] + cache-to = [ "type=gha,scope=julea-ubuntu-${versions}-04-spack-${compilers},mode=max" ] +} + + +target "ubuntu-system-dev-container" { + inherits = ["base"] + name = "julea-dev-ubuntu-${versions}-04-system" + args = { + UBUNTU_VERSION = "${versions}.04" + } + + matrix = { + versions = ["24", "22", "20"] + } + + tags = ["${BASE_IMAGE_NAME}-dev:system-ubuntu-${versions}.04", "${BASE_IMAGE_NAME}-dev:system-ubuntu-${versions}.04-${COMMIT_SHA}"] + target = "julea_dev" + dockerfile = "Dockerfile.system" +} + +target "ubuntu-dev-latest" { + inherits = ["base"] args = { UBUNTU_VERSION = "24.04" - CC = "gcc" + CC = "gcc" } - tags = ["${BASE_TAG}-dev-container:latest", "${BASE_TAG}-dev-container:latest-${COMMIT_SHA}"] - target = "julea_dev" + + tags = ["${BASE_IMAGE_NAME}-dev:latest"] + target = "julea_dev" dockerfile = "Dockerfile.spack" - cache-from = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc" - ] - cache-to = [ - "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" - ] + cache-from = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc" ] + cache-to = [ "type=gha,scope=julea-ubuntu-24-04-spack-gcc,mode=max" ] } \ No newline at end of file From 3c07728c9d388e912ec29ab4281c6ee9de7d52bd Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 17 May 2025 13:43:31 +0000 Subject: [PATCH 105/110] fix: add shellecheck annotations --- docker-spack-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-spack-entrypoint.sh b/docker-spack-entrypoint.sh index 42b5f7201..afb6be1c5 100755 --- a/docker-spack-entrypoint.sh +++ b/docker-spack-entrypoint.sh @@ -2,7 +2,9 @@ export JULEA_PREFIX="/app/julea-install" +# shellcheck source=scripts/environment.sh . /app/scripts/environment.sh # Run CMD +# shellcheck disable=SC2068 $@ \ No newline at end of file From 61f8b2def8a0e6b3b93f5ee3c11d5a7c4e9e6e18 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 17 May 2025 14:38:17 +0000 Subject: [PATCH 106/110] ci: remove old container build step --- .github/workflows/ci.yml | 59 ---------------------------------------- 1 file changed, 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ebc7de5c..d58e41e34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,65 +77,6 @@ jobs: JULEA_SPACK_COMPILER: ${{ matrix.os.compiler }}@${{ matrix.os.compiler_version }} run: | ./scripts/install-dependencies.sh - dependencies-containers: - name: Dependencies (Containers) - runs-on: ubuntu-24.04 - container: ${{ matrix.os.registry }}/${{ matrix.os.image }} - timeout-minutes: 180 - strategy: - fail-fast: false - matrix: - os: - - image: ubuntu:24.04 - registry: docker.io/library - compiler: gcc - compiler_version: 13.2.0 - - image: ubuntu:24.04 - registry: docker.io/library - compiler: clang - compiler_version: 18.1.3 - - image: ubuntu:22.04 - registry: docker.io/library - compiler: gcc - compiler_version: 11.4.0 - - image: ubuntu:22.04 - registry: docker.io/library - compiler: clang - compiler_version: 14.0.0 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - show-progress: false - - name: Install packages - if: ${{ matrix.os.image == 'ubuntu:24.04' || matrix.os.image == 'ubuntu:22.04' }} - run: | - apt update - apt --yes --no-install-recommends install build-essential zstd - apt --yes --no-install-recommends install ca-certificates git gnupg patchelf python3 unzip - if test "${{ matrix.os.compiler }}" = 'clang' - then - apt --yes --no-install-recommends install clang - - if test "${{ matrix.os.image }}" = 'ubuntu:24.04' - then - apt --yes --no-install-recommends install libclang-rt-dev - fi - fi - - name: Cache dependencies - id: cache - uses: actions/cache@v4 - with: - path: /dependencies - key: ${{ matrix.os.image }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }} - - name: Install dependencies - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - env: - JULEA_SPACK_COMPILER: ${{ matrix.os.compiler }}@${{ matrix.os.compiler_version }} - JULEA_SPACK_DIR: /dependencies - run: | - ./scripts/install-dependencies.sh build: name: Build needs: dependencies From 481f34eb008309a62e52e88bb342df7c41add38b Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 24 May 2025 10:00:23 +0000 Subject: [PATCH 107/110] fix: support platform emulation --- Dockerfile.spack | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile.spack b/Dockerfile.spack index 83d4d6362..f6f67ccc4 100644 --- a/Dockerfile.spack +++ b/Dockerfile.spack @@ -42,6 +42,9 @@ RUN . /app/scripts/environment.sh && \ FROM julea_runtime_dependencies AS julea +# Set Environment to support X86 emulators like QEMU (See: https://github.com/spack/spack/issues/41639) +ENV SPACK_ROOT="/app/dependencies/" + COPY --from=julea_build /app/julea-install /app/julea-install COPY --from=julea_build /app/dependencies /app/dependencies COPY ./scripts/ /app/scripts/ From c9808ebd40530d341ae9573fa1c2d21a159a73f6 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 24 May 2025 11:36:12 +0000 Subject: [PATCH 108/110] fix: use proper variable name --- .github/workflows/containers.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index c9d4c9469..2afd8ad58 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -28,10 +28,9 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_IMAGE: ghcr.io/finnhering/julea + REGISTRY_BASE: ghcr.io/finnhering jobs: - prepare: runs-on: ubuntu-latest outputs: @@ -74,7 +73,7 @@ jobs: uses: docker/bake-action@v5 env: COMMIT_SHA: ${{ github.sha }} - BASE_TAG: ${{ env.REGISTRY_IMAGE }} + BASE_IMAGE_NAME: ${{ env.REGISTRY_BASE }}/julea with: targets: ${{ matrix.target }} push: true From 85d7c31a6737cf5072774157c36b3fd2093a4853 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sat, 24 May 2025 12:30:37 +0000 Subject: [PATCH 109/110] chore: use proper registry path --- .github/workflows/containers.yml | 2 +- docker-bake.hcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 2afd8ad58..0debe4e05 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -28,7 +28,7 @@ on: # - cron: '0 0 * * 0' env: - REGISTRY_BASE: ghcr.io/finnhering + REGISTRY_BASE: ghcr.io/parcio jobs: prepare: diff --git a/docker-bake.hcl b/docker-bake.hcl index bec1cd20e..86c0bcce3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,6 +1,6 @@ target "base" { platforms = ["linux/amd64"] } -variable "BASE_IMAGE_NAME" { default = "ghcr.io/finnhering/julea" } +variable "BASE_IMAGE_NAME" { default = "ghcr.io/parcio/julea" } variable "COMMIT_SHA" { default = "UNKNOWN"} From 65dd7ba8d9234ddbcd7474716e60a20af6766fc3 Mon Sep 17 00:00:00 2001 From: Finn Hering Date: Sun, 1 Jun 2025 10:29:13 +0000 Subject: [PATCH 110/110] fix: use proper tag name add note about cross platform execution --- .devcontainer/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3c001dfcb..7547ed582 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,8 @@ +// QUIRK: For running the AMD64 containers on different platforms (eg. ARM64) do: docker pull --platform=linux/amd64 before starting the devcontainer. +// See: https://github.com/microsoft/vscode-remote-release/issues/8965 { "name": "Julea Dev Container", - "image": "ghcr.io/finnhering/julea-dev-container:latest", + "image": "ghcr.io/parcio/julea-dev:latest", "containerEnv": { "JULEA_SPACK_DIR": "/app/dependencies" }