Browse Source

NFV workload

This workload accomplishes the following:
1. Pull OPNFV Opera code
2. Leverage Opera code to install OPEN-O, deploy Clearwater vIMS by
OPEN-O
3. Pull OPNFV Functest
4. Run the Functest vIMS test cases to ensure vIMS is working
5. Generate calling information

The previous patch[1] was merged by accident and it did not follow
community rule. Thus it was reverted by patch[2]. Resubmit the NFV
workload.

[1] https://review.openstack.org/#/c/439492/
[2] https://review.openstack.org/#/c/459557

Change-Id: I615acc5cc19a3ae71f3d8a5023b6fda6e29e7602
Signed-off-by: yaohelan <yaohelan@huawei.com>
yaohelan 2 years ago
parent
commit
bdf7d9355a

+ 2
- 4
.gitignore View File

@@ -23,10 +23,8 @@ setuptools*.egg/
23 23
 !/.mailmap
24 24
 !/.pylintrc
25 25
 !/.testr.conf
26
+run/
27
+*.retry
26 28
 
27 29
 # Files created by releasenotes build
28 30
 releasenotes/build
29
-
30
-    Contact GitHub API Training Shop Blog About 
31
-
32
-

+ 1
- 0
requirements.txt View File

@@ -5,3 +5,4 @@
5 5
 pbr>=1.8 # Apache-2.0
6 6
 ansible>=2.0.0.0 # GNU LGPL 3.0
7 7
 shade==1.13.2 # Apache-2.0
8
+docker-py==1.9.0 # Apache-2.0

+ 8
- 0
tox.ini View File

@@ -54,3 +54,11 @@ setenv =
54 54
     ANSIBLE_INVENTORY = {env:K8S_DIR}/hosts
55 55
     ANSIBLE_CONFIG = {env:K8S_DIR}/ansible.cfg
56 56
 commands = ansible-playbook -e "action=apply {posargs}" {env:K8S_DIR}/site.yml
57
+
58
+[testenv:nfv]
59
+deps =
60
+    {[testenv:ansible]deps}
61
+setenv =
62
+    {[testenv:ansible]setenv}
63
+    NFV_DIR = {toxinidir}/workloads/ansible/openo/nfv
64
+commands = ansible-playbook {env:NFV_DIR}/nfv_launch.yml

+ 121
- 0
workloads/ansible/openo/nfv/README.md View File

