From a5797aa854f9759a0ad629a3dfc815dd0b1cfe1b Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 23 Jul 2025 12:43:45 +0200 Subject: [PATCH 01/10] Pull base image before building --- .github/workflows/integration.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 754b0007..e9b941f0 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -41,6 +41,7 @@ jobs: uses: docker/build-push-action@v6 with: context: ./images/machine + pull: true push: true sbom: true tags: ${{ env.MINI_LAB_VM_IMAGE }} @@ -76,6 +77,7 @@ jobs: uses: docker/build-push-action@v6 with: context: ./images/sonic + pull: true push: true sbom: true tags: ${{ env.MINI_LAB_SONIC_IMAGE }} From 64096924c0188bd0e66be6cb71cb3346364e8593 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 23 Jul 2025 16:10:50 +0200 Subject: [PATCH 02/10] Use new SONiC image. --- Makefile | 3 +++ images/sonic/Dockerfile | 4 ++-- images/sonic/base/Dockerfile | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 520cd053..3f0aa77e 100644 --- a/Makefile +++ b/Makefile @@ -353,6 +353,9 @@ test-connectivity-to-external-service-via-ipv6: fi; \ done +.PHONY: build-sonic-base +build-sonic-base: + cd images/sonic/base && docker build -t ghcr.io/metal-stack/mini-lab-sonic:base . ## DEV TARGETS ## diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index c3d8a30a..0ee3e14b 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base-202411 /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base-202411 /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] diff --git a/images/sonic/base/Dockerfile b/images/sonic/base/Dockerfile index 2bf9980c..f863475b 100644 --- a/images/sonic/base/Dockerfile +++ b/images/sonic/base/Dockerfile @@ -1,7 +1,7 @@ # Check: https://sonic-build.azurewebsites.net/ui/sonic/pipelines -ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202311&platform=vs +ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202411&platform=vs ARG SONIC_IMG_URL=${SONIC_BASE_URL}&target=target%2Fsonic-vs.img.gz -ARG FRR_RELOAD_URL=${SONIC_BASE_URL}&target=target%2Fdebs%2Fbullseye%2Ffrr-pythontools_8.5.1-sonic-0_all.deb +ARG FRR_RELOAD_URL=${SONIC_BASE_URL}&target=target%2Fdebs%2Fbookworm%2Ffrr-pythontools_10.0.1-sonic-0_all.deb FROM docker.io/library/busybox:stable AS download From 194362887f504240b306a7865c684313e822de82 Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Wed, 24 Sep 2025 17:59:17 +0200 Subject: [PATCH 03/10] build base images for multiple sonic community versions as source - use 202411 for mini-lab-sonic --- .github/workflows/base-image.yaml | 17 +++++++------ Makefile | 3 ++- images/sonic/Dockerfile | 4 +-- images/sonic/base-202311/Dockerfile | 25 +++++++++++++++++++ images/sonic/{base => base-202411}/Dockerfile | 0 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 images/sonic/base-202311/Dockerfile rename images/sonic/{base => base-202411}/Dockerfile (100%) diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index 986fa751..a3d0f880 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -10,6 +10,12 @@ jobs: name: build mini-lab-sonic base image runs-on: ubuntu-latest + strategy: + matrix: + flavors: + - name: 202311 + - name: 202411 + steps: - name: Log in to the container registry uses: docker/login-action@v3 @@ -21,18 +27,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Make tag - run: | - git fetch --tags - echo "tag=$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD)" >> $GITHUB_ENV - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push mini-lab-sonic container + - name: Build and push mini-lab-sonic-base container uses: docker/build-push-action@v6 with: push: true sbom: true - file: images/sonic/base/Dockerfile - tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ env.tag }} + file: images/sonic/base-${{ matrix.flavors.name }}/Dockerfile + tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ matrix.flavors.name }} diff --git a/Makefile b/Makefile index 3f0aa77e..f1dd7043 100644 --- a/Makefile +++ b/Makefile @@ -355,7 +355,8 @@ test-connectivity-to-external-service-via-ipv6: .PHONY: build-sonic-base build-sonic-base: - cd images/sonic/base && docker build -t ghcr.io/metal-stack/mini-lab-sonic:base . + cd images/sonic/base-202311 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202311 . + cd images/sonic/base-202411 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202411 . ## DEV TARGETS ## diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index 0ee3e14b..cebb7343 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base-202411 /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base-202411 /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202411 /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202411 /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] diff --git a/images/sonic/base-202311/Dockerfile b/images/sonic/base-202311/Dockerfile new file mode 100644 index 00000000..2bf9980c --- /dev/null +++ b/images/sonic/base-202311/Dockerfile @@ -0,0 +1,25 @@ +# Check: https://sonic-build.azurewebsites.net/ui/sonic/pipelines +ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202311&platform=vs +ARG SONIC_IMG_URL=${SONIC_BASE_URL}&target=target%2Fsonic-vs.img.gz +ARG FRR_RELOAD_URL=${SONIC_BASE_URL}&target=target%2Fdebs%2Fbullseye%2Ffrr-pythontools_8.5.1-sonic-0_all.deb + +FROM docker.io/library/busybox:stable AS download + +ARG SONIC_IMG_URL +ARG FRR_RELOAD_URL + +ADD "${SONIC_IMG_URL}" /sonic-vs.img.gz +ADD "${FRR_RELOAD_URL}" /frr-pythontools.deb + +RUN gunzip /sonic-vs.img.gz + +FROM scratch + +ARG SONIC_IMG_URL +ARG FRR_RELOAD_URL + +LABEL sonic-img-url=${SONIC_IMG_URL} \ + frr-reload-url=${FRR_RELOAD_URL} + +COPY --from=download /frr-pythontools.deb /frr-pythontools.deb +COPY --from=download /sonic-vs.img /sonic-vs.img diff --git a/images/sonic/base/Dockerfile b/images/sonic/base-202411/Dockerfile similarity index 100% rename from images/sonic/base/Dockerfile rename to images/sonic/base-202411/Dockerfile From f55ad59914c73095dfb54bc7470534adec5f0ee6 Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Wed, 24 Sep 2025 18:25:44 +0200 Subject: [PATCH 04/10] temporarily switch to ghcr.io/metal-stack/mini-lab-sonic-base:master to run integ tests --- images/sonic/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index cebb7343..53268007 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202411 /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202411 /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] From 9de8fc58d62982e2fa7362f3fbeab70ee2179aae Mon Sep 17 00:00:00 2001 From: mwindower Date: Thu, 25 Sep 2025 09:02:57 +0200 Subject: [PATCH 05/10] Update Makefile Co-authored-by: Gerrit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f1dd7043..1e5da178 100644 --- a/Makefile +++ b/Makefile @@ -355,8 +355,8 @@ test-connectivity-to-external-service-via-ipv6: .PHONY: build-sonic-base build-sonic-base: - cd images/sonic/base-202311 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202311 . - cd images/sonic/base-202411 && docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202411 . + docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202311 images/sonic/base-202311 + docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202411 images/sonic/base-202411 ## DEV TARGETS ## From 3f38ea2ec04eab667a568031f3fdc9f3e0e65702 Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Thu, 25 Sep 2025 09:59:06 +0200 Subject: [PATCH 06/10] use 202505 --- .github/workflows/base-image.yaml | 6 +++--- Makefile | 1 + images/sonic/Dockerfile | 4 ++-- images/sonic/base-202505/Dockerfile | 25 +++++++++++++++++++++++++ roles/sonic/tasks/frr-reload.yaml | 2 +- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 images/sonic/base-202505/Dockerfile diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index a3d0f880..c0a6174c 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - flavors: + versions: - name: 202311 - name: 202411 @@ -35,5 +35,5 @@ jobs: with: push: true sbom: true - file: images/sonic/base-${{ matrix.flavors.name }}/Dockerfile - tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ matrix.flavors.name }} + file: images/sonic/base-${{ matrix.versions.name }}/Dockerfile + tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ matrix.versions.name }} diff --git a/Makefile b/Makefile index 1e5da178..1ae82fcf 100644 --- a/Makefile +++ b/Makefile @@ -357,6 +357,7 @@ test-connectivity-to-external-service-via-ipv6: build-sonic-base: docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202311 images/sonic/base-202311 docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202411 images/sonic/base-202411 + docker build -t ghcr.io/metal-stack/mini-lab-sonic-base:202505 images/sonic/base-202505 ## DEV TARGETS ## diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index 53268007..fe262415 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] diff --git a/images/sonic/base-202505/Dockerfile b/images/sonic/base-202505/Dockerfile new file mode 100644 index 00000000..632cdc0a --- /dev/null +++ b/images/sonic/base-202505/Dockerfile @@ -0,0 +1,25 @@ +# Check: https://sonic-build.azurewebsites.net/ui/sonic/pipelines +ARG SONIC_BASE_URL=https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202505&platform=vs +ARG SONIC_IMG_URL=${SONIC_BASE_URL}&target=target%2Fsonic-vs.img.gz +ARG FRR_RELOAD_URL=${SONIC_BASE_URL}&target=target%2Fdebs%2Fbookworm%2Ffrr-pythontools_10.3-sonic-0_all.deb + +FROM docker.io/library/busybox:stable AS download + +ARG SONIC_IMG_URL +ARG FRR_RELOAD_URL + +ADD "${SONIC_IMG_URL}" /sonic-vs.img.gz +ADD "${FRR_RELOAD_URL}" /frr-pythontools.deb + +RUN gunzip /sonic-vs.img.gz + +FROM scratch + +ARG SONIC_IMG_URL +ARG FRR_RELOAD_URL + +LABEL sonic-img-url=${SONIC_IMG_URL} \ + frr-reload-url=${FRR_RELOAD_URL} + +COPY --from=download /frr-pythontools.deb /frr-pythontools.deb +COPY --from=download /sonic-vs.img /sonic-vs.img diff --git a/roles/sonic/tasks/frr-reload.yaml b/roles/sonic/tasks/frr-reload.yaml index 8164a1a5..915b9029 100644 --- a/roles/sonic/tasks/frr-reload.yaml +++ b/roles/sonic/tasks/frr-reload.yaml @@ -1,7 +1,7 @@ --- - name: Wait until the bgpd is up ansible.builtin.wait_for: - port: 2605 + port: 2601 state: started - name: Copy frr-pythontools into container From f57b9613654389aa7559113db2e1c7982af52f2b Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Thu, 25 Sep 2025 12:15:07 +0200 Subject: [PATCH 07/10] use metal-core branch --- inventories/group_vars/all/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventories/group_vars/all/images.yaml b/inventories/group_vars/all/images.yaml index f79bfd9f..e9d72faa 100644 --- a/inventories/group_vars/all/images.yaml +++ b/inventories/group_vars/all/images.yaml @@ -21,7 +21,7 @@ setup_yaml: # metal_console_image_name: # metal_console_image_tag: # metal_core_image_name: -# metal_core_image_tag: +metal_core_image_tag: vni-filter-fix # headscale_image_tag: v0.26.1 # headscale_db_backup_restore_sidecar_image_tag: latest # headscale_db_backup_restore_sidecar_image_name: ghcr.io/metal-stack/backup-restore-sidecar From 5c4d531ca301890a0a775216cc359d099a9dd062 Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Thu, 25 Sep 2025 13:12:43 +0200 Subject: [PATCH 08/10] restarting bgp on leaves helps --- Makefile | 4 ++++ images/sonic/Dockerfile | 4 ++-- inventories/group_vars/all/images.yaml | 2 +- mini-lab.sonic.yaml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1ae82fcf..5c2af20f 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,10 @@ up: env gen-certs control-plane-bake partition-bake sleep 10 ssh -F files/ssh/config leaf01 'systemctl restart metal-core' ssh -F files/ssh/config leaf02 'systemctl restart metal-core' +# TODO: for community SONiC versions > 202311 a bgp restart is needed in the virtual environment + sleep 10 + ssh -F files/ssh/config leaf01 'systemctl restart bgp' + ssh -F files/ssh/config leaf02 'systemctl restart bgp' .PHONY: restart restart: down up diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index fe262415..53268007 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] diff --git a/inventories/group_vars/all/images.yaml b/inventories/group_vars/all/images.yaml index e9d72faa..f79bfd9f 100644 --- a/inventories/group_vars/all/images.yaml +++ b/inventories/group_vars/all/images.yaml @@ -21,7 +21,7 @@ setup_yaml: # metal_console_image_name: # metal_console_image_tag: # metal_core_image_name: -metal_core_image_tag: vni-filter-fix +# metal_core_image_tag: # headscale_image_tag: v0.26.1 # headscale_db_backup_restore_sidecar_image_tag: latest # headscale_db_backup_restore_sidecar_image_name: ghcr.io/metal-stack/backup-restore-sidecar diff --git a/mini-lab.sonic.yaml b/mini-lab.sonic.yaml index 9ce9ba71..eb33236f 100644 --- a/mini-lab.sonic.yaml +++ b/mini-lab.sonic.yaml @@ -9,7 +9,7 @@ topology: kind: linux nodes: exit: - image: quay.io/frrouting/frr:10.0.1 + image: quay.io/frrouting/frr:10.3.0 network-mode: none binds: - files/exit/daemons:/etc/frr/daemons From f7f718a84aff818f34eea16ed6ee9d59130abc7f Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Thu, 25 Sep 2025 14:10:45 +0200 Subject: [PATCH 09/10] use mini-lab-sonic-base:202505 --- images/sonic/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/sonic/Dockerfile b/images/sonic/Dockerfile index 53268007..fe262415 100644 --- a/images/sonic/Dockerfile +++ b/images/sonic/Dockerfile @@ -14,8 +14,8 @@ RUN apt-get update && \ qemu-system-x86 \ telnet -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /sonic-vs.img /sonic-vs.img -COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:master /frr-pythontools.deb /frr-pythontools.deb +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /sonic-vs.img /sonic-vs.img +COPY --from=ghcr.io/metal-stack/mini-lab-sonic-base:202505 /frr-pythontools.deb /frr-pythontools.deb ENTRYPOINT ["/launch.py"] From 337c58def817e682a56b23c19b5d0c123d2d6aa5 Mon Sep 17 00:00:00 2001 From: Markus Fensterer Date: Thu, 25 Sep 2025 14:14:08 +0200 Subject: [PATCH 10/10] comment about zebra port --- roles/sonic/tasks/frr-reload.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sonic/tasks/frr-reload.yaml b/roles/sonic/tasks/frr-reload.yaml index 915b9029..76723923 100644 --- a/roles/sonic/tasks/frr-reload.yaml +++ b/roles/sonic/tasks/frr-reload.yaml @@ -1,6 +1,7 @@ --- - name: Wait until the bgpd is up ansible.builtin.wait_for: + # this it the zebra port - it changed in version 202505 from 2605 to 2601 port: 2601 state: started