Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into sonic-healthcheck
Browse files Browse the repository at this point in the history
# Conflicts:
#	images/sonic/Dockerfile
#	images/sonic/launch.py
  • Loading branch information
robertvolkmann committed Jan 7, 2025
2 parents f0bc4cc + 5d2b188 commit 8b6f3b7
Show file tree
Hide file tree
Showing 12 changed files with 413 additions and 127 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
bash -c "$(curl -sL https://get.containerlab.dev)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# we can remove desired version again after this fix was released: https://github.com/srl-labs/containerlab/pull/2000
DESIRED_VERSION: v0.56.0
# set if required:
# DESIRED_VERSION: v0.59.0

- name: Log in to the container registry
uses: docker/login-action@v3
Expand Down
35 changes: 28 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ else ifeq ($(MINI_LAB_FLAVOR),sonic)
LAB_MACHINES=machine01,machine02
LAB_TOPOLOGY=mini-lab.sonic.yaml
VRF=Vrf20
else ifeq ($(MINI_LAB_FLAVOR),capms)
LAB_MACHINES=machine01,machine02,machine03
LAB_TOPOLOGY=mini-lab.capms.yaml
VRF=Vrf20
else
$(error Unknown flavor $(MINI_LAB_FLAVOR))
endif
Expand Down Expand Up @@ -83,7 +87,7 @@ partition: partition-bake
.PHONY: partition-bake
partition-bake: external_network
docker pull $(MINI_LAB_VM_IMAGE)
ifeq ($(MINI_LAB_FLAVOR),sonic)
ifneq ($(MINI_LAB_FLAVOR),cumulus)
docker pull $(MINI_LAB_SONIC_IMAGE)
endif
@if ! sudo $(CONTAINERLAB) --topo $(LAB_TOPOLOGY) inspect | grep -i leaf01 > /dev/null; then \
Expand Down Expand Up @@ -120,6 +124,7 @@ cleanup-partition:
mkdir -p clab-mini-lab
sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.cumulus.yaml
sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.sonic.yaml
sudo --preserve-env $(CONTAINERLAB) destroy --topo mini-lab.capms.yaml
docker network rm --force mini_lab_ext

.PHONY: _privatenet
Expand Down Expand Up @@ -171,17 +176,25 @@ ssh-leaf02:
start-machines:
docker exec vms /mini-lab/manage_vms.py --names $(LAB_MACHINES) create

.PHONY: kill-machines
kill-machines:
docker exec vms /mini-lab/manage_vms.py --names $(LAB_MACHINES) kill

.PHONY: _password
_password: env
docker compose run $(DOCKER_COMPOSE_RUN_ARG) metalctl machine consolepassword $(MACHINE_UUID)

.PHONY: password-machine01
password-machine01:
@$(MAKE) --no-print-directory _password MACHINE_UUID=e0ab02d2-27cd-5a5e-8efc-080ba80cf258
@$(MAKE) --no-print-directory _password MACHINE_NAME=machine01 MACHINE_UUID=00000000-0000-0000-0000-000000000001

.PHONY: password-machine02
password-machine02:
@$(MAKE) --no-print-directory _password MACHINE_UUID=2294c949-88f6-5390-8154-fa53d93a3313
@$(MAKE) --no-print-directory _password MACHINE_NAME=machine02 MACHINE_UUID=00000000-0000-0000-0000-000000000002

.PHONY: password-machine0%
password-machine0%:
@$(MAKE) --no-print-directory _password MACHINE_NAME=machine0$* MACHINE_UUID=00000000-0000-0000-0000-00000000000$*

.PHONY: _free-machine
_free-machine: env
Expand All @@ -191,11 +204,15 @@ _free-machine: env

.PHONY: free-machine01
free-machine01:
@$(MAKE) --no-print-directory _free-machine MACHINE_NAME=machine01 MACHINE_UUID=e0ab02d2-27cd-5a5e-8efc-080ba80cf258
@$(MAKE) --no-print-directory _free-machine MACHINE_NAME=machine01 MACHINE_UUID=00000000-0000-0000-0000-000000000001

.PHONY: free-machine02
free-machine02:
@$(MAKE) --no-print-directory _free-machine MACHINE_NAME=machine02 MACHINE_UUID=2294c949-88f6-5390-8154-fa53d93a3313
@$(MAKE) --no-print-directory _free-machine MACHINE_NAME=machine02 MACHINE_UUID=00000000-0000-0000-0000-000000000002

.PHONY: free-machine0%
free-machine0%:
@$(MAKE) --no-print-directory _free-machine MACHINE_NAME=machine0$* MACHINE_UUID=00000000-0000-0000-0000-00000000000$*

.PHONY: _console-machine
_console-machine:
Expand All @@ -204,11 +221,15 @@ _console-machine:

