From e73786af9079d17f1893d593c1d0e6d88771a87a Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 28 Aug 2019 17:29:31 +0200 Subject: [PATCH] Switch to image building jobs from ironic-python-agent-builder Depends-On: https://review.opendev.org/678884 Change-Id: I50a9f9dc15f3a782aaf4b8c4096a418136f4ebd4 --- imagebuild/README.rst | 5 +- .../ironic-python-agent-buildimage/post.yaml | 43 ------------- .../pre-dib.yaml | 19 ------ .../ironic-python-agent-buildimage/run.yaml | 60 ------------------- zuul.d/ironic-python-agent-jobs.yaml | 31 ---------- zuul.d/project.yaml | 10 +++- 6 files changed, 10 insertions(+), 158 deletions(-) delete mode 100644 playbooks/ironic-python-agent-buildimage/post.yaml delete mode 100644 playbooks/ironic-python-agent-buildimage/pre-dib.yaml delete mode 100644 playbooks/ironic-python-agent-buildimage/run.yaml diff --git a/imagebuild/README.rst b/imagebuild/README.rst index be1c88f37..39b54bca8 100644 --- a/imagebuild/README.rst +++ b/imagebuild/README.rst @@ -1,6 +1,5 @@ ironic-python-agent images ========================== -coreos - Builds a CoreOS Ramdisk and Kernel suitable for running -ironic-python-agent - +The content has been moved to `ironic-python-agent-builder +`_. diff --git a/playbooks/ironic-python-agent-buildimage/post.yaml b/playbooks/ironic-python-agent-buildimage/post.yaml deleted file mode 100644 index f84d14ba1..000000000 --- a/playbooks/ironic-python-agent-buildimage/post.yaml +++ /dev/null @@ -1,43 +0,0 @@ -- hosts: all - tasks: - - - name: Ensure artifacts directory exists - file: - path: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/files' - state: directory - delegate_to: localhost - - - name: Copy files from {{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent on node - synchronize: - src: '{{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent/UPLOAD_RAW/' - dest: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/files/' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent on node - synchronize: - src: '{{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent/UPLOAD_TAR/' - dest: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent on node - synchronize: - src: '{{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/testrepository.subunit.gz - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/ironic-python-agent-buildimage/pre-dib.yaml b/playbooks/ironic-python-agent-buildimage/pre-dib.yaml deleted file mode 100644 index 88b699005..000000000 --- a/playbooks/ironic-python-agent-buildimage/pre-dib.yaml +++ /dev/null @@ -1,19 +0,0 @@ -- hosts: all - tasks: - - - name: Install binary dependencies from diskimage-builder - include_role: - name: bindep - vars: - bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/diskimage-builder'].src_dir }}" - - - name: Install requirements for ironic-python-agent-builder - pip: - requirements: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ironic-python-agent-builder'].src_dir }}/requirements.txt" - extra_args: -c "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/upper-constraints.txt" - become: true - - - name: Install ironic-python-agent-builder - pip: - name: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ironic-python-agent-builder'].src_dir }}" - become: true diff --git a/playbooks/ironic-python-agent-buildimage/run.yaml b/playbooks/ironic-python-agent-buildimage/run.yaml deleted file mode 100644 index 3ffcab6ad..000000000 --- a/playbooks/ironic-python-agent-buildimage/run.yaml +++ /dev/null @@ -1,60 +0,0 @@ -- hosts: all - tasks: - - shell: - cmd: | - set -e - set -x - BRANCH={{ zuul.branch }} - export BRANCH_PATH=`echo $BRANCH | tr / -` - - mkdir UPLOAD_RAW - mkdir UPLOAD_TAR - - JOBNAME='ironic-python-agent-buildimage-{{ image_name }}' - TRANS_START_TIME=$(date +%s) - SUBUNIT_OUTPUT=testrepository.subunit - ERRORS=1 - VENV=$(mktemp -d) - virtualenv $VENV - $VENV/bin/pip install -U os-testr - - trap "finish" EXIT - - function finish { - if [[ "$ERRORS" -eq 1 ]]; then - $VENV/bin/generate-subunit $TRANS_START_TIME $SECONDS 'fail' $JOBNAME >> $SUBUNIT_OUTPUT - else - $VENV/bin/generate-subunit $TRANS_START_TIME $SECONDS 'success' $JOBNAME >> $SUBUNIT_OUTPUT - fi - gzip -9 $SUBUNIT_OUTPUT - if [ "$VENV" != "" ] ; then - rm -rf $VENV - VENV="" - fi - } - - type='{{ image_name }}' - case $type in - tinyipa) - export BUILD_AND_INSTALL_TINYIPA=true - export IPA_SOURCE_DIR={{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent - pushd {{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent-builder/tinyipa - make - mv tinyipa*.tar.gz* "$IPA_SOURCE_DIR/UPLOAD_TAR" - mv tinyipa*.* "$IPA_SOURCE_DIR/UPLOAD_RAW" - mv tiny-instance-uec*.tar.gz "$IPA_SOURCE_DIR/UPLOAD_TAR" - # NOTE(sambetts) Must clean up chroot directories before - # publisher rsync command tries and fails to read them - make clean - popd - ;; - dib) - NAME=ipa-{{ image_distro }}-$BRANCH_PATH - ironic-python-agent-builder -e dhcp-all-interfaces -o $NAME {{ image_distro }} - tar -czf UPLOAD_TAR/$NAME.tar.gz ${NAME}* - mv ${NAME}* "$IPA_SOURCE_DIR/UPLOAD_RAW" - ;; - esac - ERRORS=0 - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent' diff --git a/zuul.d/ironic-python-agent-jobs.yaml b/zuul.d/ironic-python-agent-jobs.yaml index 7c7c6b72c..a6cc9bde7 100644 --- a/zuul.d/ironic-python-agent-jobs.yaml +++ b/zuul.d/ironic-python-agent-jobs.yaml @@ -86,37 +86,6 @@ devstack_plugins: ironic-inspector: https://opendev.org/openstack/ironic-inspector -- job: - name: ironic-python-agent-buildimage-base - parent: publish-openstack-artifacts - run: playbooks/ironic-python-agent-buildimage/run.yaml - post-run: playbooks/ironic-python-agent-buildimage/post.yaml - timeout: 1800 - required-projects: - - openstack/requirements - - openstack/ironic-python-agent - - openstack/ironic-python-agent-builder - -- job: - name: ironic-python-agent-buildimage-tinyipa - parent: ironic-python-agent-buildimage-base - vars: - image_name: 'tinyipa' - # TODO(dtantsur): refactor run.yaml, so that this variable is only - # required for DIB jobs. - image_distro: '' - -- job: - name: ironic-python-agent-buildimage-dib - parent: ironic-python-agent-buildimage-base - pre-run: playbooks/ironic-python-agent-buildimage/pre-dib.yaml - required-projects: - # NOTE(dtantsur): used for bindep only - - openstack/diskimage-builder - vars: - image_name: 'dib' - image_distro: 'centos7' - # Experimental jobs - job: diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index e3df215fc..4b18e913a 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -13,6 +13,12 @@ - ipa-tempest-wholedisk-bios-ipmi-direct-tinyipa-src - ipa-tempest-wholedisk-bios-ipmi-iscsi-tinyipa-src - ironic-standalone-ipa-src + # NOTE(dtantsur): non-voting because IPA source code is very unlikely + # to break them. They rather serve as a canary for broken POST jobs. + - ironic-python-agent-check-image-tinyipa: + voting: false + - ironic-python-agent-check-image-dib-centos7: + voting: false # Non-voting jobs - ipa-tempest-ironic-inspector-src: voting: false @@ -38,5 +44,5 @@ - ipa-tempest-dsvm-partition-ipmi-iscsi-tinyipa-python3 post: jobs: - - ironic-python-agent-buildimage-tinyipa - - ironic-python-agent-buildimage-dib + - ironic-python-agent-build-image-tinyipa + - ironic-python-agent-build-image-dib-centos7