Loading src/tests/ryu-openflow/.gitlab-ci.yml +35 −33 Original line number Diff line number Diff line Loading @@ -37,10 +37,9 @@ build ryu-openflow: - src/common/**/*.py - proto/*.proto - src/tests/${TEST_NAME}/**/*.{py,in,sh,yml} - src/tests/${TEST_NAME}/Dockerfile #- src/tests/${TEST_NAME}/Dockerfile - src/tests/${TEST_NAME}/*.Dockerfile - .gitlab-ci.yml # # - docker rm -f na-t1 na-t2 na-r1 na-r2 # - docker network rm -f na-br # Loading @@ -53,7 +52,6 @@ build ryu-openflow: # --volume "$PWD/src/tests/${TEST_NAME}/node-agents-config/platform_t1.xml:/confd/examples.confd/OC23/platform.xml" # asgamb1/oc23bgp.img:latest /confd/examples.confd/OC23/startNetconfAgent.sh # Deploy TeraFlowSDN and Execute end-2-end test end2end_test ryu-openflow: timeout: 90m Loading @@ -67,9 +65,8 @@ end2end_test ryu-openflow: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker ps -aq | xargs -r docker rm -f #- containerlab destroy --all --cleanup || true # cleanup mininet - docker run --rm "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" mn -c #- docker run --rm "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" mn -c script: - echo "Starting script section" ## Download Docker images to run the test Loading @@ -87,14 +84,18 @@ end2end_test ryu-openflow: ###- docker network create -d bridge --subnet=172.254.254.0/24 --gateway=172.254.254.1 tfs-test-ryu - docker network create -d bridge --subnet=172.20.0.0/24 --gateway=172.20.0.1 tfs-test-ryu - docker run -d --name ryu --network tfs-test-ryu --ip 172.20.0.10 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}" - sleep 3 - docker logs ryu - docker ps -a - | echo "Waiting for Ryu to be ready..." until curl -s http://172.20.0.10:8080 >/dev/null; do until curl http://172.20.0.10:8080/; do echo "Still waiting..." sleep 5 done echo "Ryu is ready!" - docker run -d --name mininet --network tfs-test-ryu --ip 172.20.0.11 --privileged --ulimit memlock=-1:-1 --ulimit nofile=65536:65536 --ulimit nproc=65536:65536 --volume /lib/modules:/lib/modules "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" # - docker run -d --name mininet --network tfs-test-ryu --ip 172.20.0.11 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" Loading @@ -116,26 +117,27 @@ end2end_test ryu-openflow: # Configure TeraFlowSDN deployment ## Uncomment if DEBUG log level is needed for the components - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml ## #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml - source src/tests/${TEST_NAME}/deploy_specs.sh - export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}" - export TFS_SKIP_BUILD="YES" - export TFS_IMAGE_TAG="latest" - echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}" ## #- export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}" #- export TFS_SKIP_BUILD="YES" #- export TFS_IMAGE_TAG="latest" #- echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}" # Deploy TeraFlowSDN - ./deploy/crdb.sh - ./deploy/nats.sh - ./deploy/kafka.sh #- ./deploy/qdb.sh - ./deploy/qdb.sh - ./deploy/tfs.sh - ./deploy/show.sh # # ## Wait for Context to be subscribed to NATS # ## WARNING: this loop is infinite if there is no subscriber (such as monitoring). Loading Loading @@ -171,12 +173,12 @@ end2end_test ryu-openflow: #- docker exec ryu-openflow-mininet ovs-ofctl dump-flows s5 # # Run end-to-end test: configure service IETF # - > # docker run -t --rm --name ${TEST_NAME} --network=host # --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh" # --volume "$PWD/src/tests/${TEST_NAME}:/opt/results" # $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh # Run end-to-end test: configure service IETF - > docker run -t --rm --name ${TEST_NAME} --network=host --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh" --volume "$PWD/src/tests/${TEST_NAME}:/opt/results" $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh # # # Dump configuration of the switches (OpenFlow rules configured) (after configure IETF service) # Loading src/tests/ryu-openflow/Ryu.Dockerfile +1 −2 Original line number Diff line number Diff line Loading @@ -26,9 +26,8 @@ RUN pip install --no-cache-dir --upgrade pip \ #COPY apps/ /opt/ryu-apps/ # Copy Ryu Apps, if any WORKDIR /opt/ryu-apps #WORKDIR /opt/ryu-apps # --- OpenFlow & Ryu REST API ports --- EXPOSE 6653/tcp 8080/tcp CMD ["ryu-manager", "--verbose", "--observe-links", "ryu.app.ofctl_rest", "ryu.app.gui_topology.gui_topology"] Loading
src/tests/ryu-openflow/.gitlab-ci.yml +35 −33 Original line number Diff line number Diff line Loading @@ -37,10 +37,9 @@ build ryu-openflow: - src/common/**/*.py - proto/*.proto - src/tests/${TEST_NAME}/**/*.{py,in,sh,yml} - src/tests/${TEST_NAME}/Dockerfile #- src/tests/${TEST_NAME}/Dockerfile - src/tests/${TEST_NAME}/*.Dockerfile - .gitlab-ci.yml # # - docker rm -f na-t1 na-t2 na-r1 na-r2 # - docker network rm -f na-br # Loading @@ -53,7 +52,6 @@ build ryu-openflow: # --volume "$PWD/src/tests/${TEST_NAME}/node-agents-config/platform_t1.xml:/confd/examples.confd/OC23/platform.xml" # asgamb1/oc23bgp.img:latest /confd/examples.confd/OC23/startNetconfAgent.sh # Deploy TeraFlowSDN and Execute end-2-end test end2end_test ryu-openflow: timeout: 90m Loading @@ -67,9 +65,8 @@ end2end_test ryu-openflow: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker ps -aq | xargs -r docker rm -f #- containerlab destroy --all --cleanup || true # cleanup mininet - docker run --rm "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" mn -c #- docker run --rm "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" mn -c script: - echo "Starting script section" ## Download Docker images to run the test Loading @@ -87,14 +84,18 @@ end2end_test ryu-openflow: ###- docker network create -d bridge --subnet=172.254.254.0/24 --gateway=172.254.254.1 tfs-test-ryu - docker network create -d bridge --subnet=172.20.0.0/24 --gateway=172.20.0.1 tfs-test-ryu - docker run -d --name ryu --network tfs-test-ryu --ip 172.20.0.10 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}" - sleep 3 - docker logs ryu - docker ps -a - | echo "Waiting for Ryu to be ready..." until curl -s http://172.20.0.10:8080 >/dev/null; do until curl http://172.20.0.10:8080/; do echo "Still waiting..." sleep 5 done echo "Ryu is ready!" - docker run -d --name mininet --network tfs-test-ryu --ip 172.20.0.11 --privileged --ulimit memlock=-1:-1 --ulimit nofile=65536:65536 --ulimit nproc=65536:65536 --volume /lib/modules:/lib/modules "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" # - docker run -d --name mininet --network tfs-test-ryu --ip 172.20.0.11 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" Loading @@ -116,26 +117,27 @@ end2end_test ryu-openflow: # Configure TeraFlowSDN deployment ## Uncomment if DEBUG log level is needed for the components - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml ## #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml - source src/tests/${TEST_NAME}/deploy_specs.sh - export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}" - export TFS_SKIP_BUILD="YES" - export TFS_IMAGE_TAG="latest" - echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}" ## #- export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}" #- export TFS_SKIP_BUILD="YES" #- export TFS_IMAGE_TAG="latest" #- echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}" # Deploy TeraFlowSDN - ./deploy/crdb.sh - ./deploy/nats.sh - ./deploy/kafka.sh #- ./deploy/qdb.sh - ./deploy/qdb.sh - ./deploy/tfs.sh - ./deploy/show.sh # # ## Wait for Context to be subscribed to NATS # ## WARNING: this loop is infinite if there is no subscriber (such as monitoring). Loading Loading @@ -171,12 +173,12 @@ end2end_test ryu-openflow: #- docker exec ryu-openflow-mininet ovs-ofctl dump-flows s5 # # Run end-to-end test: configure service IETF # - > # docker run -t --rm --name ${TEST_NAME} --network=host # --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh" # --volume "$PWD/src/tests/${TEST_NAME}:/opt/results" # $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh # Run end-to-end test: configure service IETF - > docker run -t --rm --name ${TEST_NAME} --network=host --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh" --volume "$PWD/src/tests/${TEST_NAME}:/opt/results" $CI_REGISTRY_IMAGE/${TEST_NAME}:latest /var/teraflow/run-service-ietf-create.sh # # # Dump configuration of the switches (OpenFlow rules configured) (after configure IETF service) # Loading
src/tests/ryu-openflow/Ryu.Dockerfile +1 −2 Original line number Diff line number Diff line Loading @@ -26,9 +26,8 @@ RUN pip install --no-cache-dir --upgrade pip \ #COPY apps/ /opt/ryu-apps/ # Copy Ryu Apps, if any WORKDIR /opt/ryu-apps #WORKDIR /opt/ryu-apps # --- OpenFlow & Ryu REST API ports --- EXPOSE 6653/tcp 8080/tcp CMD ["ryu-manager", "--verbose", "--observe-links", "ryu.app.ofctl_rest", "ryu.app.gui_topology.gui_topology"]