diff options
Diffstat (limited to 'samples')
4 files changed, 550 insertions, 0 deletions
diff --git a/samples/vnf_samples/nsut/cmts/k8s_vcmts_topology.yaml b/samples/vnf_samples/nsut/cmts/k8s_vcmts_topology.yaml new file mode 100755 index 000000000..95ac76964 --- /dev/null +++ b/samples/vnf_samples/nsut/cmts/k8s_vcmts_topology.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2019 Viosoft Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{% set num_tg = get(extra_args, 'num_tg', 2) %} +{% set num_sg = get(extra_args, 'num_sg', 2) %} + +nsd:nsd-catalog: + nsd: + - id: vcmts-topology + name: vcmts-topology + short-name: vcmts-topology + description: vcmts-topology + constituent-vnfd: + {% for tg_num in range(0, num_tg) %} + - member-vnf-index: '{{ tg_num + 1 }}' + vnfd-id-ref: tg__{{ tg_num }} + VNF model: ../../vnf_descriptors/tg_vcmts_tpl.yaml #VNF type + {% endfor %} + {% for vnf_num in range(0, num_sg * 2) %} + - member-vnf-index: '{{ vnf_num + num_tg + 1 }}' + vnfd-id-ref: vnf__{{ vnf_num }} + VNF model: ../../vnf_descriptors/vnf_vcmts_tpl.yaml #VNF type + {% endfor %} + + vld: [] diff --git a/samples/vnf_samples/nsut/cmts/tc_vcmts_k8s_pktgen.yaml b/samples/vnf_samples/nsut/cmts/tc_vcmts_k8s_pktgen.yaml new file mode 100755 index 000000000..6c85a0892 --- /dev/null +++ b/samples/vnf_samples/nsut/cmts/tc_vcmts_k8s_pktgen.yaml @@ -0,0 +1,360 @@ +# Copyright (c) 2019 Viosoft Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +{% set num_tg = 2 %} +{% set num_sg = 4 %} + +{% set vcmtsd_image = "vcmts-d:perf" %} +{% set qat_on = false %} + +schema: "yardstick:task:0.1" + +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/fixed.yaml + extra_args: + num_sg: {{ num_sg }} + num_tg: {{ num_tg }} + topology: k8s_vcmts_topology.yaml + nodes: +{% for tg_num in range(0, num_tg) %} + tg__{{ tg_num }}: pktgen{{ tg_num }}-k8syardstick +{% endfor %} +{% for vnf_index in range(0, num_sg) %} + vnf__{{ vnf_index * 2 }}: vnf{{ vnf_index }}us-k8syardstick + vnf__{{ (vnf_index * 2) + 1}}: vnf{{ vnf_index }}ds-k8syardstick +{% endfor %} + + runner: + type: Duration + duration: 120 + + options: + vcmts_influxdb_ip: "10.80.5.150" + vcmts_influxdb_port: 8086 + vcmtsd_values: /etc/yardstick/vcmtsd_values.yaml + pktgen_values: /etc/yardstick/pktgen_values.yaml + pktgen_rate: 6.5 +{% for vnf_index in range(0, num_sg) %} + vnf__{{ vnf_index * 2 }}: + sg_id: {{ vnf_index }} + stream_dir: "us" + vnf__{{ (vnf_index * 2) + 1}}: + sg_id: {{ vnf_index }} + stream_dir: "ds" +{% endfor %} +{% for tg_num in range(0, num_tg) %} + tg__{{ tg_num }}: + pktgen_id: {{ tg_num }} +{% endfor %} + +context: + name: k8syardstick + type: Kubernetes + + servers: +{% for vnf_index in range(0, num_sg) %} + vnf{{ vnf_index }}us: + nodeSelector: + vcmts: "true" + containers: + - image: {{ vcmtsd_image }} + imagePullPolicy: IfNotPresent + env: + - name: CMK_PROC_FS + value: "/host/proc" + command: /bin/bash + args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.; + chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart; + while true ; do sleep 10000; done'] + resources: + requests: + memory: 10Ki +{% if qat_on %} + hugepages-1Gi: 2Gi + qat.intel.com/generic: '1' +{% else %} + hugepages-1Gi: 1Gi +{% endif %} + limits: + memory: 1Gi +{% if qat_on %} + hugepages-1Gi: 2Gi + qat.intel.com/generic: '1' +{% else %} + hugepages-1Gi: 1Gi +{% endif %} + lifecycle: + postStart: + exec: + command: [ "/bin/bash", "-c", "env > /tmp/qat" ] + volumeMounts: + - name: vcmts-configmap-vcmtspod + mountPath: /vcmts-config + - name: hugepages + mountPath: /hugepages + readOnly: false + - name: collectd + mountPath: /opt/collectd/var + readOnly: false + - name: sysfs + mountPath: /sys + readOnly: false + - name: sriov + mountPath: /sriov-cni + readOnly: false + - name: host-proc + mountPath: /host/proc + readOnly: true + - name: cmk-install-dir + mountPath: /opt/bin + - name: cmk-conf-dir + mountPath: /etc/cmk + - name: power-mgmt + mountPath: /opt/power_mgmt + ports: + - containerPort: 22022 + securityContext: + allowPrivilegeEscalation: true + privileged: true + node_ports: + - name: lua # Lower case alphanumeric characters or '-' + port: 22022 + networks: + - flannel + - xe0 + - xe1 + volumes: + - name: vcmts-configmap-vcmtspod + configMap: + name: vcmts-configmap-vcmtspod + defaultMode: 0744 + - name: hugepages + emptyDir: + medium: HugePages + - name: collectd + hostPath: + path: /opt/collectd/var + - name: sysfs + hostPath: + path: /sys + - name: sriov + hostPath: + path: /var/lib/cni/sriov + - name: cmk-install-dir + hostPath: + path: /opt/bin + - name: host-proc + hostPath: + path: /proc + - name: cmk-conf-dir + hostPath: + path: /etc/cmk + - name: power-mgmt + hostPath: + path: /opt/power_mgmt + + vnf{{ vnf_index }}ds: + nodeSelector: + vcmts: "true" + containers: + - image: {{ vcmtsd_image }} + imagePullPolicy: IfNotPresent + env: + - name: CMK_PROC_FS + value: "/host/proc" + command: /bin/bash + args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.; + chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart; + while true ; do sleep 10000; done'] + resources: + requests: + memory: 10Ki +{% if qat_on %} + hugepages-1Gi: 2Gi + qat.intel.com/generic: '1' +{% else %} + hugepages-1Gi: 1Gi +{% endif %} + limits: + memory: 1Gi +{% if qat_on %} + hugepages-1Gi: 2Gi + qat.intel.com/generic: '1' +{% else %} + hugepages-1Gi: 1Gi +{% endif %} + lifecycle: + postStart: + exec: + command: [ "/bin/bash", "-c", "env > /tmp/qat" ] + volumeMounts: + - name: vcmts-configmap-vcmtspod + mountPath: /vcmts-config + - name: hugepages + mountPath: /hugepages + readOnly: false + - name: collectd + mountPath: /opt/collectd/var + readOnly: false + - name: sysfs + mountPath: /sys + readOnly: false + - name: sriov + mountPath: /sriov-cni + readOnly: false + - name: host-proc + mountPath: /host/proc + readOnly: true + - name: cmk-install-dir + mountPath: /opt/bin + - name: cmk-conf-dir + mountPath: /etc/cmk + - name: power-mgmt + mountPath: /opt/power_mgmt + ports: + - containerPort: 22022 + securityContext: + allowPrivilegeEscalation: true + privileged: true + node_ports: + - name: lua # Lower case alphanumeric characters or '-' + port: 22022 + networks: + - flannel + - xe0 + - xe1 + volumes: + - name: vcmts-configmap-vcmtspod + configMap: + name: vcmts-configmap-vcmtspod + defaultMode: 0744 + - name: hugepages + emptyDir: + medium: HugePages + - name: collectd + hostPath: + path: /opt/collectd/var + - name: sysfs + hostPath: + path: /sys + - name: sriov + hostPath: + path: /var/lib/cni/sriov + - name: cmk-install-dir + hostPath: + path: /opt/bin + - name: host-proc + hostPath: + path: /proc + - name: cmk-conf-dir + hostPath: + path: /etc/cmk + - name: power-mgmt + hostPath: + path: /opt/power_mgmt +{% endfor %} + +{% for index in range(0, num_tg) %} + pktgen{{index}}: + nodeSelector: + vcmtspktgen: "true" + containers: + - image: vcmts-pktgen:v18.10 + imagePullPolicy: IfNotPresent + tty: true + stdin: true + env: + - name: LUA_PATH + value: "/vcmts/Pktgen.lua" + - name: CMK_PROC_FS + value: "/host/proc" + command: /bin/bash + args: ['-c', 'mkdir /root/.ssh; cp /tmp/.ssh/authorized_keys ~/.ssh/.; + chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart; + while true ; do sleep 10000; done'] + resources: + requests: + hugepages-1Gi: 9Gi + memory: 200Mi + limits: + hugepages-1Gi: 9Gi + memory: 200Mi + volumeMounts: + - name: sysfs + mountPath: /sys + readOnly: false + - name: hugepages + mountPath: /hugepages + readOnly: false + - name: sriov + mountPath: /sriov-cni + readOnly: false + - name: host-proc + mountPath: /host/proc + readOnly: true + - name: cmk-install-dir + mountPath: /opt/bin + - name: cmk-conf-dir + mountPath: /etc/cmk + - name: pktgen-config + mountPath: /pktgen-config + ports: + - containerPort: 22022 + securityContext: + allowPrivilegeEscalation: true + privileged: true + volumes: + - name: sysfs + hostPath: + path: /sys + - name: hugepages + emptyDir: + medium: HugePages + - name: sriov + hostPath: + path: /var/lib/cni/sriov + - name: cmk-install-dir + hostPath: + path: /opt/bin + - name: host-proc + hostPath: + path: /proc + - name: cmk-conf-dir + hostPath: + path: /etc/cmk + - name: pktgen-config + configMap: + name: vcmts-configmap-pktgen + defaultMode: 0744 + node_ports: + - name: lua # Lower case alphanumeric characters or '-' + port: 22022 + networks: + - flannel + - xe0 + - xe1 +{% endfor %} + + networks: + flannel: + args: '[{ "delegate": { "isDefaultGateway": true }}]' + plugin: flannel + xe0: + args: '[{ "delegate": { "isDefaultGateway": true }}]' + plugin: flannel + xe1: + args: '[{ "delegate": { "isDefaultGateway": true }}]' + plugin: flannel diff --git a/samples/vnf_samples/vnf_descriptors/tg_vcmts_tpl.yaml b/samples/vnf_samples/vnf_descriptors/tg_vcmts_tpl.yaml new file mode 100755 index 000000000..bb56fcb6a --- /dev/null +++ b/samples/vnf_samples/vnf_descriptors/tg_vcmts_tpl.yaml @@ -0,0 +1,77 @@ +# Copyright (c) 2019 Viosoft Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd:vnfd-catalog: + vnfd: + - id: VcmtsPktgen + name: vcmtspktgen + short-name: vcmtspktgen + description: vCMTS Pktgen Kubernetes + vm-flavor: + vcpu-count: '4' + memory-mb: '4096' + mgmt-interface: + vdu-id: vcmtspktgen-kubernetes + {% if user is defined %} + user: '{{user}}' # Value filled by vnfdgen + {% endif %} + {% if password is defined %} + password: '{{password}}' # Value filled by vnfdgen + {% endif %} + {% if ip is defined %} + ip: '{{ip}}' # Value filled by vnfdgen + {% endif %} + {% if key_filename is defined %} + key_filename: '{{key_filename}}' # Value filled by vnfdgen + {% endif %} + connection-point: + - name: xe0 + type: VPORT + - name: xe1 + type: VPORT + vdu: + - id: vcmtspktgen-kubernetes + name: vcmtspktgen-kubernetes + description: vCMTS Pktgen Kubernetes + external-interface: + - name: xe0 + virtual-interface: + type: virtio + # Substitution variables MUST be quoted. Otherwise Python can misinterpet them. + vpci: '{{ interfaces.xe0.vpci }}' # Value filled by vnfdgen + local_iface_name: eth0 # '{{ interfaces.xe0.local_iface_name }}' + driver: '{{ interfaces.xe0.driver}}' # Value filled by vnfdgen + local_ip: '{{ interfaces.xe0.local_ip }}' # Value filled by vnfdgen + dst_ip: '{{ interfaces.xe0.dst_ip }}' # Value filled by vnfdgen + local_mac: '{{ interfaces.xe0.local_mac }}' # Value filled by vnfdgen + dst_mac: '{{ interfaces.xe0.dst_mac }}' # Value filled by vnfdgen + bandwidth: 10 Gbps + vnfd-connection-point-ref: xe0 + - name: xe1 + virtual-interface: + type: virtio + # Substitution variables MUST be quoted. Otherwise Python can misinterpet them. + vpci: '{{ interfaces.xe1.vpci }}' # Value filled by vnfdgen + local_iface_name: eth0 # '{{ interfaces.xe1.local_iface_name }}' + local_ip: '{{ interfaces.xe1.local_ip }}' # Value filled by vnfdgen + driver: '{{ interfaces.xe1.driver}}' # Value filled by vnfdgen + dst_ip: '{{ interfaces.xe1.dst_ip }}' # Value filled by vnfdgen + local_mac: '{{ interfaces.xe1.local_mac }}' # Value filled by vnfdgen + dst_mac: '{{ interfaces.xe1.dst_mac }}' # Value filled by vnfdgen + bandwidth: 10 Gbps + vnfd-connection-point-ref: xe0 + benchmark: + kpi: + - upstream/bits_per_second + diff --git a/samples/vnf_samples/vnf_descriptors/vnf_vcmts_tpl.yaml b/samples/vnf_samples/vnf_descriptors/vnf_vcmts_tpl.yaml new file mode 100755 index 000000000..d1eb6a869 --- /dev/null +++ b/samples/vnf_samples/vnf_descriptors/vnf_vcmts_tpl.yaml @@ -0,0 +1,77 @@ +# Copyright (c) 2019 Viosoft Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd:vnfd-catalog: + vnfd: + - id: VcmtsVNF + name: vcmtsvnf + short-name: vcmtsvnf + description: vCMTS Upstream-Downstream Kubernetes + vm-flavor: + vcpu-count: '4' + memory-mb: '4096' + mgmt-interface: + vdu-id: vcmtsvnf-kubernetes + {% if user is defined %} + user: '{{user}}' # Value filled by vnfdgen + {% endif %} + {% if password is defined %} + password: '{{password}}' # Value filled by vnfdgen + {% endif %} + {% if ip is defined %} + ip: '{{ip}}' # Value filled by vnfdgen + {% endif %} + {% if key_filename is defined %} + key_filename: '{{key_filename}}' # Value filled by vnfdgen + {% endif %} + connection-point: + - name: xe0 + type: VPORT + - name: xe1 + type: VPORT + vdu: + - id: vcmtsvnf-kubernetes + name: vcmtsvnf-kubernetes + description: vCMTS Upstream-Downstream Kubernetes + external-interface: + - name: xe0 + virtual-interface: + type: virtio + # Substitution variables MUST be quoted. Otherwise Python can misinterpet them. + vpci: '{{ interfaces.xe0.vpci }}' # Value filled by vnfdgen + local_iface_name: eth0 # NOT TESTED YET '{{ interfaces.xe0.local_iface_name }}' # Value filled by vnfdgen + driver: '{{ interfaces.xe0.driver}}' # Value filled by vnfdgen + local_ip: '{{ interfaces.xe0.local_ip }}' # Value filled by vnfdgen + dst_ip: '{{ interfaces.xe0.dst_ip }}' # Value filled by vnfdgen + local_mac: '{{ interfaces.xe0.local_mac }}' # Value filled by vnfdgen + dst_mac: '{{ interfaces.xe0.dst_mac }}' # Value filled by vnfdgen + bandwidth: 10 Gbps + vnfd-connection-point-ref: xe0 + - name: xe1 + virtual-interface: + type: virtio + # Substitution variables MUST be quoted. Otherwise Python can misinterpet them. + vpci: '{{ interfaces.xe1.vpci }}' # Value filled by vnfdgen + local_iface_name: eth0 # NOT TESTED YET '{{ interfaces.xe1.local_iface_name }}' # Value filled by vnfdgen + local_ip: '{{ interfaces.xe1.local_ip }}' # Value filled by vnfdgen + driver: '{{ interfaces.xe1.driver}}' # Value filled by vnfdgen + dst_ip: '{{ interfaces.xe1.dst_ip }}' # Value filled by vnfdgen + local_mac: '{{ interfaces.xe1.local_mac }}' # Value filled by vnfdgen + dst_mac: '{{ interfaces.xe1.dst_mac }}' # Value filled by vnfdgen + bandwidth: 10 Gbps + vnfd-connection-point-ref: xe0 + benchmark: + kpi: + - upstream/bits_per_second + |