diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index cf44d754..8186788a 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -26,3 +26,23 @@ jobs: context: . file: spack/ci-spack-pyprecice-deps-2404.dockerfile tags: precice/ci-spack-pyprecice-deps-2404 + build-spack-pyprecice-external-deps: + name: Builds the baseimage for spack using external dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Set up Docker + uses: docker/setup-buildx-action@v1 + - name: Login to registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + context: . + file: spack/ci-spack-pyprecice-external-deps-2404.dockerfile + tags: precice/ci-spack-pyprecice-external-deps-2404 diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 8ff0b6cb..eb279fc2 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -32,4 +32,28 @@ jobs: spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop spack install && spack find spack load py-pyprecice - BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" \ No newline at end of file + BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" + build_spack_external: + name: build_spack_external + runs-on: ubuntu-latest + timeout-minutes: 15 + container: precice/ci-spack-pyprecice-external-deps-2404 + defaults: + run: + shell: "bash --login -eo pipefail {0}" + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Move Package Script + run: | + ls + cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ + - name: Try to build py-pyprecice with spack and test it + run: | + . /spack/share/spack/setup-env.sh + spack env activate ci && spack arch + spack remove py-pyprecice + spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop + spack install && spack find && spack external find + spack load py-pyprecice + BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" diff --git a/spack/ci-spack-pyprecice-external-deps-2404.dockerfile b/spack/ci-spack-pyprecice-external-deps-2404.dockerfile new file mode 100644 index 00000000..5decd8cf --- /dev/null +++ b/spack/ci-spack-pyprecice-external-deps-2404.dockerfile @@ -0,0 +1,39 @@ +# Build stage with Spack pre-installed and ready to be used +FROM spack/ubuntu-noble:latest + +ARG DEBIAN_FRONTEND=noninteractive +SHELL ["/bin/bash", "-c"] +# this is necessary to avoid timeouts during installation due to interactive installs + +# Installing necessary dependencies for preCICE, boost 1.71 from apt-get +RUN apt-get -qq update && apt-get -qq install \ + curl \ + unzip \ + build-essential \ + locales \ + libboost-all-dev \ + libeigen3-dev \ + libxml2-dev \ + git \ + python3-dev \ + python3-pip \ + petsc-dev \ + mpich \ + wget \ + bzip2 \ + cmake && \ + rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/spack/spack.git + +RUN pip3 install cython # needed for successfully building py-numpy + +ADD ./spack/repo /py-pyprecice-repo + +RUN source /spack/share/spack/setup-env.sh && \ + spack --color=always external find --not-buildable && \ + spack --color=always env create --without-view ci && \ + spack --color=always -e ci repo add /py-pyprecice-repo && \ + spack --color=always -e ci add pyprecice.test.py-pyprecice@develop target=x86_64 && \ + spack --color=always -e ci install --fail-fast --only=dependencies && \ + spack --color=always clean -a