From 4bb71fc481eb66463084cf07bdd781c98b67100b Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 30 Oct 2019 11:29:26 +0100 Subject: [PATCH] Migrate to Zuul v3 native jobs This corrects the path handling in the CI and removes a lot of redundancy in the CI definitions. Also adds fixed log collection from https://review.opendev.org/#/c/649526/ to make the CI pass. Removes handling of ZUUL_CHANGES. It is not present in new jobs, and its use case in Bifrost is completely unclear. Eventually, we should rewrite the whole test-bifrost.sh in ansible, but that's a much bigger task. Change-Id: Id893e816a7806e7d75282628817288d8a34ab8af --- .../bifrost-integration-dhcp => ci}/post.yaml | 5 +- playbooks/ci/pre.yaml | 5 ++ playbooks/ci/run.yaml | 14 ++++ .../legacy/bifrost-integration-dhcp/run.yaml | 74 ----------------- .../post.yaml | 15 ---- .../run.yaml | 74 ----------------- .../bifrost-integration-tinyipa/post.yaml | 15 ---- .../bifrost-integration-tinyipa/run.yaml | 83 ------------------- .../roles/bifrost-openstack-ci-prep/README.md | 8 -- .../files/parse_zuul_changes.py | 64 -------------- .../bifrost-openstack-ci-prep/tasks/main.yml | 2 +- playbooks/test-bifrost-create-vm.yaml | 7 +- playbooks/test-bifrost.yaml | 15 +--- scripts/collect-test-info.sh | 14 ++-- scripts/test-bifrost-build-images.sh | 1 - scripts/test-bifrost-inventory-dhcp.sh | 1 - scripts/test-bifrost-keystone-auth.sh | 1 - scripts/test-bifrost-venv.sh | 1 - scripts/test-bifrost.sh | 23 ++--- ...cy-bifrost-jobs.yaml => bifrost-jobs.yaml} | 23 ++--- 20 files changed, 54 insertions(+), 391 deletions(-) rename playbooks/{legacy/bifrost-integration-dhcp => ci}/post.yaml (70%) create mode 100644 playbooks/ci/pre.yaml create mode 100644 playbooks/ci/run.yaml delete mode 100644 playbooks/legacy/bifrost-integration-dhcp/run.yaml delete mode 100644 playbooks/legacy/bifrost-integration-dibipa-debian/post.yaml delete mode 100644 playbooks/legacy/bifrost-integration-dibipa-debian/run.yaml delete mode 100644 playbooks/legacy/bifrost-integration-tinyipa/post.yaml delete mode 100644 playbooks/legacy/bifrost-integration-tinyipa/run.yaml delete mode 100755 playbooks/roles/bifrost-openstack-ci-prep/files/parse_zuul_changes.py delete mode 120000 scripts/test-bifrost-build-images.sh delete mode 120000 scripts/test-bifrost-inventory-dhcp.sh delete mode 120000 scripts/test-bifrost-keystone-auth.sh delete mode 120000 scripts/test-bifrost-venv.sh rename zuul.d/{legacy-bifrost-jobs.yaml => bifrost-jobs.yaml} (80%) diff --git a/playbooks/legacy/bifrost-integration-dhcp/post.yaml b/playbooks/ci/post.yaml similarity index 70% rename from playbooks/legacy/bifrost-integration-dhcp/post.yaml rename to playbooks/ci/post.yaml index 502ff570c..0c6838090 100644 --- a/playbooks/legacy/bifrost-integration-dhcp/post.yaml +++ b/playbooks/ci/post.yaml @@ -1,9 +1,8 @@ - hosts: all tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + - name: Copy files from {{ ansible_user_dir }}/ on node synchronize: - src: '{{ ansible_user_dir }}/workspace/' + src: '{{ ansible_user_dir }}/' dest: '{{ zuul.executor.log_root }}' mode: pull copy_links: true diff --git a/playbooks/ci/pre.yaml b/playbooks/ci/pre.yaml new file mode 100644 index 000000000..32e1e1cfc --- /dev/null +++ b/playbooks/ci/pre.yaml @@ -0,0 +1,5 @@ +- hosts: all + roles: + - role: bindep + bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" + diff --git a/playbooks/ci/run.yaml b/playbooks/ci/run.yaml new file mode 100644 index 000000000..6b13755bf --- /dev/null +++ b/playbooks/ci/run.yaml @@ -0,0 +1,14 @@ +- hosts: all + tasks: + - shell: + cmd: scripts/test-bifrost.sh + chdir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" + environment: + BUILD_IMAGE: "{{ build_image | default(false) | bool | lower }}" + ENABLE_KEYSTONE: "{{ enable_keystone | default(false) | bool | lower }}" + LOG_LOCATION: "{{ ansible_user_dir }}/logs" + UPPER_CONSTRAINTS_FILE: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/upper-constraints.txt" + WORKSPACE: "{{ ansible_user_dir }}/src/opendev.org" + USE_DHCP: "{{ use_dhcp | default(false) | bool | lower }}" + USE_VENV: "{{ use_venv | default(false) | bool | lower }}" + ZUUL_BRANCH: "{{ zuul.branch }}" diff --git a/playbooks/legacy/bifrost-integration-dhcp/run.yaml b/playbooks/legacy/bifrost-integration-dhcp/run.yaml deleted file mode 100644 index b9232ce55..000000000 --- a/playbooks/legacy/bifrost-integration-dhcp/run.yaml +++ /dev/null @@ -1,74 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-bifrost-integration-dhcp from old job gate-bifrost-integration-dhcp-ubuntu-xenial-nv - roles: - - role: bindep - bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" - - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - REQS_DIR=`mktemp -d` - function cleanup { - mkdir -p $WORKSPACE - rm -rf $CLONEMAP $REQS_DIR - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - EOF - # zuul cloner works poorly if there are 2 names that are the - # same in here. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cat >> $CLONEMAP << EOF - - name: openstack/requirements - dest: $REQS_DIR - EOF - fi - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - https://opendev.org $ZUUL_PROJECT openstack/requirements - # REQS_DIR is not set for openstack/requirements and there is also - # no need to copy in this case. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cp $REQS_DIR/upper-constraints.txt ./ - fi - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -u - set -e - set -x - cd $WORKSPACE - - /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ - https://opendev.org \ - openstack/bifrost \ - openstack/diskimage-builder \ - openstack/ironic \ - openstack/python-ironicclient \ - openstack/shade \ - openstack/openstacksdk \ - openstack/ironic-inspector \ - openstack/python-ironic-inspector-client \ - openstack/requirements - export GIT_BASE=$(pwd) - export UPPER_CONSTRAINTS_FILE=$WORKSPACE/upper-constraints.txt - export USE_VENV={{ use_venv | default(false) | bool | lower }} - cd openstack/bifrost - scripts/test-bifrost-inventory-dhcp.sh - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/legacy/bifrost-integration-dibipa-debian/post.yaml b/playbooks/legacy/bifrost-integration-dibipa-debian/post.yaml deleted file mode 100644 index 502ff570c..000000000 --- a/playbooks/legacy/bifrost-integration-dibipa-debian/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- hosts: all - tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/logs/** - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/legacy/bifrost-integration-dibipa-debian/run.yaml b/playbooks/legacy/bifrost-integration-dibipa-debian/run.yaml deleted file mode 100644 index 26076d50d..000000000 --- a/playbooks/legacy/bifrost-integration-dibipa-debian/run.yaml +++ /dev/null @@ -1,74 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-bifrost-integration-dibipa-debian from old job gate-bifrost-integration-dibipa-debian-ubuntu-xenial-nv - roles: - - role: bindep - bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" - - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - REQS_DIR=`mktemp -d` - function cleanup { - mkdir -p $WORKSPACE - rm -rf $CLONEMAP $REQS_DIR - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - EOF - # zuul cloner works poorly if there are 2 names that are the - # same in here. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cat >> $CLONEMAP << EOF - - name: openstack/requirements - dest: $REQS_DIR - EOF - fi - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - https://opendev.org $ZUUL_PROJECT openstack/requirements - # REQS_DIR is not set for openstack/requirements and there is also - # no need to copy in this case. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cp $REQS_DIR/upper-constraints.txt ./ - fi - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -u - set -e - set -x - cd $WORKSPACE - - /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ - https://opendev.org \ - openstack/bifrost \ - openstack/diskimage-builder \ - openstack/ironic \ - openstack/python-ironicclient \ - openstack/shade \ - openstack/openstacksdk \ - openstack/ironic-inspector \ - openstack/python-ironic-inspector-client \ - openstack/requirements - export GIT_BASE=$(pwd) - export UPPER_CONSTRAINTS_FILE=$WORKSPACE/upper-constraints.txt - export USE_VENV={{ use_venv | default(false) | bool | lower }} - cd openstack/bifrost - scripts/test-bifrost-build-images.sh - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/legacy/bifrost-integration-tinyipa/post.yaml b/playbooks/legacy/bifrost-integration-tinyipa/post.yaml deleted file mode 100644 index 502ff570c..000000000 --- a/playbooks/legacy/bifrost-integration-tinyipa/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- hosts: all - tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/logs/** - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/legacy/bifrost-integration-tinyipa/run.yaml b/playbooks/legacy/bifrost-integration-tinyipa/run.yaml deleted file mode 100644 index ed79f114d..000000000 --- a/playbooks/legacy/bifrost-integration-tinyipa/run.yaml +++ /dev/null @@ -1,83 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-bifrost-integration-tinyipa from old job gate-bifrost-integration-tinyipa-ubuntu-xenial - roles: - - role: bindep - bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" - - tasks: - - - name: Set script name for testing without Keystone - set_fact: - script_name: scripts/test-bifrost.sh - when: not (use_keystone | default(false) | bool) - - - name: Set script name for testing with Keystone - set_fact: - script_name: scripts/test-bifrost-keystone-auth.sh - when: use_keystone | default(false) | bool - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - REQS_DIR=`mktemp -d` - function cleanup { - mkdir -p $WORKSPACE - rm -rf $CLONEMAP $REQS_DIR - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: openstack/bifrost - dest: . - EOF - # zuul cloner works poorly if there are 2 names that are the - # same in here. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cat >> $CLONEMAP << EOF - - name: openstack/requirements - dest: $REQS_DIR - EOF - fi - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - https://opendev.org openstack/bifrost openstack/requirements - # REQS_DIR is not set for openstack/requirements and there is also - # no need to copy in this case. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cp $REQS_DIR/upper-constraints.txt ./ - fi - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -u - set -e - set -x - cd $WORKSPACE - - /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ - https://opendev.org \ - openstack/bifrost \ - openstack/ironic \ - openstack/python-ironicclient \ - openstack/shade \ - openstack/openstacksdk \ - openstack/ironic-inspector \ - openstack/python-ironic-inspector-client \ - openstack/requirements - export GIT_BASE=$(pwd) - export UPPER_CONSTRAINTS_FILE=$WORKSPACE/upper-constraints.txt - export USE_VENV={{ use_venv | default(false) | bool | lower }} - cd openstack/bifrost - "{{ script_name }}" - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/roles/bifrost-openstack-ci-prep/README.md b/playbooks/roles/bifrost-openstack-ci-prep/README.md index 5f6647d16..31fe8c91c 100644 --- a/playbooks/roles/bifrost-openstack-ci-prep/README.md +++ b/playbooks/roles/bifrost-openstack-ci-prep/README.md @@ -26,10 +26,6 @@ ironicclient_git_folder: The folder where the python-ironicclient code base shade_git_folder: The folder where the shade code base has been cloned to. -ansible_env.ZUUL_CHANGES: The list of changes from Zuul that need to be - applied to the cloned repositories before testing - can proceed. - Dependencies ------------ @@ -59,10 +55,6 @@ of the logic to properly handle an OpenStack CI environment node. ironicclient_git_url: /opt/git/openstack/python-ironicclient shade_git_url: /opt/git/openstack/shade when: lookup('env', 'ZUUL_BRANCH') != "" - - name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set" - set_fact: - ci_testing_zuul_changes: true - when: lookup('env', 'ZUUL_CHANGES') != "" roles: - { role: bifrost-prep-for-install, when: skip_install is not defined } - { role: bifrost-openstack-ci-prep, when: ci_testing_zuul is defined } diff --git a/playbooks/roles/bifrost-openstack-ci-prep/files/parse_zuul_changes.py b/playbooks/roles/bifrost-openstack-ci-prep/files/parse_zuul_changes.py deleted file mode 100755 index d73d03cee..000000000 --- a/playbooks/roles/bifrost-openstack-ci-prep/files/parse_zuul_changes.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# 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. - -# Note(TheJulia): This script is no longer required by bifrost, however -# it may prove useful to those performing complex feature development -# within bifrost where they do not want to wait to rely upon CI jobs. -# DEPRICATED: Remove after Mitaka cycle - -import re -import subprocess -import sys - -if len(sys.argv) is 1: - print("ERROR: This script requires arguments!\n" - "%s repository_path review_url repository_name " - "zuul_changes" % sys.argv[0]) - sys.exit(1) - -repo_path = sys.argv[1] -review_url = sys.argv[2] -repo_name = sys.argv[3] -change_list = str(sys.argv[4]).split('^') -applicable_changes = [x for x in change_list if repo_name in x] - -try: - for change in applicable_changes: - (project, branch, ref) = change.split(':') - if re.search(repo_name, project): - if not re.search(branch, subprocess.check_output( - ['git', '-C', repo_path, 'status', '-s', '-b'])): - command = ['git', '-C', repo_path, 'checkout', branch] - subprocess.call(command, stdout=True) - - command = ['git', '-C', repo_path, 'fetch', - review_url + "/" + repo_name, ref] - if subprocess.call(command, stdout=True) is 0: - if subprocess.call( - ['git', '-C', repo_path, 'cherry-pick', - '-n', 'FETCH_HEAD'], stdout=True) is 0: - print("Applied %s" % ref) - else: - print("Failed to cherry pick %s onto %s branch %s" - % (ref, repo_name, branch)) - sys.exit(1) - else: - print("Failed to download %s on to %s branch %s" - % (ref, repo_name, branch)) - sys.exit(1) - -except Exception as e: - print("Failed to process change: %s" % e) diff --git a/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml b/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml index ca7fd5ef9..7df5b805c 100644 --- a/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml +++ b/playbooks/roles/bifrost-openstack-ci-prep/tasks/main.yml @@ -20,7 +20,7 @@ mysql_username: "openstack_citest" mysql_password: "openstack_citest" disable_dnsmasq_dns: True - when: ci_testing_zuul_changes is defined + when: ci_testing_zuul is defined - name: "Determine if OpenStack CI is missing an SSH key" stat: path={{ssh_public_key_path}} diff --git a/playbooks/test-bifrost-create-vm.yaml b/playbooks/test-bifrost-create-vm.yaml index c2f723910..760dda641 100644 --- a/playbooks/test-bifrost-create-vm.yaml +++ b/playbooks/test-bifrost-create-vm.yaml @@ -21,14 +21,11 @@ set_fact: baremetal_json_file: "/tmp/baremetal.json" when: baremetal_json_file is not defined - - name: "Set ci_testing flag if a list of changes are found in the environment variables" + - name: "Set ci_testing flag if running in the CI" set_fact: ci_testing: true - when: lookup('env', 'ZUUL_CHANGES') | length > 0 - - name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI" - set_fact: ci_testing_zuul: true - when: "'bare-trusty' in ansible_hostname" + when: lookup('env', 'ZUUL_BRANCH') | length > 0 - name: "Collect process list if running in OpenStack CI" command: ps aux when: ci_testing_zuul is defined diff --git a/playbooks/test-bifrost.yaml b/playbooks/test-bifrost.yaml index ab8b4704e..573985125 100644 --- a/playbooks/test-bifrost.yaml +++ b/playbooks/test-bifrost.yaml @@ -33,21 +33,14 @@ ironicclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironicclient" openstacksdk_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/openstacksdk" shade_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/shade" - dib_git_url: "/opt/git/openstack/diskimage-builder" + dib_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/diskimage-builder" ironicinspector_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic-inspector" ironicinspectorclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironic-inspector-client" - keystone_git_url: "/opt/git/openstack/keystone" - sushy_git_url: "/opt/git/openstack/sushy" + keystone_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/keystone" + sushy_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/sushy" reqs_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/requirements" - staging_drivers_git_url: "/opt/git/x/ironic-staging-drivers" - # TODO(TheJulia) Fix the above paths to be consistent, because the NV job gets the dib - # folder cloned, while the gate job does not. Likely need to work out a semi-hybrid - # solution. + staging_drivers_git_url: "{{ lookup('env', 'WORKSPACE') }}/x/ironic-staging-drivers" when: lookup('env', 'ZUUL_BRANCH') | length > 0 - - name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set" - set_fact: - ci_testing_zuul_changes: true - when: lookup('env', 'ZUUL_CHANGES') | length > 0 - name: "Override the ipv4_gateway setting" set_fact: ipv4_gateway: "192.168.122.1" diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index 3dbdf4280..38391f8f2 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -8,7 +8,7 @@ set -o pipefail # Note(TheJulia): If there is a workspace variable, we want to utilize that as # the preference of where to put logs SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" -LOG_LOCATION="${WORKSPACE:-${SCRIPT_HOME}/..}/logs" +LOG_LOCATION="${LOG_LOCATION:-${SCRIPT_HOME}/../logs}" VERBOSE_LOGS="${VERBOSE_LOGS:-False}" @@ -42,13 +42,17 @@ fi if $(ip link &>/dev/null); then ip -s link &> ${LOG_LOCATION}/interface_counters.log fi + +mkdir -p ${LOG_LOCATION}/all +sudo cp -a /var/log/* ${LOG_LOCATION}/all/. +sudo chown -R $USER ${LOG_LOCATION}/all + if $(journalctl --version &>/dev/null); then - cp -a /var/log/* ${LOG_LOCATION}/. sudo journalctl -u libvirtd &> ${LOG_LOCATION}/libvirtd.log sudo journalctl -u ironic-api &> ${LOG_LOCATION}/ironic-api.log sudo journalctl -u ironic-conductor &> ${LOG_LOCATION}/ironic-conductor.log sudo journalctl -u ironic-inspector &> ${LOG_LOCATION}/ironic-inspector.log - sudo journalctl -u libvirtd &> ${LOG_LOCATION}/libvirtd.log + sudo journalctl -u dnsmasq &> ${LOG_LOCATION}/dnsmasq.log else sudo cp /var/log/upstart/ironic-api.log ${LOG_LOCATION}/ sudo cp /var/log/upstart/ironic-conductor.log ${LOG_LOCATION}/ @@ -62,14 +66,14 @@ cp /httpboot/ipxe.* ${LOG_LOCATION}/pxe/ cp -aL /httpboot/pxelinux.cfg/ ${LOG_LOCATION}/pxe/ # Copy baremetal information -source $HOME/openrc +source $HOME/openrc bifrost for vm in $(openstack baremetal node list -c Name -f value); do openstack baremetal node show $vm >> ${LOG_LOCATION}/baremetal.txt done if [ -d "/var/log/ironic" ]; then sudo cp -a "/var/log/ironic" ${LOG_LOCATION}/ipa-logs - ls -la ${LOG_LOCATION}/ipa-logs + ls -la ${LOG_LOCATION}/ipa-logs fi sudo vbmc list &> ${LOG_LOCATION}/vbmc.txt diff --git a/scripts/test-bifrost-build-images.sh b/scripts/test-bifrost-build-images.sh deleted file mode 120000 index 753b5dee0..000000000 --- a/scripts/test-bifrost-build-images.sh +++ /dev/null @@ -1 +0,0 @@ -test-bifrost.sh \ No newline at end of file diff --git a/scripts/test-bifrost-inventory-dhcp.sh b/scripts/test-bifrost-inventory-dhcp.sh deleted file mode 120000 index 753b5dee0..000000000 --- a/scripts/test-bifrost-inventory-dhcp.sh +++ /dev/null @@ -1 +0,0 @@ -test-bifrost.sh \ No newline at end of file diff --git a/scripts/test-bifrost-keystone-auth.sh b/scripts/test-bifrost-keystone-auth.sh deleted file mode 120000 index 753b5dee0..000000000 --- a/scripts/test-bifrost-keystone-auth.sh +++ /dev/null @@ -1 +0,0 @@ -test-bifrost.sh \ No newline at end of file diff --git a/scripts/test-bifrost-venv.sh b/scripts/test-bifrost-venv.sh deleted file mode 120000 index 753b5dee0..000000000 --- a/scripts/test-bifrost-venv.sh +++ /dev/null @@ -1 +0,0 @@ -test-bifrost.sh \ No newline at end of file diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index f3d174c6d..be33d4025 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -6,11 +6,12 @@ export PYTHONUNBUFFERED=1 SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" BIFROST_HOME=$SCRIPT_HOME/.. ANSIBLE_INSTALL_ROOT=${ANSIBLE_INSTALL_ROOT:-/opt/stack} -ENABLE_VENV="false" -USE_DHCP="false" +USE_DHCP="${USE_DHCP:-false}" USE_VENV="${USE_VENV:-false}" -BUILD_IMAGE="false" +BUILD_IMAGE="${BUILD_IMAGE:-false}" BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} +ENABLE_KEYSTONE="${ENABLE_KEYSTONE:-false}" +ZUUL_BRANCH=${ZUUL_BRANCH:-} # Set defaults for ansible command-line options to drive the different # tests. @@ -39,10 +40,9 @@ CREATE_IPA_IMAGE=false WRITE_INTERFACES_FILE=true PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-900} NOAUTH_MODE=true -ENABLE_KEYSTONE=false CLOUD_CONFIG="" WAIT_FOR_DEPLOY=true -ZUUL_BRANCH=${ZUUL_BRANCH:-} +ENABLE_VENV=false # This sets up the MySQL database like it's done for all OpenStack # projects for CI testing. @@ -82,19 +82,6 @@ if [ "$ZUUL_BRANCH" != "" ] ; then mysql_setup fi -# NOTE(cinerama): We could remove this if we change the CI job to use -# USE_DHCP, BUILD_IMAGE, etc. -SOURCE=$(basename ${BASH_SOURCE[0]}) -if [ $SOURCE = "test-bifrost-inventory-dhcp.sh" ]; then - USE_DHCP="true" -elif [ $SOURCE = "test-bifrost-venv.sh" ]; then - USE_VENV="true" -elif [ $SOURCE = "test-bifrost-build-images.sh" ]; then - BUILD_IMAGE="true" -elif [ $SOURCE = "test-bifrost-keystone-auth.sh" ]; then - ENABLE_KEYSTONE="true" -fi - if [ ${USE_VENV} = "true" ]; then export VENV=/opt/stack/bifrost $SCRIPT_HOME/env-setup.sh diff --git a/zuul.d/legacy-bifrost-jobs.yaml b/zuul.d/bifrost-jobs.yaml similarity index 80% rename from zuul.d/legacy-bifrost-jobs.yaml rename to zuul.d/bifrost-jobs.yaml index 8995b88b2..9c8bf36d3 100644 --- a/zuul.d/legacy-bifrost-jobs.yaml +++ b/zuul.d/bifrost-jobs.yaml @@ -1,6 +1,6 @@ - job: name: bifrost-base - parent: legacy-base + parent: base irrelevant-files: - ^.*\.rst$ - ^bifrost/tests/.*$ @@ -10,30 +10,33 @@ - ^test-requirements.txt$ - ^tools/.*$ - ^tox.ini$ + pre-run: playbooks/ci/pre.yaml + run: playbooks/ci/run.yaml + post-run: playbooks/ci/post.yaml required-projects: - openstack/bifrost + - openstack/diskimage-builder - openstack/ironic - openstack/ironic-inspector + - openstack/keystone - openstack/openstacksdk - openstack/python-ironic-inspector-client - openstack/python-ironicclient - openstack/requirements - openstack/shade - openstack/sushy + - x/ironic-staging-drivers - job: name: bifrost-integration parent: bifrost-base - required-projects: - # this is in addition to bifrost-base's required-projects - - openstack/diskimage-builder - job: name: bifrost-integration-dhcp parent: bifrost-integration - run: playbooks/legacy/bifrost-integration-dhcp/run.yaml - post-run: playbooks/legacy/bifrost-integration-dhcp/post.yaml timeout: 7200 + vars: + use_dhcp: true - job: name: bifrost-integration-dhcp-ubuntu-xenial @@ -55,9 +58,9 @@ - job: name: bifrost-integration-dibipa-debian parent: bifrost-integration - run: playbooks/legacy/bifrost-integration-dibipa-debian/run.yaml - post-run: playbooks/legacy/bifrost-integration-dibipa-debian/post.yaml timeout: 7200 + vars: + build_image: true - job: name: bifrost-integration-dibipa-debian-ubuntu-xenial @@ -79,8 +82,6 @@ - job: name: bifrost-integration-tinyipa parent: bifrost-base - run: playbooks/legacy/bifrost-integration-tinyipa/run.yaml - post-run: playbooks/legacy/bifrost-integration-tinyipa/post.yaml timeout: 3600 - job: @@ -93,7 +94,7 @@ parent: bifrost-integration-tinyipa nodeset: ubuntu-xenial vars: - use_keystone: true + enable_keystone: true - job: name: bifrost-integration-tinyipa-centos-7