Merge "Add raise for iteration exception in IterationRunner"
authorRex Lee <limingjiang@huawei.com>
Fri, 14 Dec 2018 08:30:06 +0000 (08:30 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 14 Dec 2018 08:30:06 +0000 (08:30 +0000)
15 files changed:
ansible/build_yardstick_image.yml
ansible/group_vars/all.yml
ansible/install.yaml
ansible/prepare_openstack.yml
ansible/roles/add_repos_jumphost/tasks/Debian.yml
ansible/roles/build_yardstick_image/vars/main.yml
ansible/roles/configure_gui/tasks/main.yml
ansible/roles/download_drivers/defaults/main.yml
ansible/roles/enable_iommu_on_boot/tasks/main.yml
ansible/roles/install_dependencies_jumphost/tasks/Debian.yml
ansible/roles/install_dependencies_jumphost/tasks/RedHat.yml
ansible/roles/install_dependencies_jumphost/tasks/Suse.yml
ansible/roles/install_dpdk/tasks/Debian.yml
ansible/roles/install_yardstick/tasks/main.yml
docker/Dockerfile_ubuntu18 [new file with mode: 0644]

index 072c12c..495a547 100644 (file)
       'amd64': disk1
       'arm64': uefi1
     boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}"
-    image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
-    image_path: "{{ release }}/current/{{ image_filename }}"
+    image_filename:
+      'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
+      'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img"
+    image_path: "{{ release }}/current/{{ image_filename[release] }}"
     host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}"
     image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}"
-    image_dest: "{{ workspace }}/{{ image_filename }}"
+    image_dest: "{{ workspace }}/{{ image_filename[release] }}"
     sha256sums_path: "{{ release }}/current/SHA256SUMS"
     sha256sums_filename: "{{ sha256sums_path|basename }}"
     sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}"
index 5965605..0e8ad5b 100644 (file)
@@ -1,9 +1,9 @@
 ---\r
 target_os: "Ubuntu"\r
 YARD_IMG_ARCH: "amd64"\r
-IMG_PROPERTY: "normal"\r
+IMG_PROPERTY: "{{ IMAGE_PROPERTY | default('normal') }}"\r
 clone_dest: /opt/tempT\r
-release: xenial\r
+release: "{{ OS_RELEASE  | default('xenial') }}"\r
 normal_image_file: "{{ workspace }}/yardstick-image.img"\r
 nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"\r
 ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw\r
index 01478fb..084cdce 100644 (file)
@@ -21,7 +21,7 @@
 
   pre_tasks:
 
-    - name: Create NSB binaries directory, accesible to any user
+    - name: Create NSB binaries directory, accessible to any user
       file:
         path: "{{ nsb_dir }}"
         state: directory
@@ -31,8 +31,8 @@
         - installation_mode != inst_mode_container_pull
 
   roles:
-    - { role: add_repos_jumphost, when: installation_mode != inst_mode_container_pull }
-    - { role: install_dependencies_jumphost, when: installation_mode != inst_mode_container_pull }
+    - add_repos_jumphost
+    - install_dependencies_jumphost
     - { role: install_yardstick, when: installation_mode != inst_mode_container_pull }
     - { role: configure_uwsgi, when: installation_mode != inst_mode_container_pull }
     - { role: configure_nginx, when: installation_mode != inst_mode_container_pull }
   hosts: jumphost
 
   tasks:
-    - include_role:
-        name: install_dependencies_jumphost
-      when: installation_mode == inst_mode_container_pull
-
     - include_role:
         name: docker
       when: installation_mode == inst_mode_container_pull
index 6f54ef5..c9067c9 100644 (file)
@@ -23,7 +23,6 @@
   include: build_yardstick_image.yml
   vars:
     YARD_IMG_ARCH: amd64
-    release: xenial
     img_property: nsb
 
 - name: Cleanup old OpenStack images and upload the new one
