From d48cf4b55da363ae2cbf636ccfd26fbe39bb42b1 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:19:37 +0100 Subject: [PATCH 1/5] update spack workflow --- .github/workflows/spack.yml | 77 +++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index b4b05aa..bce718c 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -8,25 +8,72 @@ on: jobs: test-spack: - runs-on: ubuntu-latest - container: boeschf/ghex-org - steps: - - name: install-ghex-org-packages + runs-on: ubuntu-22.04 + + defaults: + run: shell: bash + + strategy: + matrix: + spack-version: ['develop'] + micro-arch: ['x86_64_v3'] + + fail-fast: false + + env: + SPACK_DISABLE_LOCAL_CONFIG: "true" + SPACK_USER_CACHE_PATH: "/tmp/spack" + + steps: + + - name: install additional ubuntu packages run: | - mkdir /repos - git clone https://github.com/ghex-org/spack-repos.git /repos - . /opt/spack/share/spack/setup-env-clean.sh - spack repo add /repos - - name: Checkout - uses: actions/checkout@v3 + sudo apt-get update -qq + sudo apt-get install -y gfortran + + - name: checkout + uses: actions/checkout@v4 with: path: hwmalloc + + - name: clone ghex spack repo + run: git clone --depth=1 https://github.com/ghex-org/spack-repos.git repos + + - name: clone spack + run: git clone -c feature.manyFiles=true --depth 1 --branch ${{ matrix.spack-version }} https://github.com/spack/spack.git spack + + - name: initialize spack and add online buildcache + run: | + cat < spack/etc/spack/config.yaml + config: + install_tree: + padded_length: 128 + build_jobs: 4 + EOF + + cat < spack/etc/spack/packages.yaml + packages: + all: + require: + - 'target=${{ matrix.micro-arch }}' + - '%gcc' + EOF + + source spack/share/spack/setup-env.sh + spack compiler find + spack mirror add --unsigned local-buildcache oci://ghcr.io/boeschf/spack-buildcache + spack repo add repos + spack reindex + - name: build-and-test - shell: bash run: | + source spack/share/spack/setup-env.sh + # print dependencies + spack spec -I --reuse hwmalloc@develop + # dev-build does not respect test dependencies - workaround + spack install --reuse googletest + spack load googletest + # need `--dirty` here for environment variables and googletest test dependency to propagate cd hwmalloc - . /opt/spack/share/spack/setup-env-clean.sh - spack spec -I --reuse hwmalloc - spack dev-build --test=root --reuse hwmalloc@develop - cat install-time-test-log.txt + spack dev-build --dirty --reuse hwmalloc@develop From d30580260c91a50dd5413d1b7b1161de77f937fe Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:41:59 +0100 Subject: [PATCH 2/5] actually test --- .github/workflows/spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index bce718c..93feb46 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -76,4 +76,4 @@ jobs: spack load googletest # need `--dirty` here for environment variables and googletest test dependency to propagate cd hwmalloc - spack dev-build --dirty --reuse hwmalloc@develop + spack dev-build --test=root --dirty --reuse hwmalloc@develop From 0a13aa18b0cbc84585da7608bc21e2c6f0c523a6 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:37:25 +0100 Subject: [PATCH 3/5] source path --- .github/workflows/spack.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 93feb46..f935363 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -75,5 +75,4 @@ jobs: spack install --reuse googletest spack load googletest # need `--dirty` here for environment variables and googletest test dependency to propagate - cd hwmalloc - spack dev-build --test=root --dirty --reuse hwmalloc@develop + spack dev-build --test=root --dirty --reuse --source-path hwmalloc hwmalloc@develop From 5fc3a5a20f25b3728e8d9d5834375894c1f2fe12 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:43:35 +0200 Subject: [PATCH 4/5] update --- .github/workflows/spack.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index f935363..05f0f80 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -76,3 +76,9 @@ jobs: spack load googletest # need `--dirty` here for environment variables and googletest test dependency to propagate spack dev-build --test=root --dirty --reuse --source-path hwmalloc hwmalloc@develop + + - name: Push packages and update index + run: | + source spack/share/spack/setup-env.sh + spack mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache + spack buildcache push --base-image ubuntu:22.04 --unsigned --update-index --only dependencies local-buildcache hwmalloc@develop From 5c2786091c2ed32d16e4c053111ac95c339983f5 Mon Sep 17 00:00:00 2001 From: boeschf <48126478+boeschf@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:07:13 +0200 Subject: [PATCH 5/5] ubuntu version and continue on error --- .github/workflows/spack.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 05f0f80..ef6bd99 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -8,7 +8,7 @@ on: jobs: test-spack: - runs-on: ubuntu-22.04 + runs-on: ubuntu-${{ matrix.ubuntu-version }} defaults: run: @@ -16,6 +16,7 @@ jobs: strategy: matrix: + ubuntu-version: ['22.04'] spack-version: ['develop'] micro-arch: ['x86_64_v3'] @@ -78,7 +79,8 @@ jobs: spack dev-build --test=root --dirty --reuse --source-path hwmalloc hwmalloc@develop - name: Push packages and update index + continue-on-error: true run: | source spack/share/spack/setup-env.sh spack mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache - spack buildcache push --base-image ubuntu:22.04 --unsigned --update-index --only dependencies local-buildcache hwmalloc@develop + spack buildcache push --base-image ubuntu:${{ matrix.ubuntu-version }} --unsigned --update-index --only dependencies local-buildcache hwmalloc@develop