From ef884af4f574018a2c5ebfada4791552ab33f755 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Sat, 2 Mar 2024 14:56:22 -0700 Subject: [PATCH] Attempt to use colima to run docker on mac --- .github/workflows/build.yml | 8 +- .github/workflows/container.yml | 137 ++++++++++++++++--------- .github/workflows/documentation-ci.yml | 5 +- .github/workflows/documentation.yml | 4 +- 4 files changed, 97 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfb684a..2ba87f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ name: CI on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + # push: + # branches: [ "master" ] + # pull_request: + # branches: [ "master" ] workflow_dispatch: diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index f00039c..c6d3470 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -16,57 +16,96 @@ env: jobs: - container: - runs-on: ubuntu-latest - timeout-minutes: 300 + # container: + # runs-on: ubuntu-latest + # timeout-minutes: 300 + + # steps: + # - name: Check out + # if: always() + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # # - uses: hadolint/hadolint-action@v3.1.0 + # # with: + # # dockerfile: Dockerfile + # # ignore: 'DL3008,DL3013' + # # verbose: true + + # - name: Build Image + # id: build_image + # uses: redhat-actions/buildah-build@v2 + # with: + # image: ${{ env.IMAGE_NAME }} + # tags: ${{ env.IMAGE_TAGS }} + # containerfiles: | + # ./Dockerfile + # build-args: | + # PYNUCLEUS_BUILD_PARALLELISM=4 + + # - name: Run tests + # run: | + # podman run \ + # -e MPIEXEC_FLAGS="--allow-run-as-root --oversubscribe" \ + # --workdir /pynucleus \ + # --rm \ + # --entrypoint='["python3", "-m", "pytest", "--junit-xml", "test-results.xml"]' \ + # ${{ steps.build_image.outputs.image }}:${{ github.sha }} + + # - name: Push To GHCR + # if: github.event_name == 'push' + # uses: redhat-actions/push-to-registry@v2 + # id: push + # with: + # image: ${{ steps.build_image.outputs.image }} + # tags: ${{ steps.build_image.outputs.tags }} + # registry: ${{ env.IMAGE_REGISTRY }} + # username: ${{ env.REGISTRY_USER }} + # password: ${{ env.REGISTRY_PASSWORD }} + # extra-args: | + # --disable-content-trust + + # - name: Echo outputs + # if: github.event_name == 'push' + # run: | + # echo "${{ toJSON(steps.push.outputs) }}" + + # container-test: + # needs: container + # if: github.event_name == 'push' + + # strategy: + # matrix: + # include: + # - runner: 'ubuntu-latest' + + # name: Container test ${{ matrix.runner }} + # runs-on: ${{ matrix.runner }} + + # steps: + # - name: Check out + # uses: actions/checkout@v4 + + # - name: Install podman-compose + # run: pip install podman-compose + + # - name: Run container test + # run: podman-compose run quick-test + + container-test-mac: + # needs: container + # if: github.event_name == 'push' + + name: Container test MacOS + runs-on: macos-latest steps: - name: Check out - if: always() uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # - uses: hadolint/hadolint-action@v3.1.0 - # with: - # dockerfile: Dockerfile - # ignore: 'DL3008,DL3013' - # verbose: true - - - name: Build Image - id: build_image - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_TAGS }} - containerfiles: | - ./Dockerfile - build-args: | - PYNUCLEUS_BUILD_PARALLELISM=4 - - - name: Run tests - run: | - podman run \ - -e MPIEXEC_FLAGS="--allow-run-as-root --oversubscribe" \ - --workdir /pynucleus \ - --rm \ - --entrypoint='["python3", "-m", "pytest", "--junit-xml", "test-results.xml"]' \ - ${{ steps.build_image.outputs.image }}:${{ github.sha }} - - - name: Push To GHCR - if: github.event_name == 'push' - uses: redhat-actions/push-to-registry@v2 - id: push - with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ env.IMAGE_REGISTRY }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} - extra-args: | - --disable-content-trust - - - name: Echo outputs - if: github.event_name == 'push' + + - name: Run container run: | - echo "${{ toJSON(steps.push.outputs) }}" + brew install docker && \ + colima start --runtime docker && \ + docker run --entrypoint="mpiexec -n 4 /pynucleus/drivers/runFractional.py" ghcr.io/sandialabs/pynucleus:latest diff --git a/.github/workflows/documentation-ci.yml b/.github/workflows/documentation-ci.yml index 0513ff7..34b9032 100644 --- a/.github/workflows/documentation-ci.yml +++ b/.github/workflows/documentation-ci.yml @@ -1,8 +1,9 @@ name: Documentation CI on: - pull_request: - branches: [ "master" ] + # pull_request: + # branches: [ "master" ] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 15a83d9..22c4f11 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,8 +1,8 @@ name: Documentation on: - push: - branches: [ "master" ] + # push: + # branches: [ "master" ] workflow_dispatch: permissions: