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
This commit is contained in:
Michal Nasiadka 2024-12-12 11:30:37 +01:00
parent e628cbddb1
commit 81a5a7cf4d
5 changed files with 0 additions and 209 deletions

View File

@ -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

View File

@ -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-*

View File

@ -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 <<EOF
auth_url: ${OS_AUTH_URL}
username: ${OS_USERNAME}
password: ${OS_PASSWORD}
project_name: ${OS_PROJECT_NAME}
project_domain_name: ${OS_PROJECT_DOMAIN_NAME}
user_domain_name: ${OS_USER_DOMAIN_NAME}
EOF
cat > ./kolla-sample-vnfd.yaml <<EOF
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Demo example
metadata:
template_name: sample-tosca-vnfd
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
nfv_compute:
properties:
num_cpus: 1
mem_size: 512 MB
disk_size: 0 GB
properties:
image: ${IMAGE_ID}
availability_zone: nova
mgmt_driver: noop
user_data_format: RAW
user_data: |
#!/bin/sh
echo 1 > /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

View File

@ -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 <<EOF
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Sample VNFFG template
topology_template:
description: Sample VNFFG template
node_templates:
Forwarding_path1:
type: tosca.nodes.nfv.FP.TackerV2
description: creates path (CP12->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

View File

@ -9,21 +9,8 @@ export PYTHONUNBUFFERED=1
function test_tacker { function test_tacker {
echo "TESTING: Tacker VIM,VNFD and VNF creation" echo "TESTING: Tacker VIM,VNFD and VNF creation"
sh contrib/demos/tacker/deploy-tacker-demo
openstack vim list openstack vim list
openstack vnf 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 { function test_barbican {