index 626f0b0..e156996 100644 (file)
@@ -71,7 +71,6 @@
       deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }} main universe multiverse restricted
       deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-updates main universe multiverse restricted
       deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-security main universe multiverse restricted
-      deb [arch={{ extra_arch }}] {{ extra_repo }} {{ ansible_distribution_release }}-proposed main universe multiverse restricted
   when: installation_mode == "container"
 
 - name: Remove the marker
index 6728e5a..3d40544 100644 (file)
@@ -16,11 +16,13 @@ boot_modes:
   'amd64': disk1\r
   'arm64': uefi1\r
 boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}"\r
-image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"\r
-image_path: "{{ release }}/current/{{ image_filename }}"\r
+image_filename:\r
+  'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"\r
+  'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img"\r
+image_path: "{{ release }}/current/{{ image_filename[release] }}"\r
 host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}"\r
 image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}"\r
-image_dest: "{{ workspace }}/{{ image_filename }}"\r
+image_dest: "{{ workspace }}/{{ image_filename[release] }}"\r
 sha256sums_path: "{{ release }}/current/SHA256SUMS"\r
 sha256sums_filename: "{{ sha256sums_path|basename }}"\r
 sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}"\r
index 846a9cb..665053c 100644 (file)
     state: directory
     recurse: yes
 
+- name: Remove /etc/nginx/yardstick/gui/dist directory if it exists
+  file:
+    path: /etc/nginx/yardstick/gui/dist
+    state: absent
+
 - name: Move dist to /etc/nginx/yardstick/gui
   shell:
     cmd: mv dist /etc/nginx/yardstick/gui
index ab68a3c..bf1e48a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ---
-i40evf_version: "3.4.2"
+i40evf_version: "3.5.13"
 i40evf_gzfile: "i40evf-{{ i40evf_version }}.tar.gz"
 i40evf_url: "https://netix.dl.sourceforge.net/project/e1000/i40evf%20stable/{{ i40evf_version }}/{{ i40evf_gzfile }}"
 i40evf_dest: "{{ clone_dest }}/"
 i40evf_path: "{{ i40evf_dest }}/{{ i40evf_gzfile|regex_replace('[.]tar[.]gz$', '') }}"
 i40evf_checksum:
   "3.4.2": "sha256:a8e2a722fb2f8ac874cb39545a331761841f1724830ff1581d2012dd37314645"
+  "3.5.13": "sha256:e57b95b694c8480b905e72ea13caac8714d6bb0c9eabe37cca655505b808f033"
\ No newline at end of file
index e406fcc..188b329 100644 (file)
     iommu_boot_params: ' amd_iommu=on iommu=pt'
   when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD"
 
-- name: Define grub string for IOMMU
-  set_fact:
-    enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}'
+- block:
+  - name: Define grub string for IOMMU
+    set_fact:
+      enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}'
 
-- name: check if iommu is set by this role in {{ grub_file}}
-  lineinfile:
-    path: "{{ grub_file}}"
-    regexp: '{{ iommu_help_string }}'
-    line: '{{ iommu_help_string }}'
-    state: absent
-  check_mode: yes
-  register: is_nsb_iommu_role
-  ignore_errors: True
+  - name: check if iommu is set by this role in {{ grub_file}}
+    lineinfile:
+      path: "{{ grub_file}}"
+      regexp: '{{ iommu_help_string }}'
+      line: '{{ iommu_help_string }}'
+      state: absent
+    check_mode: yes
+    register: is_nsb_iommu_role
+    ignore_errors: True
 
-- name: Check if IOMMU is set by someone else
-  lineinfile:
-    path: "{{ grub_file}}"
-    regexp: "_iommu="
-    line: '{{ iommu_help_string }}'
-    state: absent
-  check_mode: yes
-  register: is_iommu
-  ignore_errors: True
+  - name: Check if IOMMU is set by someone else
+    lineinfile:
+      path: "{{ grub_file}}"
+      regexp: "_iommu="
+      line: '{{ iommu_help_string }}'
+      state: absent
+    check_mode: yes
+    register: is_iommu
+    ignore_errors: True
 
