Iterations on PSSE parser #514
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://spack.readthedocs.io/en/latest/binary_caches.html#spack-build-cache-for-github-actions | |
| name: Spack Ubunutu x86_64 Buildcache | |
| env: | |
| SPACK_COLOR: always | |
| REGISTRY: ghcr.io/pnnl | |
| # Our repo name contains upper case characters, so we can't use ${{ github.repository }} | |
| IMAGE_NAME: exago | |
| USERNAME: exago-bot | |
| BASE_VERSION: ubuntu-24.04-fortran-v0.1.0 | |
| # Until we remove the need to clone submodules to build, this should on be in PRs | |
| on: [pull_request] | |
| jobs: | |
| base_image_build: | |
| name: Build Custom Base Image | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # No GHCR base image with skopeo, so this will do... | |
| - name: "Set up skopeo" | |
| uses: warjiang/setup-skopeo@v0.1.3 | |
| with: | |
| version: latest | |
| # Use skopeo to check for image for convenience | |
| - name: Check for existing base images | |
| run: | | |
| set -e | |
| CONTAINER_TAG=${{ env.BASE_VERSION }} | |
| OCI_URL="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BASE_VERSION }}" | |
| echo Checking for CONTAINER_TAG $CONTAINER_TAG | |
| skopeo inspect \ | |
| docker://$OCI_URL \ | |
| --raw \ | |
| --creds "${{ env.USERNAME }}:${{ secrets.GITHUB_TOKEN }}" \ | |
| > /dev/null && echo "Image already exists. Please bump version." && exit 0 | |
| echo "IMAGE_EXISTS=false" >> $GITHUB_ENV | |
| # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ env.USERNAME }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Need to build custom base image with gfortran | |
| - name: Create Dockerfile heredoc | |
| if: ${{ env.IMAGE_EXISTS == 'false' }} | |
| run: | | |
| cat << EOF > Dockerfile | |
| FROM ubuntu:24.04 | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| software-properties-common \ | |
| gpg-agent \ | |
| openssh-client \ | |
| openssh-server \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \ | |
| apt-get install -y --no-install-recommends \ | |
| gfortran \ | |
| gcc \ | |
| libstdc++6 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| EOF | |
| - name: Extract metadata (tags, labels) for Docker | |
| if: ${{ env.IMAGE_EXISTS == 'false' }} | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| labels: org.opencontainers.image.version=${{ env.BASE_VERSION }} | |
| - name: Build and push Docker base image | |
| if: ${{ env.IMAGE_EXISTS == 'false' }} | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BASE_VERSION }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| exago_spack_builds: | |
| needs: base_image_build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| packages: write | |
| contents: read | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false # Prevents cancelling other jobs | |
| matrix: | |
| # Minimal Build(s) - GHCR mirror speeds these up a lot! | |
| spack_spec: | |
| # See #39 - ~python~mpi causes issues | |
| # - exago@develop~mpi~ipopt~hiop~python~raja | |
| # See #44 - +mpi~python should fail if no python in system, | |
| # but the runner happens to have one... | |
| - exago@develop+mpi~ipopt+hiop~python~raja ^openmpi ^hiop~raja~sparse | |
| # See #18 - +hiop~mpi causes issues | |
| # - exago@develop~mpi~ipopt+hiop~python+raja | |
| # See #16 - +python~mpi causes issues | |
| # - exago@develop~mpi~ipopt+hiop+python~raja | |
| # Python build in GH actions is failing. Using system python. | |
| # - exago@develop+mpi~ipopt+hiop+python~raja ^openmpi | |
| # See #40 - +hiop+raja~ipopt ^hiop~sparse is useful for edge cases | |
| - exago@develop+mpi~ipopt+hiop~python+raja ^openmpi ^hiop+raja~sparse | |
| - exago@develop+mpi+ipopt+hiop~python+raja ^openmpi ^hiop+raja~sparse | |
| - exago@develop+mpi+ipopt+hiop+python+raja ^openmpi ^hiop+raja~sparse | |
| - exago@develop+mpi+ipopt~hiop+python~raja ^openmpi | |
| name: Build ExaGO with Spack | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # Once we move submodule deps into spack, we can do some more builds | |
| # Also need to change build script to use spack from base image | |
| submodules: true | |
| - name: Setup Spack | |
| run: echo "$PWD/tpl/spack/bin" >> "$GITHUB_PATH" | |
| - name: Create heredoc spack.yaml | |
| run: | | |
| cat << EOF > spack.yaml | |
| spack: | |
| specs: | |
| - ${{ matrix.spack_spec }} target=x86_64_v2 | |
| concretizer: | |
| reuse: dependencies | |
| config: | |
| install_tree: | |
| root: /opt/spack | |
| padded_length: False | |
| mirrors: | |
| local-buildcache: | |
| url: oci://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| access_pair: | |
| id_variable: MIRROR_USERNAME | |
| secret_variable: MIRROR_TOKEN | |
| spack: https://binaries.spack.io/develop | |
| packages: | |
| ipopt: | |
| require: ~coinhsl+mumps # HSL requires a tar ball and a licence | |
| mumps: | |
| require: +mpi~openmp | |
| petsc: | |
| require: ~hypre~superlu-dist~hdf5+metis | |
| all: | |
| require: "%gcc" | |
| EOF | |
| - name: Configure GHCR mirror | |
| run: spack -e . mirror set local-buildcache | |
| - name: Trust keys | |
| run: spack -e . buildcache keys --install --trust | |
| - name: Find external packages | |
| run: spack -e . external find --all | |
| - name: Spack local repo | |
| run: spack -e . repo add buildsystem/spack/spack_repo/exago | |
| - name: Spack develop exago | |
| run: spack -e . develop --path=$(pwd) exago@develop | |
| - name: Concretize | |
| run: spack -e . concretize --fresh | |
| - name: Install dependencies | |
| run: spack -e . install --no-check-signature --only dependencies | |
| - name: Install package | |
| run: spack -e . install --no-check-signature --fail-fast --keep-stage --no-cache --fresh | |
| #- name: Test Build | |
| # run: cd $(spack -e . location --build-dir exago@develop) && ctest -VV | |
| # Push with force to override existing binaries... | |
| - name: Push binaries to buildcache | |
| env: | |
| MIRROR_USERNAME: ${{ env.USERNAME }} | |
| MIRROR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| spack -e . buildcache push --force --base-image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BASE_VERSION }} --unsigned --update-index local-buildcache | |
| if: ${{ !cancelled() }} |