From bf3ce71ec5074eb30a866ea8b6e01aad03d58e64 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Thu, 14 Mar 2019 08:02:56 +0000 Subject: Add PAPI dependencies + Various small structure optmizations Change-Id: I1aac9353f72436de53797fc734bef498905c8189 Signed-off-by: Peter Mikus --- .../csit-sut-dcr/ubuntu_1804_amd64/Dockerfile | 14 ++- .../roles/common/files/apt-sources-arm.list | 47 --------- .../ansible/roles/common/files/apt-sources.list | 61 ----------- .../common/files/apt-sources_bionic_aarch64.list | 47 +++++++++ .../common/files/apt-sources_bionic_x86_64.list | 61 +++++++++++ .../ansible/roles/common/tasks/main.yaml | 5 +- .../ansible/roles/common/tasks/ubuntu.yaml | 31 ------ .../ansible/roles/common/tasks/ubuntu_bionic.yaml | 24 +++++ .../ansible/roles/sut/tasks/main.yaml | 5 +- .../ansible/roles/sut/tasks/ubuntu.yaml | 23 ---- .../ansible/roles/sut/tasks/ubuntu_bionic.yaml | 26 +++++ .../testbed-setup/ansible/roles/tg/tasks/main.yaml | 5 +- .../ansible/roles/tg/tasks/ubuntu.yaml | 11 -- .../ansible/roles/tg/tasks/ubuntu_bionic.yaml | 11 ++ .../ansible/roles/tg_sut/files/requirements.txt | 56 ---------- .../ansible/roles/tg_sut/tasks/main.yaml | 49 +++++---- .../ansible/roles/tg_sut/tasks/ubuntu.yaml | 116 -------------------- .../ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml | 117 +++++++++++++++++++++ 18 files changed, 332 insertions(+), 377 deletions(-) delete mode 100644 resources/tools/testbed-setup/ansible/roles/common/files/apt-sources-arm.list delete mode 100644 resources/tools/testbed-setup/ansible/roles/common/files/apt-sources.list create mode 100644 resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list create mode 100644 resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list delete mode 100644 resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu.yaml create mode 100644 resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml delete mode 100644 resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml create mode 100644 resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml delete mode 100644 resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu.yaml create mode 100644 resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml delete mode 100644 resources/tools/testbed-setup/ansible/roles/tg_sut/files/requirements.txt delete mode 100644 resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml create mode 100644 resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml (limited to 'resources/tools') diff --git a/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile index c7aa3363cf..a681c21e4f 100644 --- a/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile +++ b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2019 Cisco and/or its affiliates. # 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: @@ -14,9 +14,8 @@ FROM ubuntu:bionic-20180821 MAINTAINER csit-dev -LABEL Description="CSIT vpp-device ubuntu 18.04 baseline image" -LABEL Vendor="cisco.com" -LABEL Version="0.4" +LABEL Description="CSIT vpp-device ubuntu 18.04 baseline image (x86)" +LABEL Version="0.6" # Setup the environment ENV DEBIAN_FRONTEND=noninteractive @@ -82,6 +81,7 @@ RUN apt-get -q update \ libnuma1 \ python-cffi \ python-enum34 \ + python3-cffi \ && rm -rf /var/lib/apt/lists/* # Configure locales @@ -97,7 +97,7 @@ RUN mkdir -p /tmp/dumps \ && mkdir -p /var/cache/vpp/python \ && mkdir -p /var/run/sshd -# PIP pre-cache +# CSIT PIP pre-cache RUN pip install \ docopt==0.6.2 \ ecdsa==0.13 \ @@ -119,6 +119,10 @@ RUN pip install \ numpy==1.14.5 \ scipy==1.1.0 +# VPP PIP pre-cache +RUN pip install \ + aenum + # SSH settings RUN echo 'root:Csit1234' | chpasswd \ && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources-arm.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources-arm.list deleted file mode 100644 index 08da1ecf96..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources-arm.list +++ /dev/null @@ -1,47 +0,0 @@ -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse - -deb http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted -deb http://ports.ubuntu.com/ubuntu-ports bionic-security universe -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security universe -deb http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://archive.canonical.com/ubuntu bionic partner -# deb-src http://archive.canonical.com/ubuntu bionic partner diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources.list deleted file mode 100644 index e8ccadfc64..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources.list +++ /dev/null @@ -1,61 +0,0 @@ -# deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted - -# deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -# deb http://security.ubuntu.com/ubuntu bionic-security main restricted - -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. -deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic universe -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse - -deb http://security.ubuntu.com/ubuntu bionic-security main restricted -deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted -deb http://security.ubuntu.com/ubuntu bionic-security universe -deb-src http://security.ubuntu.com/ubuntu bionic-security universe -deb http://security.ubuntu.com/ubuntu bionic-security multiverse -deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://archive.canonical.com/ubuntu bionic partner -# deb-src http://archive.canonical.com/ubuntu bionic partner - -## Uncomment the following two lines to add software from Ubuntu's -## 'extras' repository. -## This software is not part of Ubuntu, but is offered by third-party -## developers who want to ship their latest software. -# deb http://extras.ubuntu.com/ubuntu bionic main -# deb-src http://extras.ubuntu.com/ubuntu bionic main diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list new file mode 100644 index 0000000000..08da1ecf96 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list @@ -0,0 +1,47 @@ +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse +deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse + +deb http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted +deb http://ports.ubuntu.com/ubuntu-ports bionic-security universe +deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security universe +deb http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu bionic partner +# deb-src http://archive.canonical.com/ubuntu bionic partner diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list new file mode 100644 index 0000000000..e8ccadfc64 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list @@ -0,0 +1,61 @@ +# deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted + +# deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted +# deb http://security.ubuntu.com/ubuntu bionic-security main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://us.archive.ubuntu.com/ubuntu/ bionic universe +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe +deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse +deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse + +deb http://security.ubuntu.com/ubuntu bionic-security main restricted +deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted +deb http://security.ubuntu.com/ubuntu bionic-security universe +deb-src http://security.ubuntu.com/ubuntu bionic-security universe +deb http://security.ubuntu.com/ubuntu bionic-security multiverse +deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu bionic partner +# deb-src http://archive.canonical.com/ubuntu bionic partner + +## Uncomment the following two lines to add software from Ubuntu's +## 'extras' repository. +## This software is not part of Ubuntu, but is offered by third-party +## developers who want to ship their latest software. +# deb http://extras.ubuntu.com/ubuntu bionic main +# deb-src http://extras.ubuntu.com/ubuntu bionic main diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml index 6844358eca..d7355883e0 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml @@ -9,9 +9,8 @@ with_dict: "{{ proxy_env }}" when: proxy_env is defined -- name: Ubuntu specific - import_tasks: ubuntu.yaml - when: ansible_distribution|lower == 'ubuntu' +- name: Install distribution - release - machine prerequisites + include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - name: Set hostname hostname: diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu.yaml deleted file mode 100644 index ae606cd494..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# file: roles/common/tasks/ubuntu.yaml - -- name: Copy aarch64 apt sources file - template: - src: 'files/apt-sources-arm.list' - dest: '/etc/apt/sources.list' - tags: copy-apt-sources - when: ansible_machine == 'aarch64' - -- name: Copy x86_64 apt sources file - template: - src: 'files/apt-sources.list' - dest: '/etc/apt/sources.list' - tags: copy-apt-sources - when: ansible_machine == 'x86_64' - -- name: Install CSIT dependencies - apt: - name: '{{ item }}' - state: 'present' - install_recommends: False - with_items: - - 'python-apt' - - 'python-setuptools' - - 'git' - - 'crudini' - - 'expect' - - 'socat' - - 'qemu-system' - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml new file mode 100644 index 0000000000..d80eb5edac --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml @@ -0,0 +1,24 @@ +--- +# file: roles/common/tasks/ubuntu_bionic.yaml + +- name: Copy apt sources file + template: + src: 'files/apt-sources_{{ ansible_distribution_release }}_{{ ansible_machine }}.list' + dest: '/etc/apt/sources.list' + tags: copy-apt-sources + +- name: Install CSIT dependencies + apt: + name: '{{ item }}' + state: 'present' + cache_valid_time: 3600 + install_recommends: False + with_items: + - 'python-apt' + - 'python-setuptools' + - 'git' + - 'crudini' + - 'expect' + - 'socat' + - 'qemu-system' + tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml index f5a2dd86ad..90990b6c3b 100644 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml @@ -1,9 +1,8 @@ --- # file: roles/sut/tasks/main.yaml -- name: Ubuntu specific - import_tasks: ubuntu.yaml - when: ansible_distribution|lower == 'ubuntu' +- name: Install distribution - release - machine prerequisites + include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - name: Taishan aarch64 specific import_tasks: taishan_workaround.yaml diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml deleted file mode 100644 index 69ca52916e..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# file: roles/sut/tasks/ubuntu.yaml - -- name: Install CSIT dependencies - apt: - name: '{{ item }}' - state: 'present' - install_recommends: False - with_items: - - 'dkms' - - 'pkg-config' - - 'libglib2.0-dev' - - 'autoconf' - - 'libtool' - - 'screen' - - 'libmbedcrypto1' - - 'libmbedtls10' - - 'libmbedx509-0' - - 'lxc' - - 'openjdk-8-jdk' - - 'libpixman-1-dev' - - 'python-cffi' - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml new file mode 100644 index 0000000000..7ed9daed22 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml @@ -0,0 +1,26 @@ +--- +# file: roles/sut/tasks/ubuntu_bionic.yaml + +- name: Install CSIT dependencies + apt: + name: '{{ item }}' + state: 'present' + install_recommends: False + with_items: + - 'dkms' + - 'pkg-config' + - 'libglib2.0-dev' + - 'autoconf' + - 'libtool' + - 'screen' + - 'libmbedcrypto1' + - 'libmbedtls10' + - 'libmbedx509-0' + - 'lxc' + - 'openjdk-8-jdk' + - 'libpixman-1-dev' + - 'python-cffi' + - 'python-cffi-backend' + - 'python3-cffi' + - 'python3-cffi-backend' + tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml index 9fa19b5b0f..f3f5d85aa1 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml @@ -1,6 +1,5 @@ --- # file: roles/tg/tasks/main.yaml -- name: Ubuntu specific - import_tasks: ubuntu.yaml - when: ansible_distribution|lower == 'ubuntu' +- name: Install distribution - release - machine prerequisites + include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu.yaml deleted file mode 100644 index acb4f9802e..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# file: roles/tg/tasks/ubuntu.yaml - -- name: Install CSIT dependencies - apt: - name: '{{ item }}' - state: 'present' - install_recommends: False - with_items: - - 'unzip' - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml new file mode 100644 index 0000000000..f60aaeec64 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml @@ -0,0 +1,11 @@ +--- +# file: roles/tg/tasks/ubuntu_bionic.yaml + +- name: Install CSIT dependencies + apt: + name: '{{ item }}' + state: 'present' + install_recommends: False + with_items: + - 'unzip' + tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/files/requirements.txt b/resources/tools/testbed-setup/ansible/roles/tg_sut/files/requirements.txt deleted file mode 100644 index 0ce17e2b47..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/files/requirements.txt +++ /dev/null @@ -1,56 +0,0 @@ -# DISCLAIMER: BEFORE EDITING THIS FILE! -# -# This file has two closely related consequences. -# The common part is that this file defines -# the content of virtual Python environment -# used when Robot tests are running. -# The difference is in which machine the environment is created on. -# For the Jenkins executor machines, -# editing this file has no surprising consequences. -# -# But the environment is also being created -# on virtual machines created by VIRL, which do have specific restrictions. -# Complete package and setting snapshot (for both VIRL and Physical Testbed), -# with network being limited in case of VIRL to local only. -# This implies pip currently being set to site-packages only -# for both VIRL and Physical Testbed. -# So if the "virl image" applied on the machine -# does not reflect the edits, some installations might fail. -# Even if the failure may not directly impact execution, -# this leads into inconsistency between installed environment -# and the code base which may lead into fatal error or uncaught exceptions. -# -# The "virl image" is built from files such as -# resources/tools/disk-image-builder/ubuntu/lists/ubuntu-16.04.1_2017-10-21_2.0/pip-requirements.txt -# but the build is not automated, -# the new "virl image" has to be built and applied manually -# before your edit can pass. -# This also means, incompatible virl images -# would make existing tests fail until your edit is merged. -# -# TODO: Automate the virtualenv download and distribution -# on all types of testbeds prior the test execution. -# TODO: Figure out a way to verify edits to this file automatically. - -# TODO: Split into directly needed packages and their dependencies. -docopt==0.6.2 # for pykwalify -ecdsa==0.13 -enum34==1.1.2 -ipaddress==1.0.16 -paramiko==1.16.0 -pexpect==4.6.0 -pycrypto==2.6.1 -pykwalify==1.5.0 -pypcap==1.1.5 -python-dateutil==2.4.2 # for pykwalify -PyYAML==3.11 -requests==2.9.1 -robotframework==2.9.2 -scapy==2.3.1 -scp==0.10.2 -six==1.12.0 # for python-dateutil - -# The following is only there for PLRsearch. -dill==0.2.8.2 -numpy==1.14.5 -scipy==1.1.0 diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml index e5da2fc72d..1ad96b26fc 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml @@ -1,22 +1,16 @@ --- # file: roles/tg_sut/tasks/main.yaml -- name: Ubuntu specific - import_tasks: ubuntu.yaml - when: ansible_distribution|lower == 'ubuntu' +- name: Install distribution - release - machine prerequisites + include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' -- name: x86 specific - import_tasks: x86_64.yaml - when: ansible_machine == 'x86_64' +- name: Machine specifics + include_tasks: '{{ ansible_machine }}.yaml' - name: skylake specific import_tasks: skylake.yaml when: ("skylake" in groups) and inventory_hostname in groups['skylake'] -- name: aarch specific - import_tasks: aarch64.yaml - when: ansible_machine == 'aarch64' - - name: Copy netplan network config file template: src: 'files/netplan_config' @@ -53,21 +47,40 @@ mode: '0644' tags: copy-cpufrequtils -- name: Copy Python requirements file - copy: - src: 'files/requirements.txt' - dest: '/tmp/requirements.txt' - tags: copy-pip - - name: Set ondemand service to disable service: name: 'ondemand' enabled: 'no' tags: set-ondemand -- name: Install PIP requirements +- name: Install CSIT PIP requirements + pip: + name: '{{ item }}' + with_items: + - 'docopt==0.6.2' + - 'ecdsa==0.13' + - 'enum34==1.1.2' + - 'ipaddress==1.0.16' + - 'paramiko==1.16.0' + - 'pexpect==4.6.0' + - 'pycrypto==2.6.1' + - 'pykwalify==1.5.0' + - 'pypcap==1.1.5' + - 'python-dateutil==2.4.2' + - 'PyYAML==3.11' + - 'requests==2.9.1' + - 'robotframework==2.9.2' + - 'scapy==2.3.1' + - 'scp==0.10.2' + - 'six==1.12.0' + - 'dill==0.2.8.2' + - 'numpy==1.14.5' + - 'scipy==1.1.0' + tags: install-pip + +- name: Install VPP PIP requirements pip: - requirements: '/tmp/requirements.txt' + name: 'aenum' tags: install-pip - name: Load vfio-pci by default diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml deleted file mode 100644 index 2f75ae545d..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml +++ /dev/null @@ -1,116 +0,0 @@ ---- -# file: roles/tg_sut/tasks/ubuntu.yaml - -- name: Install CSIT dependencies - apt: - name: '{{ item }}' - state: 'present' - install_recommends: False - with_items: - - 'python-dev' - - 'python-virtualenv' - - 'python-pip' - - 'libpcap-dev' - - 'cpufrequtils' - - 'cgroup-bin' - - 'zlib1g-dev' - - 'apt-transport-https' - - 'ca-certificates' - - 'software-properties-common' - - 'cron' - - 'libnuma-dev' - tags: install-csit-dependencies - -- name: Add an Apt signing key, for docker-ce repository - apt_key: - url: https://download.docker.com/linux/ubuntu/gpg - state: 'present' - tags: install-docker - -- name: Install Docker APT repository - apt_repository: - repo: '{{ docker_repository }}' - state: 'present' - update_cache: True - tags: install-docker - -- name: Install Docker - apt: - name: 'docker-{{ docker_edition }}={{ docker_apt_package_name }}' - state: 'present' - tags: install-docker - -- name: Creates Docker service directory - file: - path: '/etc/systemd/system/docker.service.d' - state: 'directory' - -- name: Setup Docker http proxy - template: - src: 'templates/docker.service.proxy.http' - dest: '/etc/systemd/system/docker.service.d/http-proxy.conf' - owner: 'root' - group: 'root' - mode: '0644' - register: docker_register_systemd_service - when: proxy_env is defined and proxy_env.http_proxy is defined - tags: copy-docker - -- name: Setup Docker https proxy - template: - src: 'templates/docker.service.proxy.https' - dest: '/etc/systemd/system/docker.service.d/https-proxy.conf' - owner: 'root' - group: 'root' - mode: '0644' - register: docker_register_systemd_service - when: proxy_env is defined and proxy_env.https_proxy is defined - tags: copy-docker - -- name: Reload systemd daemon - command: 'systemctl daemon-reload' - notify: ['Restart Docker'] - when: (docker_register_systemd_service and - docker_register_systemd_service is changed) - tags: restart-docker - -- name: Set specific users to docker group - user: - name: '{{ item }}' - groups: 'docker' - append: True - with_items: '{{ docker_users }}' - when: docker_users - tags: set-docker - -- name: Add an Apt signing key, for Kubernetes repository - apt_key: - url: https://packages.cloud.google.com/apt/doc/apt-key.gpg - state: 'present' - tags: install-kubernetes - -- name: Install kubernetes APT repository - apt_repository: - repo: '{{ kubernetes_repository }}' - state: 'present' - update_cache: True - tags: install-kubernetes - -- name: Install Kubernetes - apt: - name: '{{ item }}={{ kubernetes_apt_package_name }}' - state: 'present' - force: yes - with_items: - - 'kubeadm' - - 'kubectl' - - 'kubelet' - tags: install-kubernetes - -- name: Apply kubelet parameter - lineinfile: - path: '/etc/default/kubelet' - state: 'present' - regexp: '^KUBELET_EXTRA_ARGS=*' - line: 'KUBELET_EXTRA_ARGS=--feature-gates HugePages=false' - tags: install-kubernetes diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml new file mode 100644 index 0000000000..194609722e --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml @@ -0,0 +1,117 @@ +--- +# file: roles/tg_sut/tasks/ubuntu_bionic.yaml + +- name: Install CSIT dependencies + apt: + name: '{{ item }}' + state: 'present' + install_recommends: False + with_items: + - 'python-dev' + - 'python-virtualenv' + - 'python-pip' + - 'libpcap-dev' + - 'cpufrequtils' + - 'cgroup-bin' + - 'zlib1g-dev' + - 'apt-transport-https' + - 'ca-certificates' + - 'software-properties-common' + - 'cron' + - 'libnuma-dev' + tags: install-csit-dependencies + +- name: Add an Apt signing key, for docker-ce repository + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: 'present' + tags: install-docker + +- name: Install Docker APT repository + apt_repository: + repo: '{{ docker_repository }}' + state: 'present' + update_cache: True + tags: install-docker + +- name: Install Docker + apt: + name: 'docker-{{ docker_edition }}={{ docker_apt_package_name }}' + state: 'present' + force: yes + tags: install-docker + +- name: Creates Docker service directory + file: + path: '/etc/systemd/system/docker.service.d' + state: 'directory' + +- name: Setup Docker http proxy + template: + src: 'templates/docker.service.proxy.http' + dest: '/etc/systemd/system/docker.service.d/http-proxy.conf' + owner: 'root' + group: 'root' + mode: '0644' + register: docker_register_systemd_service + when: proxy_env is defined and proxy_env.http_proxy is defined + tags: copy-docker + +- name: Setup Docker https proxy + template: + src: 'templates/docker.service.proxy.https' + dest: '/etc/systemd/system/docker.service.d/https-proxy.conf' + owner: 'root' + group: 'root' + mode: '0644' + register: docker_register_systemd_service + when: proxy_env is defined and proxy_env.https_proxy is defined + tags: copy-docker + +- name: Reload systemd daemon + command: 'systemctl daemon-reload' + notify: ['Restart Docker'] + when: (docker_register_systemd_service and + docker_register_systemd_service is changed) + tags: restart-docker + +- name: Set specific users to docker group + user: + name: '{{ item }}' + groups: 'docker' + append: True + with_items: '{{ docker_users }}' + when: docker_users + tags: set-docker + +- name: Add an Apt signing key, for Kubernetes repository + apt_key: + url: https://packages.cloud.google.com/apt/doc/apt-key.gpg + state: 'present' + tags: install-kubernetes + +- name: Install kubernetes APT repository + apt_repository: + repo: '{{ kubernetes_repository }}' + state: 'present' + update_cache: True + tags: install-kubernetes + +- name: Install Kubernetes + apt: + name: '{{ item }}={{ kubernetes_apt_package_name }}' + state: 'present' + force: yes + with_items: + - 'kubeadm' + - 'kubectl' + - 'kubelet' + tags: install-kubernetes + +- name: Apply kubelet parameter + lineinfile: + path: '/etc/default/kubelet' + state: 'present' + regexp: '^KUBELET_EXTRA_ARGS=*' + line: 'KUBELET_EXTRA_ARGS=--feature-gates HugePages=false' + tags: install-kubernetes -- cgit 1.2.3-korg