Loading .gitignore +1 −0 Original line number Original line Diff line number Diff line Loading @@ -162,6 +162,7 @@ cython_debug/ # TeraFlowSDN-generated files # TeraFlowSDN-generated files tfs_runtime_env_vars.sh tfs_runtime_env_vars.sh tfs_runtime_env_vars*.sh tfs_bchain_runtime_env_vars.sh tfs_bchain_runtime_env_vars.sh delete_local_deployment.sh delete_local_deployment.sh local_docker_deployment.sh local_docker_deployment.sh Loading deploy.sh +60 −54 Original line number Original line Diff line number Diff line Loading @@ -36,9 +36,13 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set additional manifest files to be applied after the deployment # If not already set, set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} # If not already set, set the neew Grafana admin password # If not already set, set the new Grafana admin password export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} # If not already set, disable skip-build flag. # If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-""} ######################################################################################################################## ######################################################################################################################## # Automated steps start here # Automated steps start here ######################################################################################################################## ######################################################################################################################## Loading Loading @@ -67,6 +71,7 @@ echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT for COMPONENT in $TFS_COMPONENTS; do for COMPONENT in $TFS_COMPONENTS; do echo "Processing '$COMPONENT' component..." echo "Processing '$COMPONENT' component..." if [ "$TFS_SKIP_BUILD" != "YES" ]; then echo " Building Docker image..." echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" Loading Loading @@ -136,6 +141,7 @@ for COMPONENT in $TFS_COMPONENTS; do docker push "$IMAGE_URL" > "$PUSH_LOG" docker push "$IMAGE_URL" > "$PUSH_LOG" fi fi fi fi fi echo " Adapting '$COMPONENT' manifest file..." echo " Adapting '$COMPONENT' manifest file..." MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" Loading hackfest/p4/setup.sh +2 −2 Original line number Original line Diff line number Diff line Loading @@ -4,5 +4,5 @@ export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl cp src/tests/netx22-p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp src/tests/netx22-p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 hackfest/p4/tests/Objects.py +38 −3 Original line number Original line Diff line number Diff line # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # You may obtain a copy of the License at Loading Loading @@ -42,6 +43,8 @@ PACKET_PORT_SAMPLE_TYPES = [ KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, ] ] # ----- Device Credentials and Settings -------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- Loading @@ -54,7 +57,7 @@ DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) DEVICE_SW1_DPID = 1 DEVICE_SW1_DPID = 1 DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_IP_ADDR = '10.0.2.10' DEVICE_SW1_IP_ADDR = 'localhost' DEVICE_SW1_PORT = '50001' DEVICE_SW1_PORT = '50001' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' Loading @@ -78,9 +81,38 @@ DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( } } ) ) DEVICE_SW2_UUID = 'SW2' DEVICE_SW2_TIMEOUT = 60 DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) ################################## TABLE ENTRIES ################################## DEVICE_SW2_DPID = 1 DEVICE_SW2_NAME = DEVICE_SW2_UUID DEVICE_SW2_IP_ADDR = 'localhost' DEVICE_SW2_PORT = '50002' DEVICE_SW2_VENDOR = 'Open Networking Foundation' DEVICE_SW2_HW_VER = 'BMv2 simple_switch' DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( DEVICE_SW2_IP_ADDR, DEVICE_SW2_PORT, { 'id': DEVICE_SW2_DPID, 'name': DEVICE_SW2_NAME, 'vendor': DEVICE_SW2_VENDOR, 'hw_ver': DEVICE_SW2_HW_VER, 'sw_ver': DEVICE_SW2_SW_VER, 'timeout': DEVICE_SW2_TIMEOUT, 'p4bin': DEVICE_SW2_BIN_PATH, 'p4info': DEVICE_SW2_INFO_PATH } ) ################################## TABLE ENTRIES ################################## DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ json_config_rule_set( json_config_rule_set( Loading Loading @@ -123,6 +155,8 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ) ) ] ] DEVICE_SW2_CONFIG_TABLE_ENTRIES = DEVICE_SW1_CONFIG_TABLE_ENTRIES """ """ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ Loading Loading @@ -171,7 +205,6 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ################################## TABLE DECONF ################################## ################################## TABLE DECONF ################################## DEVICE_SW1_DECONF_TABLE_ENTRIES = [ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ json_config_rule_delete( json_config_rule_delete( 'table', 'table', Loading Loading @@ -213,6 +246,7 @@ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ ) ) ] ] DEVICE_SW2_DECONF_TABLE_ENTRIES = DEVICE_SW1_DECONF_TABLE_ENTRIES """ """ Loading Loading @@ -271,6 +305,7 @@ TOPOLOGIES = [TOPOLOGY] DEVICES = [ DEVICES = [ (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_CONFIG_TABLE_ENTRIES, DEVICE_SW2_DECONF_TABLE_ENTRIES), ] ] LINKS = [] LINKS = [] manifests/contextservice.yaml +7 −7 Original line number Original line Diff line number Diff line Loading @@ -34,10 +34,10 @@ spec: - containerPort: 6379 - containerPort: 6379 resources: resources: requests: requests: cpu: 250m cpu: 100m memory: 512Mi memory: 128Mi limits: limits: cpu: 700m cpu: 500m memory: 1024Mi memory: 1024Mi - name: server - name: server image: registry.gitlab.com/teraflow-h2020/controller/context:latest image: registry.gitlab.com/teraflow-h2020/controller/context:latest Loading @@ -64,11 +64,11 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:1010"] command: ["/bin/grpc_health_probe", "-addr=:1010"] resources: resources: requests: requests: cpu: 250m cpu: 50m memory: 512Mi memory: 64Mi limits: limits: cpu: 700m cpu: 500m memory: 1024Mi memory: 512Mi --- --- apiVersion: v1 apiVersion: v1 kind: Service kind: Service Loading Loading
.gitignore +1 −0 Original line number Original line Diff line number Diff line Loading @@ -162,6 +162,7 @@ cython_debug/ # TeraFlowSDN-generated files # TeraFlowSDN-generated files tfs_runtime_env_vars.sh tfs_runtime_env_vars.sh tfs_runtime_env_vars*.sh tfs_bchain_runtime_env_vars.sh tfs_bchain_runtime_env_vars.sh delete_local_deployment.sh delete_local_deployment.sh local_docker_deployment.sh local_docker_deployment.sh Loading
deploy.sh +60 −54 Original line number Original line Diff line number Diff line Loading @@ -36,9 +36,13 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set additional manifest files to be applied after the deployment # If not already set, set additional manifest files to be applied after the deployment export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} # If not already set, set the neew Grafana admin password # If not already set, set the new Grafana admin password export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} # If not already set, disable skip-build flag. # If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-""} ######################################################################################################################## ######################################################################################################################## # Automated steps start here # Automated steps start here ######################################################################################################################## ######################################################################################################################## Loading Loading @@ -67,6 +71,7 @@ echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT for COMPONENT in $TFS_COMPONENTS; do for COMPONENT in $TFS_COMPONENTS; do echo "Processing '$COMPONENT' component..." echo "Processing '$COMPONENT' component..." if [ "$TFS_SKIP_BUILD" != "YES" ]; then echo " Building Docker image..." echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" Loading Loading @@ -136,6 +141,7 @@ for COMPONENT in $TFS_COMPONENTS; do docker push "$IMAGE_URL" > "$PUSH_LOG" docker push "$IMAGE_URL" > "$PUSH_LOG" fi fi fi fi fi echo " Adapting '$COMPONENT' manifest file..." echo " Adapting '$COMPONENT' manifest file..." MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" Loading
hackfest/p4/setup.sh +2 −2 Original line number Original line Diff line number Diff line Loading @@ -4,5 +4,5 @@ export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl cp src/tests/netx22-p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp src/tests/netx22-p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4
hackfest/p4/tests/Objects.py +38 −3 Original line number Original line Diff line number Diff line # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # You may obtain a copy of the License at Loading Loading @@ -42,6 +43,8 @@ PACKET_PORT_SAMPLE_TYPES = [ KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, ] ] # ----- Device Credentials and Settings -------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- Loading @@ -54,7 +57,7 @@ DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) DEVICE_SW1_DPID = 1 DEVICE_SW1_DPID = 1 DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_IP_ADDR = '10.0.2.10' DEVICE_SW1_IP_ADDR = 'localhost' DEVICE_SW1_PORT = '50001' DEVICE_SW1_PORT = '50001' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' Loading @@ -78,9 +81,38 @@ DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( } } ) ) DEVICE_SW2_UUID = 'SW2' DEVICE_SW2_TIMEOUT = 60 DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) ################################## TABLE ENTRIES ################################## DEVICE_SW2_DPID = 1 DEVICE_SW2_NAME = DEVICE_SW2_UUID DEVICE_SW2_IP_ADDR = 'localhost' DEVICE_SW2_PORT = '50002' DEVICE_SW2_VENDOR = 'Open Networking Foundation' DEVICE_SW2_HW_VER = 'BMv2 simple_switch' DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( DEVICE_SW2_IP_ADDR, DEVICE_SW2_PORT, { 'id': DEVICE_SW2_DPID, 'name': DEVICE_SW2_NAME, 'vendor': DEVICE_SW2_VENDOR, 'hw_ver': DEVICE_SW2_HW_VER, 'sw_ver': DEVICE_SW2_SW_VER, 'timeout': DEVICE_SW2_TIMEOUT, 'p4bin': DEVICE_SW2_BIN_PATH, 'p4info': DEVICE_SW2_INFO_PATH } ) ################################## TABLE ENTRIES ################################## DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ json_config_rule_set( json_config_rule_set( Loading Loading @@ -123,6 +155,8 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ) ) ] ] DEVICE_SW2_CONFIG_TABLE_ENTRIES = DEVICE_SW1_CONFIG_TABLE_ENTRIES """ """ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ Loading Loading @@ -171,7 +205,6 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ################################## TABLE DECONF ################################## ################################## TABLE DECONF ################################## DEVICE_SW1_DECONF_TABLE_ENTRIES = [ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ json_config_rule_delete( json_config_rule_delete( 'table', 'table', Loading Loading @@ -213,6 +246,7 @@ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ ) ) ] ] DEVICE_SW2_DECONF_TABLE_ENTRIES = DEVICE_SW1_DECONF_TABLE_ENTRIES """ """ Loading Loading @@ -271,6 +305,7 @@ TOPOLOGIES = [TOPOLOGY] DEVICES = [ DEVICES = [ (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_CONFIG_TABLE_ENTRIES, DEVICE_SW2_DECONF_TABLE_ENTRIES), ] ] LINKS = [] LINKS = []
manifests/contextservice.yaml +7 −7 Original line number Original line Diff line number Diff line Loading @@ -34,10 +34,10 @@ spec: - containerPort: 6379 - containerPort: 6379 resources: resources: requests: requests: cpu: 250m cpu: 100m memory: 512Mi memory: 128Mi limits: limits: cpu: 700m cpu: 500m memory: 1024Mi memory: 1024Mi - name: server - name: server image: registry.gitlab.com/teraflow-h2020/controller/context:latest image: registry.gitlab.com/teraflow-h2020/controller/context:latest Loading @@ -64,11 +64,11 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:1010"] command: ["/bin/grpc_health_probe", "-addr=:1010"] resources: resources: requests: requests: cpu: 250m cpu: 50m memory: 512Mi memory: 64Mi limits: limits: cpu: 700m cpu: 500m memory: 1024Mi memory: 512Mi --- --- apiVersion: v1 apiVersion: v1 kind: Service kind: Service Loading