-- name: Send info that IOMMU is configured by someone else
-  debug:
-    msg: "INFO: NOT modified, IOMMU is already configured by someone."
-  when:
-    - not is_nsb_iommu_role.changed
-    - is_iommu.changed
+  - name: Send info that IOMMU is configured by someone else
+    debug:
+      msg: "INFO: NOT modified, IOMMU is already configured by someone."
+    when:
+      - not is_nsb_iommu_role.changed
+      - is_iommu.changed
 
-- name: Add IOMMU when it is not set
-  lineinfile:
-    path: "{{ grub_file }}"
-    regexp: "{{ iommu_help_string }}"
-    line: '{{ enable_iommu }}" {{ iommu_help_string }}'
-  when:
-    - not is_nsb_iommu_role.changed
-    - not is_iommu.changed
+  - name: Add IOMMU when it is not set
+    lineinfile:
+      path: "{{ grub_file }}"
+      regexp: "{{ iommu_help_string }}"
+      line: '{{ enable_iommu }}" {{ iommu_help_string }}'
+    when:
+      - not is_nsb_iommu_role.changed
+      - not is_iommu.changed
 
-- name: find boot grub.cfg
-  find:
-    paths: /boot
-    file_type: file
-    patterns: 'grub*.cfg'
-    recurse: yes
-  register: grub_files
+  - name: find boot grub.cfg
+    find:
+      paths: /boot
+      file_type: file
+      patterns: 'grub*.cfg'
+      recurse: yes
+    register: grub_files
 
-- include: manual_modify_grub.yml
-  # only tested on Ubuntu, kernel line is probably different on other distros
-  with_items: "{{ grub_files.files }}"
-  when: ansible_distribution == "Ubuntu"
+  - include: manual_modify_grub.yml
+    # only tested on Ubuntu, kernel line is probably different on other distros
+    with_items: "{{ grub_files.files }}"
+    when: ansible_distribution == "Ubuntu"
+  when: iommu_boot_params is defined
index 9baf7e5..6c3900d 100755 (executable)
   apt:
     update_cache: yes
 
+- name: Install dependency for Ubuntu 18
+  action: "{{ ansible_pkg_mgr }} name=libssl1.0-dev state=present"
+  when:
+    - ansible_distribution == 'Ubuntu'
+    - ansible_distribution_major_version|int >= 17
+
 - name: Install core packages
   action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
   with_items:
     - vim
     - libffi-dev
     - libfuse-dev
-    - libssl-dev
     - libxft-dev
     - libxml2-dev
     - libxss-dev
-    - libxslt-dev
     - libxslt1-dev
-    - libzmq-dev
+    - libzmq3-dev
     - qemu-user-static
     - qemu-utils
     - kpartx
     - python
     - python-setuptools
     - python-dev
-    - python-pip
     - python-libvirt
     - python-virtualenv
     - bridge-utils
@@ -54,7 +57,6 @@
     - uwsgi-plugin-python
     - supervisor
     - lsof
-    - nodejs
     - npm
     - rabbitmq-server
 
 - name: Remove useless packages from the cache
   apt:
     autoclean: yes
+
+# There is a bug with the easy install ansible module in Ubuntu 16.04 linux.
+# Refer https://github.com/ansible/ansible/issues/23534
+- name: Install pip
+  shell: easy_install -U pip
+  when:
+    - ansible_distribution == 'Ubuntu'
+    - ansible_distribution_major_version|int <= 16
+
+- name: Install python-pip
+  action: "{{ ansible_pkg_mgr }} name=python-pip state=present"
+  when:
+    - ansible_distribution == 'Ubuntu'
+    - ansible_distribution_major_version|int >= 17
+
+- name: Install required docker-py module
+  pip:
+    name: docker-py
+    state: latest
+  environment: "{{ proxy_env }}"
index af53c9c..7932ed9 100644 (file)
@@ -47,3 +47,9 @@
     - openssl
     - python-virtualenv
     - ccze
