From 7f0f1eaf717f7016d2f9ec5328cf9a0d02104222 Mon Sep 17 00:00:00 2001 From: Ace Lee Date: Fri, 3 Nov 2017 06:39:00 +0000 Subject: update docker version to 16.04 JIRA: YARDSTICK-690 This patch is for Yardstick Docker base image upgrade to 16.04 This patch will enable ansible build image in yardstick env prepare. Add qemu-img convert to ansible build image. Change-Id: I43127b6020bd20bd9f4aac4fca0df75353b24346 Signed-off-by: Ace Lee --- ansible/build_yardstick_image.yml | 11 +++++++++-- .../roles/install_image_dependencies/defaults/main.yml | 3 +++ docker/Dockerfile | 12 ++++++------ install.sh | 4 +++- tests/ci/load_images.sh | 15 +++++++++------ 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml index 35d9da45e..d7ac866c2 100644 --- a/ansible/build_yardstick_image.yml +++ b/ansible/build_yardstick_image.yml @@ -29,7 +29,6 @@ sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}" workspace: "{{ lookup('env', 'workspace')|default('/tmp/workspace/yardstick', true) }}" - imgfile: "{{ workspace }}/yardstick-image.img" raw_imgfile_basename: "yardstick-{{ release }}-server.raw" environment: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin @@ -40,6 +39,9 @@ - package: name=parted state=present + - set_fact: + imgfile: "{{ workspace }}/yardstick-image.img" + - set_fact: mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}" @@ -205,6 +207,11 @@ - name: include {{ img_modify_playbook }} include: "{{ img_modify_playbook }}" +- hosts: localhost + tasks: + - name: convert image to image file + command: "qemu-img convert -c -o compat=0.10 -O qcow2 {{ raw_imgfile }} {{ imgfile }}" + - name: run post build tasks include: post_build_yardstick_image.yml @@ -212,4 +219,4 @@ tasks: - debug: - msg: "yardstick image = {{ raw_imgfile }}" + msg: "yardstick image = {{ imgfile }}" diff --git a/ansible/roles/install_image_dependencies/defaults/main.yml b/ansible/roles/install_image_dependencies/defaults/main.yml index 362fa351b..f0b53215a 100644 --- a/ansible/roles/install_image_dependencies/defaults/main.yml +++ b/ansible/roles/install_image_dependencies/defaults/main.yml @@ -20,6 +20,9 @@ install_dependencies: - stress - sysstat - unzip + - netperf + - bonnie++ + - lmbench # for Trex - libpython2.7-dev # for IxLoad diff --git a/docker/Dockerfile b/docker/Dockerfile index b48a550bf..0c6e804a8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,22 +7,22 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -FROM ubuntu:14.04 +FROM ubuntu:16.04 LABEL image=opnfv/yardstick ARG BRANCH=master # GIT repo directory -ENV REPOS_DIR /home/opnfv/repos -ENV IMAGE_DIR /home/opnfv/images/ +ENV REPOS_DIR="/home/opnfv/repos" \ + IMAGE_DIR="/home/opnfv/images/" # Set work directory # Yardstick repo -ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick -ENV RELENG_REPO_DIR ${REPOS_DIR}/releng -ENV STORPERF_REPO_DIR ${REPOS_DIR}/storperf +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-setuptools python-pip RUN easy_install -U setuptools==30.0.0 diff --git a/install.sh b/install.sh index dfad3a51a..db0bff41e 100755 --- a/install.sh +++ b/install.sh @@ -81,7 +81,9 @@ apt-get update && apt-get install -y \ python-pip \ vim \ libxft-dev \ - libxss-dev + libxss-dev \ + sudo \ + iputils-ping if [[ "${DOCKER_ARCH}" != "aarch64" ]]; then apt-get install -y libc6:arm64 diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh index e73d7e800..666a78b40 100755 --- a/tests/ci/load_images.sh +++ b/tests/ci/load_images.sh @@ -63,11 +63,14 @@ build_yardstick_image() fi else if [ ! -f "${QCOW_IMAGE}" ];then - local cmd - cmd="sudo $(which yardstick-img-modify) $(pwd)/tools/ubuntu-server-cloudimg-modify.sh" - - # Build the image. Retry once if the build fails - $cmd || $cmd + ANSIBLE_SCRIPTS="${0%/*}/../../ansible" + cd ${ANSIBLE_SCRIPTS} &&\ + ansible-playbook \ + -e img_modify_playbook='ubuntu_server_cloudimg_modify.yml' \ + -e target_os='Ubuntu' \ + -e YARD_IMG_ARCH='amd64' \ + -e ubuntu_img_file="${QCOW_IMAGE}" \ + -vvv -i inventory.ini build_yardstick_image.yml if [ ! -f "${QCOW_IMAGE}" ]; then echo "Failed building QCOW image" @@ -209,7 +212,7 @@ create_nova_flavor() echo echo "========== Creating yardstick-flavor ==========" # Create the nova flavor used by some sample test cases - openstack ${SECURE} flavor create --id 100 --ram 1024 --disk 3 --vcpus 1 yardstick-flavor + openstack ${SECURE} flavor create --id 100 --ram 1024 --disk 10 --vcpus 1 yardstick-flavor # DPDK-enabled OVS requires guest memory to be backed by large pages if [[ $DEPLOY_SCENARIO == *[_-]ovs[_-]* ]]; then openstack ${SECURE} flavor set --property hw:mem_page_size=large yardstick-flavor -- cgit 1.2.3-korg