Skip to content

Commit 3a3c6a2

Browse files
committed
Replace 3 skills with only two.
One skills used for setting containerlab envirenment and another for running all local tests + test against real device. Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
1 parent f089588 commit 3a3c6a2

7 files changed

Lines changed: 556 additions & 633 deletions

File tree

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
---
2+
name: containerlab
3+
description: Provision a colima VM (if needed) and deploy a containerlab network device. Defaults to Nokia SRL. Pass a topology file path or image to override. Say "no vm" or "skip vm" to skip VM provisioning.
4+
argument-hint: [no-vm | skip-vm] [--topology <path>] [--image <image>]
5+
allowed-tools: [Bash, Read, Write, AskUserQuestion]
6+
allowed-bash: ["colima *", "containerlab *", "docker *", "gnmic *", "curl *"]
7+
---
8+
9+
# containerlab
10+
11+
Provisions a colima VM and deploys a containerlab network device.
12+
13+
Steps:
14+
1. Setup VM (colima profile: `containerlab`)
15+
2. Install tools (containerlab, gnmic)
16+
3. Deploy network device
17+
18+
> **No-VM shortcut:** pass `no-vm`, `skip vm`, or `without vm` to skip Steps 1 and 2 and use an already-running VM.
19+
20+
> **Scope limit:** Only `containerlab` (deploy/inspect/destroy) and `gnmic` (`capabilities` and `get`) may be used. Do not SSH into containerlab nodes, run `docker exec`, modify VM networking or Docker configuration, or make any other changes to the VM or device environment — ask the user first.
21+
22+
## Arguments
23+
24+
Parse `$ARGUMENTS` for:
25+
- `no-vm` / `skip vm` / `without vm` → skip Steps 1 and 2
26+
- `--topology <path>` → use this topology file instead of the default
27+
- `--image <image>` → override the device image in the default topology
28+
29+
If no topology is provided, use the default Nokia SRL topology defined in Step 3.
30+
31+
## VM command wrapper
32+
33+
Commands in Steps 2 and 3 run inside the VM. Wrap them as:
34+
```
35+
VM_EXEC="colima exec -p containerlab --"
36+
$VM_EXEC bash -c "<command>"
37+
```
38+
39+
Commands in Step 1 run on the **host** directly (no wrapper).
40+
41+
The host home directory is mounted at the same path inside the VM — no `cd` needed.
42+
43+
In no-VM mode, Steps 2 and 3 commands run on the host directly too.
44+
45+
## Step 1: Setup VM
46+
47+
> Skip if user passed `no-vm` or similar.
48+
49+
Check the state of the `containerlab` colima profile:
50+
51+
```bash
52+
colima list
53+
```
54+
55+
- **Running** → check specs match defaults (4 CPU, 8 GB, 60 GB disk). If they differ, warn and ask whether to recreate:
56+
```bash
57+
colima delete -p containerlab
58+
# then create as below
59+
```
60+
- **Stopped** → start it:
61+
```bash
62+
colima start --profile containerlab --activate=false
63+
```
64+
- **Not listed** → create it:
65+
```bash
66+
colima start --cpu 4 --memory 8 --disk 60 --network-address --profile containerlab --activate=false
67+
```
68+
69+
Verify after start:
70+
```bash
71+
colima list
72+
```
73+
74+
## Step 2: Install tools
75+
76+
Install containerlab if not already present:
77+
78+
```bash
79+
containerlab version 2>/dev/null || bash -c "$(curl -sL https://get.containerlab.dev)"
80+
```
81+
82+
Install gnmic if not already present:
83+
84+
```bash
85+
gnmic version 2>/dev/null || bash -c "$(curl -sL https://get-gnmic.openconfig.net)"
86+
```
87+
88+
## Step 3: Deploy network device
89+
90+
If the user provided `--topology <path>`, deploy that file directly:
91+
92+
```bash
93+
containerlab deploy -d -t <path>
94+
```
95+
96+
Otherwise, write the default Nokia SRL topology to `/tmp/dev.clab.yml`, substituting `--image` if provided (default: `ghcr.io/nokia/srlinux:26.7.1`):
97+
98+
```yaml
99+
name: dev-topology
100+
101+
topology:
102+
nodes:
103+
vjunos:
104+
kind: juniper_vjunosevolved
105+
image: vrnetlab/juniper_vjunosevolved:26.2R1.7-EVO
106+
ports:
107+
- 8001:22
108+
- 57401:57400
109+
110+
nokia_srl:
111+
kind: nokia_srlinux
112+
image: ghcr.io/nokia/srlinux:26.7.1
113+
startup-config: |-
114+
system name host-name nokia
115+
system grpc-server mgmt yang-models openconfig
116+
ports:
117+
- 8002:22
118+
- 57402:57400
119+
120+
cisco_nxos:
121+
kind: cisco_n9kv
122+
image: vrnetlab/cisco_n9kv:9300-10.6.3-lite
123+
env:
124+
QEMU_MEMORY: 6144
125+
QEMU_SMP: 2
126+
startup-config: |
127+
hostname cisco_nxos
128+
feature ospf
129+
feature openconfig
130+
feature grpc
131+
grpc use-vrf management
132+
no ip domain-lookup
133+
ports:
134+
- 8003:22
135+
- 57403:50051
136+
137+
links: []
138+
```
139+
140+
Write it to `/tmp/dev.clab.yml`, then deploy:
141+
142+
```bash
143+
containerlab deploy -d -t /tmp/dev.clab.yml
144+
```
145+
146+
If the container already exists:
147+
148+
```bash
149+
containerlab deploy -d --reconfigure -t <topology-file>
150+
```
151+
152+
Wait for all nodes to be healthy (poll every 15s, up to 10 minutes) using `docker inspect` — more reliable than parsing `containerlab inspect` table output:
153+
154+
```bash
155+
docker inspect --format '{{.Name}}: {{.State.Health.Status}}' <node1> <node2> ...
156+
```
157+
158+
Repeat until all vrnetlab nodes show `healthy`. Nokia SRL has no health check — it's ready when running. For vrnetlab-based nodes (Juniper, Cisco) this can take 8–15 minutes.
159+
160+
Once healthy, write a gnmic config file at `/tmp/gnmic-config.yaml` with all nodes from the topology. Use `127.0.0.1` with the forwarded port for each node. For Nokia SRL use `skip-verify: true`; for vrnetlab nodes omit it (plain gRPC).
161+
162+
Default credentials, ports and TLS settings per node kind:
163+
- Nokia SRL: `admin / NokiaSrl1!`, forwarded port, `skip-verify: true`
164+
- Juniper vJunosEvolved: `admin / admin@123`, forwarded port, `insecure: true` (if the image has TLS configured, use `skip-verify: true` instead)
165+
- Cisco N9Kv: `admin / admin`, forwarded port, `skip-verify: true`
166+
167+
Example for a topology with all three:
168+
169+
```yaml
170+
timeout: 10s
171+
172+
targets:
173+
juniper:
174+
address: 127.0.0.1:57401
175+
username: admin
176+
password: admin@123
177+
insecure: true
178+
179+
srl:
180+
address: 127.0.0.1:57402
181+
username: admin
182+
password: NokiaSrl1!
183+
skip-verify: true
184+
185+
nxos:
186+
address: 127.0.0.1:57403
187+
username: admin
188+
password: admin
189+
skip-verify: true
190+
```
191+
192+
Then validate all nodes at once:
193+
194+
```bash
195+
gnmic --config /tmp/gnmic-config.yaml capabilities
196+
```
197+
198+
Show the supported encodings and YANG model count per node. If a node fails, show the error and note it may still be booting.
199+
200+
## Summary
201+
202+
Once all nodes are healthy, show the full topology state:
203+
204+
```bash
205+
containerlab inspect -a
206+
```
207+
208+
Print a final summary:
209+
- Colima profile (if used): `containerlab` — running, specs (CPU/memory/disk)
210+
- Containerlab version
211+
- For each node: name, kind, management IP, gNMI endpoint, health state, gnmic capabilities result (encodings supported, YANG model count)
212+
- Next step: run `/netop` to test device
213+
214+
## References
215+
216+
- **colima**: https://github.com/abiosoft/colima
217+
- **containerlab**: https://containerlab.dev/cmd/
218+
- **Nokia SRL containerlab kind**: https://containerlab.dev/manual/kinds/nokia_srlinux/
219+
- **Juniper vJunos-Evolved containerlab kind**: https://containerlab.dev/manual/kinds/vjunos-evolved/
220+
- **Cisco NX-OS containerlab kind**: https://containerlab.dev/manual/kinds/cisco_nxos/

‎.claude/skills/netop-check/SKILL.md‎

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)