Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a health check for SONiC to enable the measurement of its startup time #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robertvolkmann
Copy link
Contributor

Description

Set up a stage execution in the topology as follows:

    leaf01:
      kind: linux
      image: ${MINI_LAB_SONIC_IMAGE}
      labels:
        ansible-group: sonic
      binds:
        - /dev:/dev
        - files/ssh/id_rsa.pub:/authorized_keys
      stages:
        healthy:
          exec:
            - command: date
              phase: on-exit

You can now measure the startup time using the command:

$ time make partition-bake 
INFO[0000] Parsing & checking topology file: mini-lab.sonic.yaml 
Error: failed to list containers: could not get container for node www: Node: www. containers not found
INFO[0000] Containerlab v0.59.0 started                 
INFO[0000] Parsing & checking topology file: mini-lab.sonic.yaml 
INFO[0000] Removing /home/robert/src/mini-lab/clab-mini-lab directory... 
INFO[0000] Creating lab directory: /home/robert/src/mini-lab/clab-mini-lab 
INFO[0000] Creating container: "inet"                   
INFO[0000] Creating container: "leaf01"                 
INFO[0000] Creating container: "www"                    
INFO[0000] Creating container: "leaf02"                 
INFO[0000] Creating container: "vms"                    
INFO[0000] Created link: www:ext <--> mini_lab_ext:www  
INFO[0000] failed to disable TX checksum offload for eth0 interface for www container 
INFO[0000] Created link: inet:ext <--> mini_lab_ext:inet 
INFO[0001] Created link: leaf02:eth3 <--> inet:eth2     
INFO[0001] Created link: leaf01:eth1 <--> vms:lan0      
INFO[0001] Created link: leaf02:eth1 <--> vms:lan1      
INFO[0001] Created link: leaf01:eth3 <--> inet:eth1     
INFO[0001] Created link: leaf01:eth2 <--> vms:lan2      
INFO[0001] Created link: leaf02:eth2 <--> vms:lan3      
INFO[0047] node "leaf01" turned healthy, continuing     
INFO[0047] Executed command "date" on the node "leaf01". stdout:
Tue Oct 29 21:29:36 UTC 2024 
INFO[0047] Executed command "ip addr add 203.0.113.3/24 dev ext" on the node "www". stdout: 
INFO[0047] Executed command "ip route add 203.0.113.128/25 via 203.0.113.2 dev ext" on the node "www". stdout: 
INFO[0047] Executed command "sh /root/network.sh" on the node "inet". stdout: 
INFO[0047] Adding containerlab host entries to /etc/hosts file 
INFO[0047] Adding ssh config for containerlab nodes     
+---+--------+--------------+-----------------------------------------+-------+---------+---------------+--------------+
| # |  Name  | Container ID |                  Image                  | Kind  |  State  | IPv4 Address  | IPv6 Address |
+---+--------+--------------+-----------------------------------------+-------+---------+---------------+--------------+
| 1 | inet   | e2c4deaab41e | quay.io/frrouting/frr:10.0.1            | linux | running | 172.17.0.2/16 | N/A          |
| 2 | leaf01 | c9f03188e1d5 | ghcr.io/metal-stack/mini-lab-sonic:test | linux | running | 172.17.0.4/16 | N/A          |
| 3 | leaf02 | 1acd8ca009ba | ghcr.io/metal-stack/mini-lab-sonic:test | linux | running | 172.17.0.3/16 | N/A          |
| 4 | vms    | c94cf793b67c | ghcr.io/metal-stack/mini-lab-vms:latest | linux | running | 172.17.0.5/16 | N/A          |
| 5 | www    | b790587f178c | docker.io/library/nginx:alpine-slim     | linux | running | N/A           | N/A          |
+---+--------+--------------+-----------------------------------------+-------+---------+---------------+--------------+

real	0m47,823s
user	0m0,057s
sys	0m0,131s

@robertvolkmann robertvolkmann requested a review from a team as a code owner October 29, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant