Skip to content
Snippets Groups Projects
Commit 31b12c0e authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark Committed by Malte Bauch
Browse files

Improve dev setup to have a solid way to create a dev environment

See merge request !418
parent 85d411a9
No related branches found
No related tags found
2 merge requests!442Develop,!418Improve dev setup to have a solid way to create a dev environment
Pipeline #136020 failed
This commit is part of merge request !416. Comments created here will be created in the context of that merge request.
...@@ -135,6 +135,12 @@ shell-orchestrator: ...@@ -135,6 +135,12 @@ shell-orchestrator:
start: build-gosdn start: build-gosdn
./$(BUILD_ARTIFACTS_PATH)/gosdn -l debug --config ./controller/configs/gosdn.toml ./$(BUILD_ARTIFACTS_PATH)/gosdn -l debug --config ./controller/configs/gosdn.toml
start-dev-env: build
./scripts/manage_virt_env.sh --mode start --topology dev_env_data/clab/basic_two_aristas.yaml --sdnconfig dev_env_data/sdn/basic_two_aristas.json
stop-dev-env:
./scripts/manage_virt_env.sh --mode stop --topology dev_env_data/clab/basic_two_aristas.yaml
clean: clean:
$(GOCLEAN) $(GOCLEAN)
rm -rf $(BUILD_ARTIFACTS_PATH) rm -rf $(BUILD_ARTIFACTS_PATH)
...@@ -126,7 +126,27 @@ Information about how to use the CLI is provided in the `cli` folder, see [here] ...@@ -126,7 +126,27 @@ Information about how to use the CLI is provided in the `cli` folder, see [here]
# Development Tutorial # Development Tutorial
TBD To help with developing there is a small script available, which helps to create the complete dev environment.
For it to work, you need `go`, `docker`, `docker compose` and `containerlab`.
For a quick start simply use `make start-dev-env` to start everything. This can take a while. Afterwards, you see the output of goSDN, to stop it hit Ctrl+C. To stop everything else use `make stop-dev-env`.
If you want more control over your environment, you can use the `manage_virt_env.sh` script directly.
It works like this, if you are in the projects root folder:
`./scripts/manage_virt_env.sh --mode $(start || stop) --topology $PATH_TO_TOPOLOGY --SDNCONFIG $PATH_TO_SDNCONFIG --keepdb (optional)`
`mode` defines if it should start or stop the environment, while the two commands `--topology` and `--sdnconfig` are used to provide the desired files.
The optional flag `keepdb` is used if you want to create the environment without reloading the SDN config file, which is handy if you just want to restart the environment. For every command there is a shortcut available (e.g. -t for --topology, etc.).
Example usages:
`./scripts/manage_virt_env.sh --mode start --topology dev_env_data/clab/basic_two_aristas.yaml --sdnconfig dev_env_data/sdn/basic_two_aristas.json`
`./scripts/manage_virt_env.sh --mode start --topology dev_env_data/clab/basic_two_aristas.yaml --keepdb`
`./scripts/manage_virt_env.sh --mode stop --topology dev_env_data/clab/basic_two_aristas.yaml`
## Backup and restore your mongodb ## Backup and restore your mongodb
......
...@@ -31,7 +31,7 @@ clean: ...@@ -31,7 +31,7 @@ clean:
rm -f $(BINARY_NAME) rm -f $(BINARY_NAME)
start: clean build start: clean build
ENVIRONMENT=development ./$(BINARY_NAME) -l debug GOSDN_ADMIN_PASSWORD="admin" ENVIRONMENT=development ./$(BINARY_NAME) -l debug
start-insecure: clean build start-insecure: clean build
ENVIRONMENT=development ./$(BINARY_NAME) -l debug -s insecure ENVIRONMENT=development ./$(BINARY_NAME) -l debug -s insecure
......
basepnduuid = "5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d" amqphost = 'localhost'
amqppassword = 'guest'
amqpport = '5672'
amqpprefix = 'amqp://'
amqpuser = 'guest'
basepnduuid = '5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d'
basesouthboundtype = 1 basesouthboundtype = 1
basesouthbounduuid = "ca29311a-3b17-4385-96f8-515b602a97ac" basesouthbounduuid = 'ca29311a-3b17-4385-96f8-515b602a97ac'
csbi-orchestrator = "localhost:55056" cli_pnd = '0455b241-5863-4660-ad15-dfde7617738e'
cli_sbi = 'a249f2d2-f7da-481d-8a99-b7f11471e0af'
config = '/home/neil/code/gosdn/controller/configs/development-gosdn.toml'
csbi-orchestrator = 'localhost:55056'
databaseconnection = 'mongodb://root:example@localhost:27017'
defaultjwtduration = 24
filesystempathtostores = 'stores'
gnmisubscriptionspath = 'configs/gNMISubscriptions.txt'
help = false help = false
plugin-folder = "plugins" log-level = 'debug'
log-level = "debug" plugin-folder = 'plugins'
socket = ":55055" pnduuid = 'bf8160d4-4659-4a1b-98fd-f409a04111ec'
databaseConnection = "mongodb://root:example@localhost:27017" security = 'insecure'
filesystemPathToStores = "stores" socket = ':55055'
gNMISubscriptionsPath = "controller/configs/gNMISubscriptions.txt"
amqpPrefix = "amqp://"
amqpUser = "guest"
amqpPassword = "guest"
amqpHost = "localhost"
amqpPort = "5672"
{
"pndID": "5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d",
"nodes": [
{
"ID": "95a28ee8-4553-4a7b-af1f-bdd5670b43d8",
"Metadata": {
"last_updated": "2023-01-24T12:18:51.248Z",
"created_at": "2023-01-24T12:18:51.248Z"
},
"Name": "ceos0"
},
{
"ID": "56f265dc-092e-44f9-afb0-dd891bdc8f4b",
"Metadata": {
"last_updated": "2023-01-24T12:18:51.355Z",
"created_at": "2023-01-24T12:18:51.355Z"
},
"Name": "ceos1"
}
],
"ports": [
{
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fcb",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth2",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
},
{
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fca",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth1",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
}
],
"links": [
{
"ID": "82d993c3-6667-4952-b422-90ed9e6e4a26",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "test",
"SourceNode": {
"ID": "95a28ee8-4553-4a7b-af1f-bdd5670b43d8",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "ceos0"
},
"TargetNode": {
"ID": "56f265dc-092e-44f9-afb0-dd891bdc8f4b",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "ceos1"
},
"SourcePort": {
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fcb",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth2",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
},
"TargetPort": {
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fcb",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth2",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
}
},
{
"ID": "34ec541b-355a-418b-aabf-639a547b5953",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "test",
"SourceNode": {
"ID": "95a28ee8-4553-4a7b-af1f-bdd5670b43d8",
"Metadata": {
"last_updated": "2023-01-24T12:18:51.248Z",
"created_at": "2023-01-24T12:18:51.248Z"
},
"Name": "ceos0"
},
"TargetNode": {
"ID": "56f265dc-092e-44f9-afb0-dd891bdc8f4b",
"Metadata": {
"last_updated": "2023-01-24T12:18:51.355Z",
"created_at": "2023-01-24T12:18:51.355Z"
},
"Name": "ceos1"
},
"SourcePort": {
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fca",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth1",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
},
"TargetPort": {
"ID": "1fa479e7-d393-4d45-822d-485cc1f05fca",
"Metadata": {
"last_updated": "0001-01-01T00:00:00Z",
"created_at": "0001-01-01T00:00:00Z"
},
"Name": "eth1",
"Configuration": {
"IP": "0.0.0.0",
"PrefixLength": 24
}
}
}
],
"sbis": [
{
"_id": "33028183-06bc-4b1f-b440-f40ed390a309",
"type": 1
}
],
"networkelements": [
{
"id": "95a28ee8-4553-4a7b-af1f-bdd5670b43d8",
"name": "ceos0",
"transport_type": "gnmi",
"transport_address": "172.100.0.11:6030",
"transport_username": "admin",
"transport_password": "admin",
"transport_option": 1,
"sbi": "33028183-06bc-4b1f-b440-f40ed390a309",
"Model": "{\n \"openconfig-interfaces:interfaces\": {\n \"interface\": [\n {\n \"config\": {\n \"enabled\": true,\n \"loopback-mode\": false,\n \"mtu\": 0,\n \"name\": \"Ethernet1\",\n \"openconfig-vlan:tpid\": \"openconfig-vlan-types:TPID_0X8100\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Ethernet1\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"config\": {\n \"enabled\": true,\n \"index\": 0\n },\n \"index\": 0,\n \"openconfig-if-ip:ipv4\": {\n \"addresses\": {\n \"address\": [\n {\n \"config\": {\n \"ip\": \"10.13.37.1\",\n \"prefix-length\": 24\n },\n \"ip\": \"10.13.37.1\"\n }\n ]\n },\n \"config\": {\n \"enabled\": true\n }\n }\n }\n ]\n }\n },\n {\n \"config\": {\n \"enabled\": true,\n \"loopback-mode\": false,\n \"mtu\": 0,\n \"name\": \"Ethernet2\",\n \"openconfig-vlan:tpid\": \"openconfig-vlan-types:TPID_0X8100\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Ethernet2\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"config\": {\n \"enabled\": true,\n \"index\": 0\n },\n \"index\": 0,\n \"openconfig-if-ip:ipv4\": {\n \"addresses\": {\n \"address\": [\n {\n \"config\": {\n \"ip\": \"10.0.23.1\",\n \"prefix-length\": 24\n },\n \"ip\": \"10.0.23.1\"\n }\n ]\n },\n \"config\": {\n \"enabled\": true\n }\n }\n }\n ]\n }\n },\n {\n \"config\": {\n \"mtu\": 0,\n \"name\": \"Management0\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Management0\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"index\": 0,\n \"openconfig-if-ip:ipv4\": {\n \"addresses\": {\n \"address\": [\n {\n \"config\": {\n \"ip\": \"172.100.0.11\",\n \"prefix-length\": 16\n },\n \"ip\": \"172.100.0.11\"\n }\n ]\n },\n \"neighbors\": {\n \"neighbor\": [\n {\n \"config\": {\n \"ip\": \"172.100.0.1\"\n },\n \"ip\": \"172.100.0.1\"\n }\n ]\n }\n }\n }\n ]\n }\n }\n ]\n },\n \"openconfig-lldp:lldp\": {\n \"config\": {\n \"arista-lldp-augments:management-address\": {\n \"interface\": \"\",\n \"network-instance\": \"default\",\n \"transmit-mode\": \"BEST\"\n },\n \"hello-timer\": \"30\",\n \"system-description\": \"Arista Networks EOS version 4.28.2F-28369039.4282F (engineering build) running on an Arista cEOSLab\",\n \"system-name\": \"ceos0\"\n },\n \"interfaces\": {\n \"interface\": [\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n },\n {\n \"config\": {\n \"name\": \"Management0\"\n },\n \"name\": \"Management0\"\n }\n ]\n }\n },\n \"openconfig-network-instance:network-instances\": {\n \"network-instance\": [\n {\n \"config\": {\n \"enabled\": true,\n \"name\": \"default\",\n \"type\": \"openconfig-network-instance-types:DEFAULT_INSTANCE\"\n },\n \"mpls\": {\n \"global\": {\n \"reserved-label-blocks\": {\n \"reserved-label-block\": [\n {\n \"config\": {\n \"local-id\": \"bgp-sr\",\n \"lower-bound\": 900000,\n \"upper-bound\": 965535\n },\n \"local-id\": \"bgp-sr\"\n },\n {\n \"config\": {\n \"local-id\": \"dynamic\",\n \"lower-bound\": 100000,\n \"upper-bound\": 362143\n },\n \"local-id\": \"dynamic\"\n },\n {\n \"config\": {\n \"local-id\": \"isis-sr\",\n \"lower-bound\": 900000,\n \"upper-bound\": 965535\n },\n \"local-id\": \"isis-sr\"\n },\n {\n \"config\": {\n \"local-id\": \"l2evpn\",\n \"lower-bound\": 1036288,\n \"upper-bound\": 1048575\n },\n \"local-id\": \"l2evpn\"\n },\n {\n \"config\": {\n \"local-id\": \"l2evpnSharedEs\",\n \"lower-bound\": 1031072,\n \"upper-bound\": 1032095\n },\n \"local-id\": \"l2evpnSharedEs\"\n },\n {\n \"config\": {\n \"local-id\": \"srlb\",\n \"lower-bound\": 965536,\n \"upper-bound\": 1031071\n },\n \"local-id\": \"srlb\"\n },\n {\n \"config\": {\n \"local-id\": \"static\",\n \"lower-bound\": 16,\n \"upper-bound\": 99999\n },\n \"local-id\": \"static\"\n }\n ]\n }\n },\n \"signaling-protocols\": {\n \"rsvp-te\": {\n \"global\": {\n \"hellos\": {\n \"config\": {\n \"hello-interval\": 10000\n }\n },\n \"soft-preemption\": {\n \"config\": {\n \"enable\": true\n }\n }\n }\n }\n }\n },\n \"name\": \"default\",\n \"protocols\": {\n \"protocol\": [\n {\n \"bgp\": {\n \"global\": {\n \"afi-safis\": {\n \"afi-safi\": [\n {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV4_UNICAST\",\n \"config\": {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV4_UNICAST\"\n }\n },\n {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV6_UNICAST\",\n \"config\": {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV6_UNICAST\"\n }\n }\n ]\n }\n }\n },\n \"config\": {\n \"identifier\": \"openconfig-policy-types:BGP\",\n \"name\": \"BGP\"\n },\n \"identifier\": \"openconfig-policy-types:BGP\",\n \"name\": \"BGP\"\n },\n {\n \"config\": {\n \"identifier\": \"openconfig-policy-types:DIRECTLY_CONNECTED\",\n \"name\": \"DIRECTLY_CONNECTED\"\n },\n \"identifier\": \"openconfig-policy-types:DIRECTLY_CONNECTED\",\n \"name\": \"DIRECTLY_CONNECTED\"\n },\n {\n \"config\": {\n \"identifier\": \"openconfig-policy-types:STATIC\",\n \"name\": \"STATIC\"\n },\n \"identifier\": \"openconfig-policy-types:STATIC\",\n \"name\": \"STATIC\",\n \"static-routes\": {\n \"static\": [\n {\n \"config\": {\n \"prefix\": \"0.0.0.0/0\"\n },\n \"next-hops\": {\n \"next-hop\": [\n {\n \"config\": {\n \"index\": \"AUTO_1_172-100-0-1\",\n \"metric\": 1,\n \"next-hop\": \"172.100.0.1\"\n },\n \"index\": \"AUTO_1_172-100-0-1\"\n }\n ]\n },\n \"prefix\": \"0.0.0.0/0\"\n }\n ]\n }\n }\n ]\n },\n \"segment-routing\": {\n \"srgbs\": {\n \"srgb\": [\n {\n \"config\": {\n \"dataplane-type\": \"MPLS\",\n \"local-id\": \"isis-sr\",\n \"mpls-label-blocks\": [\n \"isis-sr\"\n ]\n },\n \"local-id\": \"isis-sr\"\n }\n ]\n },\n \"srlbs\": {\n \"srlb\": [\n {\n \"config\": {\n \"dataplane-type\": \"MPLS\",\n \"local-id\": \"srlb\",\n \"mpls-label-block\": \"srlb\"\n },\n \"local-id\": \"srlb\"\n }\n ]\n }\n },\n \"tables\": {\n \"table\": [\n {\n \"address-family\": \"openconfig-types:IPV4\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV4\",\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n {\n \"address-family\": \"openconfig-types:IPV6\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV6\",\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n {\n \"address-family\": \"openconfig-types:IPV4\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV4\",\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n {\n \"address-family\": \"openconfig-types:IPV6\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV6\",\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n \"protocol\": \"openconfig-policy-types:STATIC\"\n }\n ]\n },\n \"vlans\": {\n \"vlan\": [\n {\n \"config\": {\n \"name\": \"default\",\n \"vlan-id\": 1\n },\n \"vlan-id\": 1\n }\n ]\n }\n }\n ]\n },\n \"openconfig-platform:components\": {\n \"component\": [\n {\n \"config\": {\n \"name\": \"Aboot\"\n },\n \"name\": \"Aboot\"\n },\n {\n \"config\": {\n \"name\": \"BIOS\"\n },\n \"name\": \"BIOS\"\n },\n {\n \"config\": {\n \"name\": \"CPU0\"\n },\n \"name\": \"CPU0\"\n },\n {\n \"config\": {\n \"name\": \"CPU1\"\n },\n \"name\": \"CPU1\"\n },\n {\n \"config\": {\n \"name\": \"CPU10\"\n },\n \"name\": \"CPU10\"\n },\n {\n \"config\": {\n \"name\": \"CPU11\"\n },\n \"name\": \"CPU11\"\n },\n {\n \"config\": {\n \"name\": \"CPU12\"\n },\n \"name\": \"CPU12\"\n },\n {\n \"config\": {\n \"name\": \"CPU13\"\n },\n \"name\": \"CPU13\"\n },\n {\n \"config\": {\n \"name\": \"CPU14\"\n },\n \"name\": \"CPU14\"\n },\n {\n \"config\": {\n \"name\": \"CPU15\"\n },\n \"name\": \"CPU15\"\n },\n {\n \"config\": {\n \"name\": \"CPU2\"\n },\n \"name\": \"CPU2\"\n },\n {\n \"config\": {\n \"name\": \"CPU3\"\n },\n \"name\": \"CPU3\"\n },\n {\n \"config\": {\n \"name\": \"CPU4\"\n },\n \"name\": \"CPU4\"\n },\n {\n \"config\": {\n \"name\": \"CPU5\"\n },\n \"name\": \"CPU5\"\n },\n {\n \"config\": {\n \"name\": \"CPU6\"\n },\n \"name\": \"CPU6\"\n },\n {\n \"config\": {\n \"name\": \"CPU7\"\n },\n \"name\": \"CPU7\"\n },\n {\n \"config\": {\n \"name\": \"CPU8\"\n },\n \"name\": \"CPU8\"\n },\n {\n \"config\": {\n \"name\": \"CPU9\"\n },\n \"name\": \"CPU9\"\n },\n {\n \"config\": {\n \"name\": \"Chassis\"\n },\n \"name\": \"Chassis\",\n \"subcomponents\": {\n \"subcomponent\": [\n {\n \"config\": {\n \"name\": \"SwitchChip0\"\n },\n \"name\": \"SwitchChip0\"\n }\n ]\n }\n },\n {\n \"config\": {\n \"name\": \"EOS\"\n },\n \"name\": \"EOS\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n },\n {\n \"config\": {\n \"name\": \"Port1\"\n },\n \"name\": \"Port1\"\n },\n {\n \"config\": {\n \"name\": \"Port2\"\n },\n \"name\": \"Port2\"\n },\n {\n \"config\": {\n \"name\": \"SwitchChip0\"\n },\n \"name\": \"SwitchChip0\",\n \"subcomponents\": {\n \"subcomponent\": [\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n }\n ]\n }\n },\n {\n \"config\": {\n \"name\": \"chassis-hostName\"\n },\n \"name\": \"chassis-hostName\"\n }\n ]\n },\n \"openconfig-system:system\": {\n \"aaa\": {\n \"authentication\": {\n \"config\": {\n \"authentication-method\": [\n \"openconfig-aaa-types:LOCAL\"\n ]\n },\n \"users\": {\n \"user\": [\n {\n \"config\": {\n \"password-hashed\": \"$6$/LyOizqW1THikBge$5sda5Pgj55Z20dazbvrzpc6UgRkPX6rungn.CW40peXNNQpdY8WJdczEFaSuP4XYTa.NnxEFs6Eyptfdki9ak1\",\n \"role\": \"openconfig-aaa-types:SYSTEM_ROLE_ADMIN\",\n \"username\": \"admin\"\n },\n \"username\": \"admin\"\n }\n ]\n }\n }\n },\n \"clock\": {\n \"config\": {\n \"timezone-name\": \"UTC\"\n }\n },\n \"config\": {\n \"hostname\": \"ceos0\"\n },\n \"ssh-server\": {\n \"config\": {\n \"session-limit\": 50,\n \"timeout\": 0\n }\n }\n }\n}"
},
{
"id": "56f265dc-092e-44f9-afb0-dd891bdc8f4b",
"name": "ceos1",
"transport_type": "gnmi",
"transport_address": "172.100.0.12:6030",
"transport_username": "admin",
"transport_password": "admin",
"transport_option": 1,
"sbi": "33028183-06bc-4b1f-b440-f40ed390a309",
"Model": "{\n \"openconfig-interfaces:interfaces\": {\n \"interface\": [\n {\n \"config\": {\n \"enabled\": true,\n \"loopback-mode\": false,\n \"mtu\": 0,\n \"name\": \"Ethernet1\",\n \"openconfig-vlan:tpid\": \"openconfig-vlan-types:TPID_0X8100\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Ethernet1\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"config\": {\n \"enabled\": true,\n \"index\": 0\n },\n \"index\": 0,\n \"openconfig-if-ip:ipv4\": {\n \"addresses\": {\n \"address\": [\n {\n \"config\": {\n \"ip\": \"10.13.37.2\",\n \"prefix-length\": 24\n },\n \"ip\": \"10.13.37.2\"\n }\n ]\n },\n \"config\": {\n \"enabled\": true\n }\n }\n }\n ]\n }\n },\n {\n \"config\": {\n \"mtu\": 0,\n \"name\": \"Ethernet2\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Ethernet2\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"index\": 0\n }\n ]\n }\n },\n {\n \"config\": {\n \"mtu\": 0,\n \"name\": \"Management0\",\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n \"name\": \"Management0\",\n \"openconfig-if-ethernet:ethernet\": {\n \"config\": {\n \"mac-address\": \"00:00:00:00:00:00\",\n \"port-speed\": \"openconfig-if-ethernet:SPEED_UNKNOWN\"\n }\n },\n \"subinterfaces\": {\n \"subinterface\": [\n {\n \"index\": 0,\n \"openconfig-if-ip:ipv4\": {\n \"addresses\": {\n \"address\": [\n {\n \"config\": {\n \"ip\": \"172.100.0.12\",\n \"prefix-length\": 16\n },\n \"ip\": \"172.100.0.12\"\n }\n ]\n },\n \"neighbors\": {\n \"neighbor\": [\n {\n \"config\": {\n \"ip\": \"172.100.0.1\"\n },\n \"ip\": \"172.100.0.1\"\n }\n ]\n }\n }\n }\n ]\n }\n }\n ]\n },\n \"openconfig-lldp:lldp\": {\n \"config\": {\n \"arista-lldp-augments:management-address\": {\n \"interface\": \"\",\n \"network-instance\": \"default\",\n \"transmit-mode\": \"BEST\"\n },\n \"hello-timer\": \"30\",\n \"system-description\": \"Arista Networks EOS version 4.28.2F-28369039.4282F (engineering build) running on an Arista cEOSLab\",\n \"system-name\": \"ceos1\"\n },\n \"interfaces\": {\n \"interface\": [\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n },\n {\n \"config\": {\n \"name\": \"Management0\"\n },\n \"name\": \"Management0\"\n }\n ]\n }\n },\n \"openconfig-network-instance:network-instances\": {\n \"network-instance\": [\n {\n \"config\": {\n \"enabled\": true,\n \"name\": \"default\",\n \"type\": \"openconfig-network-instance-types:DEFAULT_INSTANCE\"\n },\n \"mpls\": {\n \"global\": {\n \"reserved-label-blocks\": {\n \"reserved-label-block\": [\n {\n \"config\": {\n \"local-id\": \"bgp-sr\",\n \"lower-bound\": 900000,\n \"upper-bound\": 965535\n },\n \"local-id\": \"bgp-sr\"\n },\n {\n \"config\": {\n \"local-id\": \"dynamic\",\n \"lower-bound\": 100000,\n \"upper-bound\": 362143\n },\n \"local-id\": \"dynamic\"\n },\n {\n \"config\": {\n \"local-id\": \"isis-sr\",\n \"lower-bound\": 900000,\n \"upper-bound\": 965535\n },\n \"local-id\": \"isis-sr\"\n },\n {\n \"config\": {\n \"local-id\": \"l2evpn\",\n \"lower-bound\": 1036288,\n \"upper-bound\": 1048575\n },\n \"local-id\": \"l2evpn\"\n },\n {\n \"config\": {\n \"local-id\": \"l2evpnSharedEs\",\n \"lower-bound\": 1031072,\n \"upper-bound\": 1032095\n },\n \"local-id\": \"l2evpnSharedEs\"\n },\n {\n \"config\": {\n \"local-id\": \"srlb\",\n \"lower-bound\": 965536,\n \"upper-bound\": 1031071\n },\n \"local-id\": \"srlb\"\n },\n {\n \"config\": {\n \"local-id\": \"static\",\n \"lower-bound\": 16,\n \"upper-bound\": 99999\n },\n \"local-id\": \"static\"\n }\n ]\n }\n },\n \"signaling-protocols\": {\n \"rsvp-te\": {\n \"global\": {\n \"hellos\": {\n \"config\": {\n \"hello-interval\": 10000\n }\n },\n \"soft-preemption\": {\n \"config\": {\n \"enable\": true\n }\n }\n }\n }\n }\n },\n \"name\": \"default\",\n \"protocols\": {\n \"protocol\": [\n {\n \"bgp\": {\n \"global\": {\n \"afi-safis\": {\n \"afi-safi\": [\n {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV4_UNICAST\",\n \"config\": {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV4_UNICAST\"\n }\n },\n {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV6_UNICAST\",\n \"config\": {\n \"afi-safi-name\": \"openconfig-bgp-types:IPV6_UNICAST\"\n }\n }\n ]\n }\n }\n },\n \"config\": {\n \"identifier\": \"openconfig-policy-types:BGP\",\n \"name\": \"BGP\"\n },\n \"identifier\": \"openconfig-policy-types:BGP\",\n \"name\": \"BGP\"\n },\n {\n \"config\": {\n \"identifier\": \"openconfig-policy-types:DIRECTLY_CONNECTED\",\n \"name\": \"DIRECTLY_CONNECTED\"\n },\n \"identifier\": \"openconfig-policy-types:DIRECTLY_CONNECTED\",\n \"name\": \"DIRECTLY_CONNECTED\"\n },\n {\n \"config\": {\n \"identifier\": \"openconfig-policy-types:STATIC\",\n \"name\": \"STATIC\"\n },\n \"identifier\": \"openconfig-policy-types:STATIC\",\n \"name\": \"STATIC\",\n \"static-routes\": {\n \"static\": [\n {\n \"config\": {\n \"prefix\": \"0.0.0.0/0\"\n },\n \"next-hops\": {\n \"next-hop\": [\n {\n \"config\": {\n \"index\": \"AUTO_1_172-100-0-1\",\n \"metric\": 1,\n \"next-hop\": \"172.100.0.1\"\n },\n \"index\": \"AUTO_1_172-100-0-1\"\n }\n ]\n },\n \"prefix\": \"0.0.0.0/0\"\n }\n ]\n }\n }\n ]\n },\n \"segment-routing\": {\n \"srgbs\": {\n \"srgb\": [\n {\n \"config\": {\n \"dataplane-type\": \"MPLS\",\n \"local-id\": \"isis-sr\",\n \"mpls-label-blocks\": [\n \"isis-sr\"\n ]\n },\n \"local-id\": \"isis-sr\"\n }\n ]\n },\n \"srlbs\": {\n \"srlb\": [\n {\n \"config\": {\n \"dataplane-type\": \"MPLS\",\n \"local-id\": \"srlb\",\n \"mpls-label-block\": \"srlb\"\n },\n \"local-id\": \"srlb\"\n }\n ]\n }\n },\n \"tables\": {\n \"table\": [\n {\n \"address-family\": \"openconfig-types:IPV4\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV4\",\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n {\n \"address-family\": \"openconfig-types:IPV6\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV6\",\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n \"protocol\": \"openconfig-policy-types:DIRECTLY_CONNECTED\"\n },\n {\n \"address-family\": \"openconfig-types:IPV4\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV4\",\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n {\n \"address-family\": \"openconfig-types:IPV6\",\n \"config\": {\n \"address-family\": \"openconfig-types:IPV6\",\n \"protocol\": \"openconfig-policy-types:STATIC\"\n },\n \"protocol\": \"openconfig-policy-types:STATIC\"\n }\n ]\n },\n \"vlans\": {\n \"vlan\": [\n {\n \"config\": {\n \"name\": \"default\",\n \"vlan-id\": 1\n },\n \"vlan-id\": 1\n }\n ]\n }\n }\n ]\n },\n \"openconfig-platform:components\": {\n \"component\": [\n {\n \"config\": {\n \"name\": \"Aboot\"\n },\n \"name\": \"Aboot\"\n },\n {\n \"config\": {\n \"name\": \"BIOS\"\n },\n \"name\": \"BIOS\"\n },\n {\n \"config\": {\n \"name\": \"CPU0\"\n },\n \"name\": \"CPU0\"\n },\n {\n \"config\": {\n \"name\": \"CPU1\"\n },\n \"name\": \"CPU1\"\n },\n {\n \"config\": {\n \"name\": \"CPU10\"\n },\n \"name\": \"CPU10\"\n },\n {\n \"config\": {\n \"name\": \"CPU11\"\n },\n \"name\": \"CPU11\"\n },\n {\n \"config\": {\n \"name\": \"CPU12\"\n },\n \"name\": \"CPU12\"\n },\n {\n \"config\": {\n \"name\": \"CPU13\"\n },\n \"name\": \"CPU13\"\n },\n {\n \"config\": {\n \"name\": \"CPU14\"\n },\n \"name\": \"CPU14\"\n },\n {\n \"config\": {\n \"name\": \"CPU15\"\n },\n \"name\": \"CPU15\"\n },\n {\n \"config\": {\n \"name\": \"CPU2\"\n },\n \"name\": \"CPU2\"\n },\n {\n \"config\": {\n \"name\": \"CPU3\"\n },\n \"name\": \"CPU3\"\n },\n {\n \"config\": {\n \"name\": \"CPU4\"\n },\n \"name\": \"CPU4\"\n },\n {\n \"config\": {\n \"name\": \"CPU5\"\n },\n \"name\": \"CPU5\"\n },\n {\n \"config\": {\n \"name\": \"CPU6\"\n },\n \"name\": \"CPU6\"\n },\n {\n \"config\": {\n \"name\": \"CPU7\"\n },\n \"name\": \"CPU7\"\n },\n {\n \"config\": {\n \"name\": \"CPU8\"\n },\n \"name\": \"CPU8\"\n },\n {\n \"config\": {\n \"name\": \"CPU9\"\n },\n \"name\": \"CPU9\"\n },\n {\n \"config\": {\n \"name\": \"Chassis\"\n },\n \"name\": \"Chassis\",\n \"subcomponents\": {\n \"subcomponent\": [\n {\n \"config\": {\n \"name\": \"SwitchChip0\"\n },\n \"name\": \"SwitchChip0\"\n }\n ]\n }\n },\n {\n \"config\": {\n \"name\": \"EOS\"\n },\n \"name\": \"EOS\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n },\n {\n \"config\": {\n \"name\": \"Port1\"\n },\n \"name\": \"Port1\"\n },\n {\n \"config\": {\n \"name\": \"Port2\"\n },\n \"name\": \"Port2\"\n },\n {\n \"config\": {\n \"name\": \"SwitchChip0\"\n },\n \"name\": \"SwitchChip0\",\n \"subcomponents\": {\n \"subcomponent\": [\n {\n \"config\": {\n \"name\": \"Ethernet1\"\n },\n \"name\": \"Ethernet1\"\n },\n {\n \"config\": {\n \"name\": \"Ethernet2\"\n },\n \"name\": \"Ethernet2\"\n }\n ]\n }\n },\n {\n \"config\": {\n \"name\": \"chassis-hostName\"\n },\n \"name\": \"chassis-hostName\"\n }\n ]\n },\n \"openconfig-system:system\": {\n \"aaa\": {\n \"authentication\": {\n \"config\": {\n \"authentication-method\": [\n \"openconfig-aaa-types:LOCAL\"\n ]\n },\n \"users\": {\n \"user\": [\n {\n \"config\": {\n \"password-hashed\": \"$6$DPYiFBoPj.OoxQ/m$5Utr2c4LTYNAgzbUuTQb0OJo2zCJanOT7uTo6/0Ss0jU1dvqysxBNl.zFJU9TYO.PIEA0fhjTdWXtJ5aLuOtx.\",\n \"role\": \"openconfig-aaa-types:SYSTEM_ROLE_ADMIN\",\n \"username\": \"admin\"\n },\n \"username\": \"admin\"\n }\n ]\n }\n }\n },\n \"clock\": {\n \"config\": {\n \"timezone-name\": \"UTC\"\n }\n },\n \"config\": {\n \"hostname\": \"ceos1\"\n },\n \"ssh-server\": {\n \"config\": {\n \"session-limit\": 50,\n \"timeout\": 0\n }\n }\n }\n}"
}
]
}
\ No newline at end of file
#!/bin/bash
POSITIONAL_ARGS=()
KEEPDB='false'
while [[ $# -gt 0 ]]; do
case $1 in
-m|--mode)
MODE="$2"
shift # past argument
shift # past value
;;
-t|--topology)
TOPOLOGY="$2"
shift # past argument
shift # past value
;;
-s|--sdnconfig)
SDNCONFIG="$2"
shift # past argument
shift # past value
;;
--keepdb)
KEEPDB="true"
shift # past argument
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
start_gosdn () {
# Start controller
cd controller
GOSDN_ADMIN_PASSWORD="admin" make start &
pid=$!
cd ..
}
if [ $MODE = 'start' ];
then
echo "Need sudo rights."
sudo echo "sudo rights granted"
# Start databases, etc.
docker compose up -d
# Start clab topology
if [ $KEEPDB = 'true' ];
then
sudo containerlab deploy -t $TOPOLOGY
start_gosdn
else
sleep 5
start_gosdn
./artifacts/venv-manager --mode deploy --topology $TOPOLOGY --sdnconfig $SDNCONFIG
fi
echo "#########################################################################################"
echo "Initialisation finished. You will now see the output of goSDN. Press Ctrl+C to stop it."
wait $pid
fi
if [ $MODE = 'stop' ];
then
docker compose down
sudo containerlab destroy -t $TOPOLOGY -c
rm -f dev_env_data/clab/.*.bak
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment