xci: Reduce noise during bootstrapping 91/48791/1
authorMarkos Chandras <mchandras@suse.de>
Wed, 13 Dec 2017 09:29:45 +0000 (09:29 +0000)
committerMarkos Chandras <mchandras@suse.de>
Wed, 13 Dec 2017 09:32:20 +0000 (09:32 +0000)
There is too much noise when XCI is cloning repositories, installing
packages etc so lets make the console output somewhat more readable.

Change-Id: I15667e0349f943ad5488daf0e3cea9336c9166d1
Signed-off-by: Markos Chandras <mchandras@suse.de>
bifrost/scripts/bifrost-provision.sh
xci/file/install-ansible.sh
xci/playbooks/get-opnfv-scenario-requirements.yml

index 0a2987d..d705f31 100755 (executable)
@@ -7,7 +7,7 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-set -eux
+set -eu
 set -o pipefail
 
 export PYTHONUNBUFFERED=1
@@ -71,7 +71,7 @@ export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"}
 
 if [ ${USE_VENV} = "true" ]; then
     export VENV=/opt/stack/bifrost
-    $SCRIPT_HOME/env-setup.sh
+    $SCRIPT_HOME/env-setup.sh &>/dev/null
     # Note(cinerama): activate is not compatible with "set -u";
     # disable it just for this line.
     set +u
@@ -80,29 +80,13 @@ if [ ${USE_VENV} = "true" ]; then
     ANSIBLE=${VENV}/bin/ansible-playbook
     ENABLE_VENV="true"
 else
-    $SCRIPT_HOME/env-setup.sh
+    $SCRIPT_HOME/env-setup.sh &>/dev/null
     ANSIBLE=${HOME}/.local/bin/ansible-playbook
 fi
 
-logs_on_exit() {
-    $SCRIPT_HOME/collect-test-info.sh
-}
-trap logs_on_exit EXIT
-
 # Change working directory
 cd $BIFROST_HOME/playbooks
 
-# Syntax check of dynamic inventory test path
-for task in syntax-check list-tasks; do
-    ${ANSIBLE} ${XCI_ANSIBLE_VERBOSITY} -i inventory/localhost \
-           test-bifrost-create-vm.yaml \
-           --${task}
-    ${ANSIBLE} ${XCI_ANSIBLE_VERBOSITY} -i inventory/localhost \
-           ${TEST_PLAYBOOK} \
-           --${task} \
-           -e testing_user=${TESTING_USER}
-done
-
 # NOTE(hwoarang): Disable selinux as we are hitting issues with it from time to
 # time. Remove this when Centos7 is a proper gate on bifrost so we know that
 # selinux works as expected.
index 75ae1d8..979d990 100644 (file)
@@ -27,7 +27,7 @@ source /etc/os-release || source /usr/lib/os-release
 case ${ID,,} in
     *suse)
     OS_FAMILY="Suse"
-    INSTALLER_CMD="sudo -H -E zypper install -y --no-recommends"
+    INSTALLER_CMD="sudo -H -E zypper -q install -y --no-recommends"
     CHECK_CMD="zypper search --match-exact --installed"
     PKG_MAP=(
         [gcc]=gcc
@@ -42,7 +42,7 @@ case ${ID,,} in
         [wget]=wget
     )
     EXTRA_PKG_DEPS=( python-xml )
-       sudo zypper -n ref
+    sudo zypper -n ref
     # NOTE (cinerama): we can't install python without removing this package
     # if it exists
     if $(${CHECK_CMD} patterns-openSUSE-minimal_base-conflicts &> /dev/null); then
@@ -53,7 +53,7 @@ case ${ID,,} in
     ubuntu|debian)
     OS_FAMILY="Debian"
     export DEBIAN_FRONTEND=noninteractive
-    INSTALLER_CMD="sudo -H -E apt-get -y install"
+    INSTALLER_CMD="sudo -H -E apt-get -y -q=3 install"
     CHECK_CMD="dpkg -l"
     PKG_MAP=(
         [gcc]=gcc
@@ -68,13 +68,13 @@ case ${ID,,} in
         [wget]=wget
     )
     EXTRA_PKG_DEPS=()
-       sudo apt-get update
+    sudo apt-get update
     ;;
 
     rhel|fedora|centos)
     OS_FAMILY="RedHat"
     PKG_MANAGER=$(which dnf || which yum)
-    INSTALLER_CMD="sudo -H -E ${PKG_MANAGER} -y install"
+    INSTALLER_CMD="sudo -H -E ${PKG_MANAGER} -q -y install"
     CHECK_CMD="rpm -q"
     PKG_MAP=(
         [gcc]=gcc
@@ -90,7 +90,6 @@ case ${ID,,} in
     )
     sudo yum updateinfo
     EXTRA_PKG_DEPS=()
-    sudo yum update --assumeno
     ;;
 
     *) echo "ERROR: Supported package manager not found.  Supported: apt, dnf, yum, zypper"; exit 1;;
@@ -155,8 +154,8 @@ fi
 
 PIP=$(which pip)
 echo "Using pip: $(${PIP} --version)"
-sudo -H -E ${PIP} install --upgrade virtualenv
-sudo -H -E ${PIP} install --upgrade pip
+sudo -H -E ${PIP} -q install --upgrade virtualenv
+sudo -H -E ${PIP} -q install --upgrade pip
 # upgrade setuptools, as latest version is needed to install some projects
-sudo -H -E ${PIP} install --upgrade setuptools
-${PIP} install --user --upgrade ansible==$XCI_ANSIBLE_PIP_VERSION
+sudo -H -E ${PIP} -q install --upgrade setuptools
+${PIP} install -q --user --upgrade ansible==$XCI_ANSIBLE_PIP_VERSION
index fbe60f6..11aee8e 100644 (file)
       with_nested:
         - "{{ scenarios }}"
         - [ "{{ scenario_path_default }}", "{{ role_path_default }}" ]
+      loop_control:
+        label: "{{ item[0].scenario }}"
 
     - name: Create scenario directories
       file:
         path: "{{ role_path_default }} + '/' + item.scenario }}"
         state: directory
       with_items: "{{ scenarios }}"
+      loop_control:
+        label: "{{ item.scenario }}"
 
     - name: Clone git repos (with git)
       git:
       until: git_clone | success
       retries: "{{ git_clone_retries }}"
       delay: "{{ git_clone_retry_delay }}"
+      loop_control:
+        label: "{{ item.scenario }}"
 
     - name: Check that scenarios exist
       stat:
         path: "{{ scenario_path_default }}/{{ item.scenario }}/{{ item.role }}"
       register: scenarios_list_exists
       with_items: "{{ scenarios }}"
+      loop_control:
+        label: "{{ item.scenario }}"
 
     - name: Plug in the scenario to XCI
       shell: >-
@@ -63,6 +71,8 @@
           {{ role_path_default }}/{{ item.item.scenario }}
       when: item.stat.exists
       with_items: "{{ scenarios_list_exists.results }}"
+      loop_control:
+        label: "{{ item.item.scenario }}"
 
     - name: Plug in the scenario to XCI (fallback)
       shell: >-
@@ -70,6 +80,8 @@
           {{ role_path_default }}/{{ item.item.scenario }}
       when: not item.stat.exists
       with_items: "{{ scenarios_list_exists.results }}"
+      loop_control:
+        label: "{{ item.item.scenario }}"
 
   vars:
     ansible_python_interpreter: "/usr/bin/python"