@@ -0,0 +1,121 @@
1
+# NFV Ansible deployments on OpenStack Cloud
2
+
3
+This ansible playbook will install an OPEN-O first then deploy
4
+Clearwater vIMS by OPEN-O.
5
+
6
+Once the script finishes, a vIMS is ready to be used.
7
+
8
+## Status
9
+
10
+Complete
11
+
12
+## Requirements
13
+
14
+- [Install Ansible](http://docs.ansible.com/ansible/intro_installation.html)
15
+- [Install docker-py 1.9.0](https://github.com/docker/docker-py)
16
+- Make sure there is a VM to be used to install OPEN-O.
17
+
18
+  It should meet the requirements below
19
+
20
+  - at least 4 CPUs, 64G RAM, 100G Disk
21
+
22
+- Make sure the OpenStack cloud is able to deploy at least 7 nodes.
23
+
24
+  Each node requires resources as below
25
+
26
+  - 1 CPU, 2G RAM, 2G RAM, 20G Disk
27
+
28
+- Clone this project into a directory to the VM
29
+
30
+## Ansible
31
+
32
+Ansible will be used to orchestrate the whole process
33
+
34
+### Prep
35
+
36
+#### General OpenStack Settings
37
+
38
+Before running the script, cloud environment authentication needs to be
39
+provided. Please update the file under group_vars/all
40
+
41
+There is one example for your reference
42
+
43
+  ##### group_vars/all::
44
+
45
+    os_project_domain_name: default
46
+    os_user_domain_name: default
47
+    os_username: admin
48
+    os_password: password
49
+    os_project_name: admin
50
+    os_auth_url: http://205.156.212.201:5000/v3
51
+    os_identity_api_version: 3
52
+    os_region_name: RegionOne
53
+
54
+## Run the script to deploy vIMS with the help of OPEN-O
55
+
56
+With your cloud environment set, you should be able to run the script::
57
+
58
+    tox -e nfv
59
+
60
+The above command will firstly install Ansible and other required packages.
61
+
62
+Then, it will deploy OPEN-O, and a vIMS will be set up by
63
+OPEN-O. This step is done by OPNFV Opera Project.
64
+
65
+[OPNFV Opera Project](https://github.com/opnfv/opera)
66
+
67
+Also, OPNFV Functest is leveraged to test the vIMS to make sure it is
68
+working.
69
+
70
+[OPNFV Functest Project](https://github.com/opnfv/functest)
71
+
72
+## The results of the work load successful run
73
+
74
+If everything goes well, it will accomplish the following::
75
+
76
+    1. Deploy OPEN-O docker containers
77
+    2. Create security group
78
+    3. Add security rules to allow icmp, tcp and ucp ports
79
+    4. Deploy a VM on OpenStack and install Juju
80
+    5. Connect Juju with OPEN-O and OpenStack
81
+    6. Configure OPEN-O with vIMS topology definition
82
+    7. Deploy vIMS Clearwater via OPEN-O
83
+    8. Test the vIMS Clearwater by leveraging OPNFV Functest
84
+    9. Create user on Ellis of vIMS Clearwater
85
+    10. Create calling number on Ellis of vIMS Clearwater
86
+
87
+### Environment Information
88
+
89
+- OPEN-O can be accessed through
90
+
91
+http://VM_host_IP/openoui/common/default.html
92
+
93
+- Calling information is put under {{ playbook_dir }}/run/results/ellis.info
94
+
95
+- Log is put under {{ playbook_dir }}/run/results/opera.log
96
+
97
+
98
+## Execution Duration
99
+
100
+The process involves pulling 20+ docker images and downloading about nearly 4G
101
+OpenStack images. The time it takes can be impacted by the network enormously.
102
+Thus the duration varies from lab to lab. If this step is once run, it will be
103
+skipped in the future round of execution. One suggestion is to run this step
104
+in advance to decrease the whole execution duration.
105
+
106
+The deployment and configuration of OPEN-O takes approximately 30~40 minutes.
107
+
108
+The deployment of vIMS Clearwater takes about 30~40 minutes. It also depends on
109
+the network as vIMS downloads quite a number of packages.
110
+
111
+
112
+## Next Steps
113
+
114
+### Make a call via SIP client
115
+
116
+Install the SIP client, e.g. jitsi and configure the client with calling
117
+information.
118
+
119
+### Cleanup
120
+
121
+Script is needed to clean up the environment.

+ 21
- 0
workloads/ansible/openo/nfv/group_vars/all View File

@@ -0,0 +1,21 @@
1
+---
2
+#  Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#  not use this file except in compliance with the License. You may obtain
4
+#  a copy of the License at
5
+#
6
+#       http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#  Unless required by applicable law or agreed to in writing, software
9
+#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#  License for the specific language governing permissions and limitations
12
+#  under the License.
13
+
14
+os_project_domain_name: default
15
+os_user_domain_name: default
16
+os_username: admin
17
+os_password: password
18
+os_project_name: admin
19
+os_auth_url: http://205.156.212.201:5000/v3
20
+os_identity_api_version: 3
21
+os_region_name: RegionOne

+ 116
- 0
workloads/ansible/openo/nfv/nfv_launch.yml View File

@@ -0,0 +1,116 @@
1
+---
2
+#  Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#  not use this file except in compliance with the License. You may obtain
4
+#  a copy of the License at
5
+#
6
+#       http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#  Unless required by applicable law or agreed to in writing, software
9
+#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#  License for the specific language governing permissions and limitations
12
+#  under the License.
13
+
14
+- hosts: localhost
15
+  remote_user: root
16
+  max_fail_percentage: 0
17
+  tasks:
18
+    - set_fact:
19
+        starttime: "{{ ansible_date_time }}"
20
+
21
+    - set_fact:
22
+        exec_dir: "{{ playbook_dir }}/run"
23
+
24
+    - set_fact:
25
+        opera_dir: "{{ exec_dir }}/opera"
26
+
27
+    - set_fact:
28
+        results_dir: "{{ exec_dir }}/results"
29
+
30
+    - name: Creates execution directory
31
+      file: path={{ exec_dir }} state=directory
32
+
33
+    - name: pull OPNFV Opera code
34
+      git:
35
+        repo: https://github.com/opnfv/opera.git
36
+        dest: "{{ opera_dir }}"
37
+        update: no
38
+
39
+    - name: config admin-openrc.sh
40
+      template:
41
+        src: admin-openrc.sh.j2
42
+        dest: "{{ opera_dir }}/conf/admin-openrc.sh"
43
+
44
+    - name: pull OPNFV Functest docker image to test vIMS
45
+      docker_image:
46
+        name: yaohelan/functest:stable
47
+        state: present
48
+        force: yes
49
+
50
+    - name: Creates result directory
51
+      file: path={{ results_dir }} state=directory
52
+
53
+    - name: create the opera log file
54
+      file: dest={{ results_dir }}/opera.log state=touch
55
+
56
+    - name: deploy OPEN-O and vIMS
57
+      shell: "{{ opera_dir }}/opera_launch.sh > opera.log"
58
+      args:
59
+        chdir: "{{ results_dir }}"
60
+
61
+    - name: create openstack.creds
62
+      shell: cp {{ opera_dir }}/conf/admin-openrc.sh {{ opera_dir }}/conf/openstack.creds
63
+
64
+    - name: remove OPNFV Functest docker container
65
+      shell: "docker rm -f functest-opera || true"
66
+
67
+    - name: get open-o endpoint
68
+      shell: . {{ opera_dir }}/work/scripts/open-o.conf; echo $OPENO_IP:$COMMON_SERVICES_MSB_PORT
69
+      register: openo_endpoint
70
+
71
+    - name: Creates Functest result directory
72
+      file: path={{ results_dir }}/functest state=directory
73
+
74
+    - name: run OPNFV Functest docker container
75
+      command: "docker run -id
76
+             -v {{ opera_dir }}/conf/openstack.creds:/home/opnfv/functest/conf/openstack.creds
77
+             -v {{ results_dir }}/functest:/home/opnfv/functest/results
78
+             -e INSTALLER_TYPE=unknown
79
+             -e DEPLOY_SCENARIO=unknown
80
+             -e OPENO_MSB_ENDPOINT={{ item }}
81
+             -e CI_DEBUG=false
82
+             --name=functest-opera
83
+             yaohelan/functest:stable /bin/bash"
84
+      with_items: "{{ openo_endpoint.stdout_lines }}"
85
+
86
+    - name: start OPNFV Functest docker container
87
+      command: "docker start functest-opera"
88
+
89
+    - name: run vIMS test on OPNFV Functest
90
+      command: docker exec functest-opera python /home/opnfv/repos/functest/functest/ci/run_tests.py -t opera_ims
91
+
92
+    - name: copy call information
93
+      command: docker cp functest-opera:/home/opnfv/functest/results/opera_ims/ellis.info {{ results_dir }}/ellis.info
94
+
95
+    - name: get end time
96
+      shell: date '+%H:%M:%S'
97
+      register: end_time
98
+
99
+    - debug:
100
+        msg: >-
101
+          Access OPEN-O dashboard at
102
+          http://{{ openo_endpoint.stdout_lines }}
103
+
104
+    - name: get Ellis call information
105
+      command: /bin/cat {{ results_dir }}/ellis.info
106
+      register: details
107
+
108
+    - debug:
109
+        msg: >-
110
+          Ellis details
111
+          {{ details.stdout_lines }}
112
+
113
+    - debug:
114
+          msg: >-
115
+            The work load started at {{ starttime.time }},
116
+            ended at {{ end_time.stdout }}

+ 20
- 0
workloads/ansible/openo/nfv/templates/admin-openrc.sh.j2 View File

@@ -0,0 +1,20 @@
1
+#  Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#  not use this file except in compliance with the License. You may obtain
3
+#  a copy of the License at
4
+#
5
+#       http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#  Unless required by applicable law or agreed to in writing, software
8
+#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#  License for the specific language governing permissions and limitations
11
+#  under the License.
12
+
13
+export OS_PROJECT_DOMAIN_NAME={{ os_project_domain_name }}
14
+export OS_USER_DOMAIN_NAME={{ os_user_domain_name }}
15
+export OS_USERNAME={{ os_username }}
16
+export OS_PASSWORD={{ os_password }}
17
+export OS_PROJECT_NAME={{ os_project_name }}
18
+export OS_AUTH_URL={{ os_auth_url }}
19
+export OS_IDENTITY_API_VERSION={{ os_identity_api_version }}
20
+export OS_REGION_NAME={{ os_region_name }}

Loading…
Cancel
Save