.PHONY: console-machine01
console-machine01:
@$(MAKE) --no-print-directory _console-machine CONSOLE_PORT=4000
@$(MAKE) --no-print-directory _console-machine CONSOLE_PORT=4001

.PHONY: console-machine02
console-machine02:
@$(MAKE) --no-print-directory _console-machine CONSOLE_PORT=4001
@$(MAKE) --no-print-directory _console-machine CONSOLE_PORT=4002

.PHONY: console-machine0%
console-machine0%:
@$(MAKE) --no-print-directory _console-machine CONSOLE_PORT=400$*

## SSH TARGETS FOR MACHINES ##
# Python code could be replaced by jq, but it is not preinstalled on Cumulus
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ After the deployment and waiting for a short amount of time, two machines in sta
docker compose run --rm metalctl machine ls

ID LAST EVENT WHEN AGE HOSTNAME PROJECT SIZE IMAGE PARTITION
e0ab02d2-27cd-5a5e-8efc-080ba80cf258   PXE Booting 3s
2294c949-88f6-5390-8154-fa53d93a3313 PXE Booting 5s
00000000-0000-0000-0000-000000000001   PXE Booting 3s
00000000-0000-0000-0000-000000000002 PXE Booting 5s
```

Wait until the machines reach the waiting state:
Expand All @@ -100,8 +100,8 @@ Wait until the machines reach the waiting state:
docker compose run --rm metalctl machine ls

ID LAST EVENT WHEN AGE HOSTNAME PROJECT SIZE IMAGE PARTITION
e0ab02d2-27cd-5a5e-8efc-080ba80cf258   Waiting 8s v1-small-x86 mini-lab
2294c949-88f6-5390-8154-fa53d93a3313   Waiting 8s v1-small-x86 mini-lab
00000000-0000-0000-0000-000000000001   Waiting 8s v1-small-x86 mini-lab
00000000-0000-0000-0000-000000000002   Waiting 8s v1-small-x86 mini-lab
```

Create a firewall and a machine with:
Expand Down Expand Up @@ -157,14 +157,14 @@ Two machines are now installed and have status "Phoned Home"
```bash
docker compose run --rm metalctl machine ls
ID LAST EVENT WHEN AGE HOSTNAME PROJECT SIZE IMAGE PARTITION
e0ab02d2-27cd-5a5e-8efc-080ba80cf258   Phoned Home 2s 21s machine 00000000-0000-0000-0000-000000000000 v1-small-x86 Ubuntu 20.04 20200331 mini-lab
2294c949-88f6-5390-8154-fa53d93a3313   Phoned Home 8s 18s fw 00000000-0000-0000-0000-000000000000 v1-small-x86 Firewall 2 Ubuntu 20200730 mini-lab
00000000-0000-0000-0000-000000000001   Phoned Home 2s 21s machine 00000000-0000-0000-0000-000000000000 v1-small-x86 Ubuntu 20.04 20200331 mini-lab
00000000-0000-0000-0000-000000000002   Phoned Home 8s 18s fw 00000000-0000-0000-0000-000000000000 v1-small-x86 Firewall 2 Ubuntu 20200730 mini-lab
```

Login with user name metal and the console password from

```bash
docker compose run --rm metalctl machine consolepassword e0ab02d2-27cd-5a5e-8efc-080ba80cf258
docker compose run --rm metalctl machine consolepassword 00000000-0000-0000-0000-000000000001
```

To remove the kind cluster, the switches and machines, run:
Expand All @@ -180,15 +180,15 @@ Reinstall a machine with
```bash
docker compose run --rm metalctl machine reinstall \
--image ubuntu-20.04 \
e0ab02d2-27cd-5a5e-8efc-080ba80cf258
00000000-0000-0000-0000-000000000001
```

### Free machine

Free a machine with `make free-machine01` or

```bash
docker compose run --rm metalctl machine rm e0ab02d2-27cd-5a5e-8efc-080ba80cf258
docker compose run --rm metalctl machine rm 00000000-0000-0000-0000-000000000001
```

## Flavors
Expand Down
2 changes: 1 addition & 1 deletion images/sonic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ COPY --from=ghcr.io/metal-stack/mini-lab-sonic:base /frr-pythontools.deb /frr-py

ENTRYPOINT ["/launch.py"]

COPY config_db.json mirror_tap_to_eth.sh launch.py /
COPY mirror_tap_to_eth.sh mirror_tap_to_front_panel.sh port_config.ini launch.py /

HEALTHCHECK --start-period=10s --interval=5s --retries=20 CMD test -f /healthy
69 changes: 0 additions & 69 deletions images/sonic/config_db.json

This file was deleted.

Loading

0 comments on commit 8b6f3b7

Please sign in to comment.