+
+# There is a bug with the easy install ansible module in suse linux.
+# Until this is fixed the shell command must be used
+# Refer https://github.com/ansible/ansible/issues/37296
+- name: Install pip
+  shell: easy_install -U pip
index 4f0c3c8..b76a0fb 100755 (executable)
@@ -17,6 +17,7 @@
   with_items:
     - libpcap-dev
     - pciutils
+    - libelf-dev
 
 - name: Install kernel headers
   action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
index 203acc3..f93f8ee 100644 (file)
     scope: global
     value: False
 
-# There is a bug with the easy install ansible module in suse linux.
-# Until this is fixed the shell command must be used
-- name: Install pip
-  shell: easy_install -U pip
-#    easy_install:
-#    name: pip
-#    state: latest
-
 - name: Install Yardstick requirements (venv)
   pip:
     requirements: "{{ yardstick_dir }}/requirements.txt"
diff --git a/docker/Dockerfile_ubuntu18 b/docker/Dockerfile_ubuntu18
new file mode 100644 (file)
index 0000000..a9dfaeb
--- /dev/null
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+FROM ubuntu:18.04
+
+LABEL image=opnfv/yardstick
+
+ARG BRANCH=master
+
+# GIT repo directory
+ENV REPOS_DIR="/home/opnfv/repos" \
+    IMAGE_DIR="/home/opnfv/images/"
+
+# Set work directory
+
+# Yardstick repo
+ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick/" \
+    RELENG_REPO_DIR="${REPOS_DIR}/releng" \
+    STORPERF_REPO_DIR="${REPOS_DIR}/storperf"
+
+RUN apt-get update && apt-get install -y git python python-setuptools python-pip iputils-ping && apt-get -y autoremove && apt-get clean
+
+RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 openstacksdk==0.9.17 python-openstackclient==3.12.1 python-heatclient==1.11.1 ansible==2.5.5
+
+RUN mkdir -p ${REPOS_DIR}
+
+RUN git config --global http.sslVerify false
+#For developers: To test your changes you must comment out the git clone for ${YARDSTICK_REPO_DIR}.
+#You must also uncomment the RUN and COPY commands below.
+#You must run docker build from your yardstick directory on the host.
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR}
+#RUN mkdir ${YARDSTICK_REPO_DIR}
+#COPY ./ ${YARDSTICK_REPO_DIR}
+RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/storperf ${STORPERF_REPO_DIR}
+
+RUN ansible-playbook -i ${YARDSTICK_REPO_DIR}/ansible/install-inventory.ini -c local -vvv -e INSTALLATION_MODE="container" ${YARDSTICK_REPO_DIR}/ansible/install.yaml
+
+RUN ${YARDSTICK_REPO_DIR}/docker/supervisor.sh
+
+RUN echo "daemon off;" >> /etc/nginx/nginx.conf
+# nginx=5000, rabbitmq=5672
+EXPOSE 5000 5672
+
+ADD http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img ${IMAGE_DIR}
+ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img ${IMAGE_DIR}
+
+# For developers: when `docker build ...` is running from YARDSTICK_REPO_DIR, please change
+#                 path `./exec_tests.sh` -> `./docker/exec_tests.sh``.
+COPY ./exec_tests.sh /usr/local/bin/
+
+ENV NSB_DIR="/opt/nsb_bin"
+ENV PYTHONPATH="${PYTHONPATH}:${NSB_DIR}/trex_client:${NSB_DIR}/trex_client/stl"
+
+WORKDIR ${REPOS_DIR}
+CMD ["/usr/bin/supervisord"]