From 8824ccc8987982166721700766211e1f66d823aa Mon Sep 17 00:00:00 2001 From: fruffy Date: Mon, 27 Jul 2026 22:24:43 +0200 Subject: [PATCH 1/2] Fixed installed BMv2 dependencies for the docker image. Signed-off-by: fruffy --- .github/workflows/build.yml | 12 ++++++++---- Dockerfile | 10 +++++----- Dockerfile.noPI | 11 ++++++----- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b51764f2..cea5095cf 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 \ @@ -67,7 +68,8 @@ jobs: push: true tags: p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }} 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 build-no-pi: if: ${{ github.repository == 'p4lang/behavioral-model' && github.ref == 'refs/heads/main' }} @@ -88,7 +90,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 \ @@ -106,4 +109,5 @@ jobs: push: true tags: p4lang/behavioral-model:no-pi 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 diff --git a/Dockerfile b/Dockerfile index 58480ad2b..e40327a5a 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 501845103..85298e104 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 \ From c3b2259adf03fac15845f3a0355d686b720ea3e8 Mon Sep 17 00:00:00 2001 From: fruffy Date: Mon, 27 Jul 2026 22:53:45 +0200 Subject: [PATCH 2/2] Add a sanity test before pushing. Signed-off-by: fruffy --- .github/workflows/build.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cea5095cf..17794456e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: tags: p4lang/behavioral-model:test-build build-args: IMAGE_TYPE=test cache-from: type=gha - # A cache write must not fail the build. + # A cache write must not fail the build. cache-to: type=gha,mode=max,ignore-error=true - name: Run tests in Docker image run: | @@ -61,15 +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: . - push: true + 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 build-no-pi: if: ${{ github.repository == 'p4lang/behavioral-model' && github.ref == 'refs/heads/main' }} @@ -101,13 +112,24 @@ 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 - push: true + 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: . + file: Dockerfile.noPI + push: true + tags: p4lang/behavioral-model:no-pi + cache-from: type=gha