diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..efb309338ec08e3a71f3946544c7645e5529339c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# Avoid including these folders when building the components +coverage/ +data/ +deploy/ +manifests/ +hackfest/ +scripts/ diff --git a/hackfest/containerlab/.gitignore b/hackfest/containerlab/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..48cbf38799194b5fb3896f3a27f16bff11369fb2 --- /dev/null +++ b/hackfest/containerlab/.gitignore @@ -0,0 +1,2 @@ +clab-tfs-scenario +.tfs-scenario.clab.yml.bak diff --git a/hackfest/containerlab/commands.txt b/hackfest/containerlab/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..ae023a29448d22038c86f976129607841e7ee1a0 --- /dev/null +++ b/hackfest/containerlab/commands.txt @@ -0,0 +1,61 @@ +############ +# ContainerLab +############ + +Refs: +https://documentation.nokia.com/srlinux/22-6/SR_Linux_Book_Files/SysMgmt_Guide/data-models.html#openconfig-ov +https://documentation.nokia.com/srlinux/SR_Linux_HTML_R21-11/SysMgmt_Guide/gnmi-interface.html#ai9ersv4qe +https://github.com/openconfig/kne/blob/v0.1.9/examples/nokia/srlinux-services/srl-openconfig.cfg.json +https://containerlab.dev/manual/kinds/srl/#default-node-configuration +https://learn.srlinux.dev/tutorials/infrastructure/kne/srl-with-oc-services/ +https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md +https://gnmic.kmrd.dev/cmd/get/ + + +IMPORTANT: for Nokia SR Linux, use kind "srl" and type "ixr6" + +## Download and install the latest release +$ sudo bash -c "$(curl -sL https://get.containerlab.dev)" + +## Deploy proposed two SR node scenario +$ cd ~/tfs-ctrl/hackfest/containerlab +$ sudo containerlab deploy --topo tfs-scenario.clab.yml + +## Access SR Bash +$ docker exec -it clab-tfs-scenario-srl1 bash + +## Acess SR CLI +$ docker exec -it clab-tfs-scenario-srl1 sr_cli + +## Destroy scenario +$ sudo containerlab destroy --topo tfs-scenario.clab.yml + +## Install gNMIc +$ sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)" + +## gNMI Capabilities request +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities + +## gNMI Get request +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interface[name=mgmt0] + +## gNMI Set request +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/name/host-name --update-value slr11 + +(we check the changed value) +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name + +## Subscribe request +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics +(In another terminal, you can generate traffic) +$ssh admin@clab-srlinux-srl1 + + +## Enable OpenConfig data models and set as default: +$ docker exec -it clab-tfs-scenario-srl1 sr_cli +# enter candidate +# system management openconfig admin-state enable +# system gnmi-server network-instance mgmt yang-models openconfig +# commit stay +# quit diff --git a/hackfest/containerlab/tfs-scenario.clab.yml b/hackfest/containerlab/tfs-scenario.clab.yml new file mode 100644 index 0000000000000000000000000000000000000000..c8d7dfde85434c39802ce00ca1331377817754d7 --- /dev/null +++ b/hackfest/containerlab/tfs-scenario.clab.yml @@ -0,0 +1,59 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Example based on clos01 example (http://containerlab.dev/lab-examples/min-clos/) + +# TFS 2 Nokia SR Linux nodes + 2 Linux clients +name: tfs-scenario + +mgmt: + network: mgmt-net + ipv4-subnet: 172.100.100.0/24 + +topology: + kinds: + srl: + image: ghcr.io/nokia/srlinux + linux: + image: ghcr.io/hellt/network-multitool + nodes: + srl1: + kind: srl + type: ixr6 + cpu: 0.5 + memory: 500MB + mgmt-ipv4: 172.100.100.101 + #startup-config: srl1.cli + srl2: + kind: srl + type: ixr6 + cpu: 0.5 + memory: 500MB + mgmt-ipv4: 172.100.100.102 + #startup-config: srl2.cli + client1: + kind: linux + cpu: 0.1 + memory: 100MB + mgmt-ipv4: 172.100.100.201 + client2: + kind: linux + cpu: 0.1 + memory: 100MB + mgmt-ipv4: 172.100.100.202 + + links: + - endpoints: ["srl1:e1-1", "srl2:e1-1"] + - endpoints: ["client1:eth1", "srl1:e1-2"] + - endpoints: ["client2:eth1", "srl2:e1-2"]