diff --git a/.github/workflows/everything.yml b/.github/workflows/everything.yml index 90d86785cd..014fe9c6ff 100644 --- a/.github/workflows/everything.yml +++ b/.github/workflows/everything.yml @@ -427,53 +427,55 @@ jobs: strategy: fail-fast: false matrix: - baseos: [ubuntu-bionic] + baseos: [ubuntu-22.04] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 with: ref: ${{ github.event.pull_request.head.sha }} path: ci-source - - name: Re-configure docker daemon + + - name: Install Podman + if: ${{ matrix.base-img != 'self-hosted' }} run: | - sudo systemctl stop docker - echo $'{\n "experimental": true\n}' | \ - sudo tee /etc/docker/daemon.json - sudo systemctl start docker + sudo apt-get update + sudo apt-get install -y podman + + - name: Build image run: | - docker build \ - --rm --squash \ + podman build \ + --rm \ -t ornladios/adios2:ci-tmp \ - --build-arg baseos=${{ matrix.baseos }} \ --build-arg ci_source_dir=ci-source \ - -f ci-source/scripts/ci/images/spack/Dockerfile \ + -f ci-source/scripts/ci/images/spack/adios2-container-dist.dockerfile \ . + - name: Save image as a tar file run: | - docker save -o ci-docker.tar ornladios/adios2:ci-tmp - ls -lah ci-docker.tar + podman save -o ci-podman.tar ornladios/adios2:ci-tmp + ls -lah ci-podman.tar - name: Upload uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v4 with: retention-days: 1 - name: ci-docker ${{ matrix.baseos }} ${{ github.sha }} - path: ci-docker.tar - - name: Push image to Docker Hub + name: ci-podman ${{ matrix.baseos }} ${{ github.sha }} + path: ci-podman.tar + + - name: Log in to GitHub Container Registry + if: github.event_name == 'push' + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Push image to GitHub Container Registry if: github.event_name == 'push' - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} run: | target_tag="${GITHUB_REF##refs/heads/}-${{ matrix.baseos }}" - docker tag \ + podman tag \ ornladios/adios2:ci-tmp \ - ornladios/adios2:${target_tag} - docker login \ - --username="${DOCKERHUB_USERNAME}" \ - --password="${DOCKERHUB_PASSWORD}" - docker push \ - ornladios/adios2:${target_tag} + "ghcr.io/${{ github.repository }}/ornladios/adios2:${target_tag}" + podman push \ + "ghcr.io/${{ github.repository }}/ornladios/adios2:${target_tag}" ####################################### # Contract testing jobs @@ -504,7 +506,7 @@ jobs: - code: tau defaults: run: - shell: bash -c "docker exec adios2-ci bash --login -e $(echo {0} | sed 's|/home/runner/work|/__w|g')" + shell: bash -c "podman exec adios2-ci bash --login -e $(echo {0} | sed 's|/home/runner/work|/__w|g')" steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 @@ -516,18 +518,18 @@ jobs: - name: Download CI docker image uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v4 with: - name: ci-docker ubuntu-bionic ${{ github.sha }} + name: ci-podman ubuntu-22.04 ${{ github.sha }} - name: Initialize containers shell: bash -e {0} run: | sudo chown 1000:1000 . - docker load -i ci-docker.tar - docker create \ + podman load -i ci-podman.tar + podman create \ --name adios2-ci --workdir /__w/ADIOS2/ADIOS2 \ -v "/home/runner/work":"/__w" \ --entrypoint "tail" ornladios/adios2:ci-tmp \ "-f" "/dev/null" - docker start adios2-ci + podman start adios2-ci - name: Dependencies run: /opt/adios2/source/testing/contract/${{ matrix.code }}/depends.sh - name: Configure diff --git a/.github/workflows/external.yml b/.github/workflows/external.yml index a87732f6d8..5922dd8e09 100644 --- a/.github/workflows/external.yml +++ b/.github/workflows/external.yml @@ -12,7 +12,7 @@ permissions: jobs: generate_statuses: - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: contents: read statuses: write diff --git a/scripts/ci/images/build-ubuntu.sh b/scripts/ci/images/build-ubuntu.sh index 16d33d021d..0586cee10c 100755 --- a/scripts/ci/images/build-ubuntu.sh +++ b/scripts/ci/images/build-ubuntu.sh @@ -20,7 +20,7 @@ TAG_PREFIX="${IMAGE_TAG_PREFIX:-ghcr.io/ornladios/adios2}" # Build the base image ${BUILD_TOOL} build --progress=plain \ --build-arg PATCH_VARIANT_XROOTD=ON \ - --build-arg EXTRA_SPECS="sz3" \ + --build-arg EXTRA_SPECS="sz3 zstd" \ --rm -f ./Dockerfile.ci-spack-ubuntu22.04-base \ -t "${TAG_PREFIX}:ci-spack-ubuntu22.04-base" \ . diff --git a/scripts/ci/images/spack/Dockerfile b/scripts/ci/images/spack/Dockerfile deleted file mode 100644 index 2302d747ed..0000000000 --- a/scripts/ci/images/spack/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors -# -# SPDX-License-Identifier: Apache-2.0 - -ARG baseos -FROM docker.io/ornladios/adios2:spack-dependencies-${baseos} - -# Install from CI source -ARG ci_source_dir=ci-source -COPY ${ci_source_dir} /opt/adios2/source -RUN spack dev-build \ - -j$(grep -c '^processor' /proc/cpuinfo) \ - -d /opt/adios2/source \ - --skip-patch \ - adios2@develop ~python && \ - spack clean -a - -# Build the environment -RUN spack env create --without-view adios2 && \ - spack -e adios2 add $(spack find --format "/{hash}") && \ - spack -e adios2 install -v && \ - rm -rf /root/.spack && \ - spack env activate adios2 && \ - spack env deactivate && \ - spack -e adios2 env loads - -# Initialize the first-use-of-environment stuff for the adios user -WORKDIR /home/adios -USER adios -RUN spack env activate adios2 && \ - spack env deactivate && \ - echo "source /opt/spack/share/spack/setup-env.sh" >> ~/.bash_profile && \ - echo "module use ${SPACK_ROOT}/share/spack/modules/linux-ubuntu18.04-haswell" >> ~/.bash_profile && \ - echo "source ${SPACK_ROOT}/var/spack/environments/adios2/loads" >> ~/.bash_profile - -ENTRYPOINT [] -CMD ["bash", "--login"] diff --git a/scripts/ci/images/spack/adios2-container-dist.dockerfile b/scripts/ci/images/spack/adios2-container-dist.dockerfile new file mode 100644 index 0000000000..2f97083091 --- /dev/null +++ b/scripts/ci/images/spack/adios2-container-dist.dockerfile @@ -0,0 +1,31 @@ +FROM ghcr.io/ornladios/adios2/adios2-deps + +RUN echo ${ADIOS2_SPEC} + +# Install from CI source +ARG ci_source_dir=ci-source +COPY ${ci_source_dir} /opt/adios2/source +RUN . /spack/share/spack/setup-env.sh && \ + spack dev-build \ + -j$(grep -c '^processor' /proc/cpuinfo) \ + -d /opt/adios2/source \ + --no-checksum \ + --skip-patch \ + --reuse \ + adios2@master ${ADIOS2_SPEC} ^gcc && \ + spack uninstall --all --yes-to-all gcc && \ + spack clean -a + +RUN . /spack/share/spack/setup-env.sh && \ + spack config add "concretizer:unify:false" && \ + spack env create --without-view adios2 && \ + spack -e adios2 add $(spack find --format "/{hash}") && \ + spack -e adios2 install -v && \ + rm -rf /root/.spack && \ + spack env activate adios2 && \ + spack env deactivate && \ + echo "source /spack/share/spack/setup-env.sh" >> ~/.bash_profile && \ + echo "spack load adios2" >> ~/.bash_profile + +ENTRYPOINT [] +CMD ["bash", "--login"] diff --git a/scripts/ci/images/spack/adios2-deps.dockerfile b/scripts/ci/images/spack/adios2-deps.dockerfile new file mode 100644 index 0000000000..9fc94d0962 --- /dev/null +++ b/scripts/ci/images/spack/adios2-deps.dockerfile @@ -0,0 +1,63 @@ +FROM ubuntu:22.04 + +ARG SPACK_VERSION=v1.0.2 +ARG SPACK_MIRROR="https://binaries.spack.io/v2025.07.0" +ARG ADIOS2_SPEC="~mpi~mgard~libcatalyst~bzip2~png" + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + file \ + g++-12 \ + gfortran-12 \ + git \ + gzip \ + lsb-release \ + patch \ + python3 \ + tar \ + unzip \ + xz-utils \ + zstd \ + \ + && \ + apt clean -y && \ + rm -rf /var/lib/apt/lists/* + +# Clone and patch spack +WORKDIR / +RUN if ! [ -d /spack ]; then \ + git clone --depth 1 --single-branch --branch ${SPACK_VERSION} https://github.com/spack/spack; \ + else \ + git fetch --all && git checkout -t origin/${SPACK_VERSION}; \ + fi && \ + mkdir -p /root/.spack + +COPY packages.yaml /root/.spack/packages.yaml + +# Install base specs +RUN . /spack/share/spack/setup-env.sh && \ + spack repo update --branch "releases/v2025.07" builtin && \ + spack mirror add binaries "${SPACK_MIRROR}" && \ + spack config add "packages:all:target:[haswell]" && \ + spack config add "config:checksum:false" && \ + spack config add "config:build_jobs:$(nproc)" && \ + spack config add "concretizer:reuse:true" + +RUN . /spack/share/spack/setup-env.sh && \ + spack install \ + -j$(nproc) \ + --include-build-deps \ + --no-check-signature \ + --fail-fast \ + --only dependencies \ + adios2@master ${ADIOS2_SPEC} cmake%gcc && \ + spack clean -a && \ + echo "source /spack/share/spack/setup-env.sh" >> ~/.bash_profile + +ENV ADIOS2_SPEC="${ADIOS2_SPEC}" + +ENTRYPOINT [] +CMD ["bash", "--login"] diff --git a/scripts/ci/images/spack/packages.yaml b/scripts/ci/images/spack/packages.yaml new file mode 100644 index 0000000000..b6a5498fc0 --- /dev/null +++ b/scripts/ci/images/spack/packages.yaml @@ -0,0 +1,11 @@ +packages: + gcc: + externals: + - spec: gcc@12.3.0 languages='c,c++,fortran' + prefix: /usr + extra_attributes: + compilers: + c: /usr/bin/gcc-12 + cxx: /usr/bin/g++-12 + fortran: /usr/bin/gfortran-12 + buildable: false