How it works¶
Labs always run on Linux, next to Docker. The apps differ only in how they get there.
# Diagram only: how the apps reach a lab host. Not a deployable lab.
name: architecture
topology:
nodes:
vs-code: {kind: linux}
desktop-app: {kind: linux}
browser: {kind: linux}
web-app: {kind: linux}
containerlab: {kind: linux}
clab-api-server: {kind: linux}
spine: {kind: linux}
leaf1: {kind: linux}
leaf2: {kind: linux}
links:
- endpoints: [spine:e1-1, leaf1:e1-49]
- endpoints: [spine:e1-2, leaf2:e1-49]
# Diagram only: how the apps reach a lab host. Not a deployable lab.
name: architecture
topology:
nodes:
vs-code: {kind: linux}
desktop-app: {kind: linux}
browser: {kind: linux}
web-app: {kind: linux}
containerlab: {kind: linux}
clab-api-server: {kind: linux}
spine: {kind: linux}
leaf1: {kind: linux}
leaf2: {kind: linux}
links:
- endpoints: [spine:e1-1, leaf1:e1-49]
- endpoints: [spine:e1-2, leaf2:e1-49]clab-api-server on the lab host.VS Code runs containerlab directly, on whatever machine the extension runs on. With Remote SSH, that is the remote server, and your laptop only shows the window.
The desktop and web apps never touch Docker. They sign in to clab-api-server on the lab host, and the API server deploys labs, opens terminals, and captures packets there. One app can sign in to several lab hosts at once.
The browser sandbox has no lab host. It is the same editor, saving to your browser.
Two files per lab¶
A lab is a containerlab topology file. The editor adds a second file next to it for everything visual.
lab.clab.yml
Nodes, kinds, images, links, configuration. This is what containerlab deploys. Edit it on the canvas or as text; both stay in sync.
lab.clab.yml.annotations.json
Positions, icons, colors, groups, text, and display settings. Containerlab ignores it.
Your own config files
Startup configs and binds referenced from the YAML. The editor leaves them alone.
Moving a node changes only the annotations. Connecting two interfaces changes the YAML. Both files are plain text, so they work in Git and with the containerlab CLI.
The same topology, without and with its annotations file:
YAML only
name: fabric
topology:
defaults:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux:latest
nodes:
spine1:
type: ixrd3
spine2:
type: ixrd3
leaf1:
type: ixrd2
leaf2:
type: ixrd2
leaf3:
type: ixrd2
client1:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client2:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client3:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
links:
- endpoints: [spine1:e1-1, leaf1:e1-49]
- endpoints: [spine1:e1-2, leaf2:e1-49]
- endpoints: [spine1:e1-3, leaf3:e1-49]
- endpoints: [spine2:e1-1, leaf1:e1-50]
- endpoints: [spine2:e1-2, leaf2:e1-50]
- endpoints: [spine2:e1-3, leaf3:e1-50]
- endpoints: [leaf1:e1-1, client1:eth1]
- endpoints: [leaf2:e1-1, client2:eth1]
- endpoints: [leaf3:e1-1, client3:eth1]
name: fabric
topology:
defaults:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux:latest
nodes:
spine1:
type: ixrd3
spine2:
type: ixrd3
leaf1:
type: ixrd2
leaf2:
type: ixrd2
leaf3:
type: ixrd2
client1:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client2:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client3:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
links:
- endpoints: [spine1:e1-1, leaf1:e1-49]
- endpoints: [spine1:e1-2, leaf2:e1-49]
- endpoints: [spine1:e1-3, leaf3:e1-49]
- endpoints: [spine2:e1-1, leaf1:e1-50]
- endpoints: [spine2:e1-2, leaf2:e1-50]
- endpoints: [spine2:e1-3, leaf3:e1-50]
- endpoints: [leaf1:e1-1, client1:eth1]
- endpoints: [leaf2:e1-1, client2:eth1]
- endpoints: [leaf3:e1-1, client3:eth1]The editor picks a layout.
YAML + annotations
name: fabric
topology:
defaults:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux:latest
nodes:
spine1:
type: ixrd3
spine2:
type: ixrd3
leaf1:
type: ixrd2
leaf2:
type: ixrd2
leaf3:
type: ixrd2
client1:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client2:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client3:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
links:
- endpoints: [spine1:e1-1, leaf1:e1-49]
- endpoints: [spine1:e1-2, leaf2:e1-49]
- endpoints: [spine1:e1-3, leaf3:e1-49]
- endpoints: [spine2:e1-1, leaf1:e1-50]
- endpoints: [spine2:e1-2, leaf2:e1-50]
- endpoints: [spine2:e1-3, leaf3:e1-50]
- endpoints: [leaf1:e1-1, client1:eth1]
- endpoints: [leaf2:e1-1, client2:eth1]
- endpoints: [leaf3:e1-1, client3:eth1]
name: fabric
topology:
defaults:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux:latest
nodes:
spine1:
type: ixrd3
spine2:
type: ixrd3
leaf1:
type: ixrd2
leaf2:
type: ixrd2
leaf3:
type: ixrd2
client1:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client2:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
client3:
kind: linux
image: ghcr.io/srl-labs/network-multitool:latest
links:
- endpoints: [spine1:e1-1, leaf1:e1-49]
- endpoints: [spine1:e1-2, leaf2:e1-49]
- endpoints: [spine1:e1-3, leaf3:e1-49]
- endpoints: [spine2:e1-1, leaf1:e1-50]
- endpoints: [spine2:e1-2, leaf2:e1-50]
- endpoints: [spine2:e1-3, leaf3:e1-50]
- endpoints: [leaf1:e1-1, client1:eth1]
- endpoints: [leaf2:e1-1, client2:eth1]
- endpoints: [leaf3:e1-1, client3:eth1]Your positions and icons.
Editing a running lab¶
You can keep editing while a lab runs. The play button then shows that the file differs from what is deployed. Apply lists what containerlab would change, and applies it when you confirm. See Run a lab.
Labs open locked by default, so a stray drag changes nothing. Select the lock in the toolbar to start editing.