From 81a5a7cf4d7a27a7c98cc968506b9f44cda257e7 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 12 Dec 2024 11:30:37 +0100 Subject: [PATCH] Remove tacker demos from contrib and their usage in nfv CI These are not usable for long time, based on legacy API [1], CI fails with non-existent openstack client commands. [1]: https://review.opendev.org/c/openstack/python-tackerclient/+/900977 Change-Id: I316f6fc364bcff58c1f3ea1d884ec52de6e1675f --- contrib/demos/tacker/README.rst | 20 ----- contrib/demos/tacker/cleanup-tacker | 20 ----- contrib/demos/tacker/deploy-tacker-demo | 73 ------------------ contrib/demos/tacker/deploy-tacker-demo-sfc | 83 --------------------- tests/test-scenario-nfv.sh | 13 ---- 5 files changed, 209 deletions(-) delete mode 100644 contrib/demos/tacker/README.rst delete mode 100644 contrib/demos/tacker/cleanup-tacker delete mode 100644 contrib/demos/tacker/deploy-tacker-demo delete mode 100644 contrib/demos/tacker/deploy-tacker-demo-sfc diff --git a/contrib/demos/tacker/README.rst b/contrib/demos/tacker/README.rst deleted file mode 100644 index 22138c0009..0000000000 --- a/contrib/demos/tacker/README.rst +++ /dev/null @@ -1,20 +0,0 @@ -A Kolla Demo using Tacker -========================= - -By default, the deploy script will spawn 1 Nova instance on a Neutron -network created from the tools/init-runonce script. - -Then run the deploy script: - -:: - - $ ./deploy-tacker-demo - -After the demo is deployed, a cleanup script can be used to remove -resources created by deploy script. - -To run the cleanup script: - -:: - - $ ./cleanup-tacker diff --git a/contrib/demos/tacker/cleanup-tacker b/contrib/demos/tacker/cleanup-tacker deleted file mode 100644 index a21dc1bd19..0000000000 --- a/contrib/demos/tacker/cleanup-tacker +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -if [[ -f kolla-sample-vnffgd.yaml ]]; then - echo "Deleting VNFFG" - openstack vnf graph delete kolla-sample-vnffg - echo "Deleting VNFFGD" - openstack vnf graph descriptor delete kolla-sample-vnffgd - echo "Deleting sample sfc instances" - openstack server delete kolla_sfc_server kolla_sfc_client -fi -echo "Deleting sample VNF" -openstack vnf delete kolla-sample-vnf -while openstack vnf list | grep -q kolla-sample-vnf; do - sleep 1 -done -echo "Deleting sample VNFD" -openstack vnf descriptor delete kolla-sample-vnfd -echo "Deleting sample VIM" -openstack vim delete kolla-sample-vim -echo "Removing sample config" -rm -rf ./kolla-sample-* diff --git a/contrib/demos/tacker/deploy-tacker-demo b/contrib/demos/tacker/deploy-tacker-demo deleted file mode 100644 index 990c3e3349..0000000000 --- a/contrib/demos/tacker/deploy-tacker-demo +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -function gen_config { - echo "Generating sample config" - DEMO_NET=$(openstack network list | awk '/demo-net/ { print $2 }') - IMAGE_ID=$(openstack image list | awk '/cirros/ { print $2 }') - cat > ./kolla-sample-vim.yaml < ./kolla-sample-vnfd.yaml < /proc/sys/net/ipv4/ip_forward - - CP11: - type: tosca.nodes.nfv.CP.Tacker - properties: - management: true - order: 0 - anti_spoofing_protection: false - requirements: - - virtualLink: - node: VL1 - - virtualBinding: - node: VDU1 - - VL1: - type: tosca.nodes.nfv.VL - properties: - network_name: ${DEMO_NET} - vendor: Tacker -EOF -} - -function deploy { - echo "Registering sample VIM" - openstack vim register --config-file ./kolla-sample-vim.yaml --description "kolla sample vim" --is-default kolla-sample-vim - echo "Creating sample VNFD" - openstack vnf descriptor create --vnfd-file ./kolla-sample-vnfd.yaml kolla-sample-vnfd - echo "Creating sample VNF" - VNFD_ID=$(openstack vnf descriptor list | awk '/kolla-sample-vnfd/ { print $2 }') - openstack vnf create --vnfd-id ${VNFD_ID} kolla-sample-vnf -} - -gen_config -deploy diff --git a/contrib/demos/tacker/deploy-tacker-demo-sfc b/contrib/demos/tacker/deploy-tacker-demo-sfc deleted file mode 100644 index 8741d8d64c..0000000000 --- a/contrib/demos/tacker/deploy-tacker-demo-sfc +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -function create_servers { - echo "Creating SFC demo instances" - DEMO_NET=$(openstack network list | awk '/demo-net/ { print $2 }') - IMAGE_ID=$(openstack image list | awk '/cirros/ { print $2 }') - FLOATING_IP_CLIENT=$(openstack floating ip create public1 -c floating_ip_address -f value) - FLOATING_IP_SERVER=$(openstack floating ip create public1 -c floating_ip_address -f value) - openstack server create --wait --flavor m1.tiny --image $IMAGE_ID --nic net-id=$DEMO_NET kolla_sfc_server - openstack server create --wait --flavor m1.tiny --image $IMAGE_ID --nic net-id=$DEMO_NET kolla_sfc_client - openstack server add floating ip kolla_sfc_client $FLOATING_IP_CLIENT - openstack server add floating ip kolla_sfc_server $FLOATING_IP_SERVER - KOLLA_SFC_CLIENT_PORT=$(openstack port list --server kolla_sfc_client | awk '/ACTIVE/ {print $2}') -} - -function sfc_gen_config { - echo "Tacker SFC config files" - cat > ./kolla-sample-vnffgd.yaml <CP12) - properties: - id: 51 - policy: - type: ACL - criteria: - - name: block_http - classifier: - network_src_port_id: ${KOLLA_SFC_CLIENT_PORT} - network_id: ${DEMO_NET} - ip_proto: 6 - destination_port_range: 80-80 - path: - - forwarder: kolla-sample-vnfd - capability: CP11 - - groups: - VNFFG1: - type: tosca.groups.nfv.VNFFG - description: HTTP to Corporate Net - properties: - vendor: tacker - version: 1.0 - number_of_endpoints: 1 - dependent_virtual_link: [VL1] - connection_point: [CP11] - constituent_vnfs: [kolla-sample-vnfd] - members: [Forwarding_path1] -EOF -} - -function deploy_sfc { - bash ./deploy-tacker-demo - create_servers - sfc_gen_config - echo "Creating VNFFGD" - openstack vnf graph descriptor create --vnffgd-file kolla-sample-vnffgd.yaml kolla-sample-vnffgd - echo "Creating VNFFG" - openstack vnf graph create --vnffgd-name kolla-sample-vnffgd kolla-sample-vnffg - echo "Tacker sfc client floating ip address: $FLOATING_IP_CLIENT" - echo "Tacker sfc server floating ip address: $FLOATING_IP_SERVER" - cat << EOF - -Done. - -To create simple HTTP server in tacker_sfc_server instance run: - -ssh cirros@$FLOATING_IP_SERVER 'while true; \\ - do echo -e "HTTP/1.0 200 OK\r\n\r\nW00t from Kolla HTTP server!" | sudo nc -l -p 80 ; done &' - -EOF -} - -deploy_sfc diff --git a/tests/test-scenario-nfv.sh b/tests/test-scenario-nfv.sh index af9f382023..33a455e396 100755 --- a/tests/test-scenario-nfv.sh +++ b/tests/test-scenario-nfv.sh @@ -9,21 +9,8 @@ export PYTHONUNBUFFERED=1 function test_tacker { echo "TESTING: Tacker VIM,VNFD and VNF creation" - sh contrib/demos/tacker/deploy-tacker-demo openstack vim list openstack vnf list - openstack vnf descriptor list - - while [[ $(openstack vnf show kolla-sample-vnf -f value -c status) != "ACTIVE" ]]; do - echo "VNF not running yet" - attempt=$((attempt+1)) - if [[ $attempt -eq 10 ]]; then - echo "VNF failed to start" - openstack vnf show kolla-sample-vnf - return 1 - fi - sleep 10 - done } function test_barbican {