diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b51764f..17794456 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,8 @@ jobs: tags: p4lang/behavioral-model:test-build build-args: IMAGE_TYPE=test cache-from: type=gha - cache-to: type=gha,mode=max + # A cache write must not fail the build. + cache-to: type=gha,mode=max,ignore-error=true - name: Run tests in Docker image run: | docker run --rm p4lang/behavioral-model:test-build \ @@ -60,14 +61,26 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push production image + - name: Build production image + uses: docker/build-push-action@v7 + with: + context: . + load: true + tags: p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }} + cache-from: type=gha + # A cache write must not fail the build. + cache-to: type=gha,mode=max,ignore-error=true + - name: Smoke test production image + run: | + docker run --rm p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }} \ + simple_switch --version + - name: Push production image uses: docker/build-push-action@v7 with: context: . push: true tags: p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }} cache-from: type=gha - cache-to: type=gha,mode=max build-no-pi: if: ${{ github.repository == 'p4lang/behavioral-model' && github.ref == 'refs/heads/main' }} @@ -88,7 +101,8 @@ jobs: tags: p4lang/behavioral-model:test-build-no-pi build-args: IMAGE_TYPE=test cache-from: type=gha - cache-to: type=gha,mode=max + # A cache write must not fail the build. + cache-to: type=gha,mode=max,ignore-error=true - name: Run tests in Docker image run: | docker run --rm p4lang/behavioral-model:test-build-no-pi \ @@ -98,7 +112,20 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push no-PI production image + - name: Build no-PI production image + uses: docker/build-push-action@v7 + with: + context: . + file: Dockerfile.noPI + load: true + tags: p4lang/behavioral-model:no-pi + cache-from: type=gha + # A cache write must not fail the build. + cache-to: type=gha,mode=max,ignore-error=true + - name: Smoke test no-PI production image + run: | + docker run --rm p4lang/behavioral-model:no-pi simple_switch --version + - name: Push no-PI production image uses: docker/build-push-action@v7 with: context: . @@ -106,4 +133,3 @@ jobs: push: true tags: p4lang/behavioral-model:no-pi cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 58480ad2..e40327a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -ARG PARENT_VERSION=latest-24 +ARG PARENT_VERSION=latest FROM p4lang/pi:${PARENT_VERSION} LABEL maintainer="P4 Developers " @@ -33,10 +33,10 @@ ENV BM_DEPS build-essential \ libjsoncpp-dev \ libxxhash-dev \ pkg-config -ENV BM_RUNTIME_DEPS libboost-program-options1.74.0 \ - libboost-system1.74.0 \ - libboost-filesystem1.74.0 \ - libboost-thread1.74.0 \ +ENV BM_RUNTIME_DEPS libboost-program-options1.83.0 \ + libboost-system1.83.0 \ + libboost-filesystem1.83.0 \ + libboost-thread1.83.0 \ libgmp10 \ libpcap0.8t64 \ libxxhash0 \ diff --git a/Dockerfile.noPI b/Dockerfile.noPI index 50184510..85298e10 100644 --- a/Dockerfile.noPI +++ b/Dockerfile.noPI @@ -26,12 +26,13 @@ ENV BM_DEPS build-essential \ libboost-thread-dev \ libjsoncpp-dev \ libxxhash-dev -ENV BM_RUNTIME_DEPS libboost-program-options1.74.0 \ - libboost-system1.74.0 \ - libboost-filesystem1.74.0 \ - libboost-thread1.74.0 \ +ENV BM_RUNTIME_DEPS libboost-program-options1.83.0 \ + libboost-system1.83.0 \ + libboost-filesystem1.83.0 \ + libboost-thread1.83.0 \ libgmp10 \ - libpcap0.8 \ + libpcap0.8t64 \ + libjsoncpp25 \ libxxhash0 \ python3 \ python3-six \