Skip to content
17 changes: 9 additions & 8 deletions .github/workflows/base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
name: build mini-lab-sonic base image
runs-on: ubuntu-latest

strategy:
matrix:
versions:
- name: 202311
- name: 202411

steps:
- name: Log in to the container registry
uses: docker/login-action@v3
Expand All @@ -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.versions.name }}/Dockerfile
tags: ${{ env.REGISTRY }}/metal-stack/mini-lab-sonic-base:${{ matrix.versions.name }}
2 changes: 2 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -353,6 +357,11 @@ test-connectivity-to-external-service-via-ipv6:
fi; \
done

.PHONY: build-sonic-base
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 ##

Expand Down
4 changes: 2 additions & 2 deletions images/sonic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: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"]

Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions images/sonic/base-202411/Dockerfile
Original file line number Diff line number Diff line change
@@ -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=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%2Fbookworm%2Ffrr-pythontools_10.0.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
25 changes: 25 additions & 0 deletions images/sonic/base-202505/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion mini-lab.sonic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion roles/sonic/tasks/frr-reload.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Wait until the bgpd is up
ansible.builtin.wait_for:
port: 2605
# this it the zebra port - it changed in version 202505 from 2605 to 2601
port: 2601
state: started

- name: Copy frr-pythontools into container
Expand Down
Loading