From cf1127e03c6069ca3b117ff0d05b9e083656fb99 Mon Sep 17 00:00:00 2001 From: Iury Gregory Melo Ferreira Date: Mon, 14 Jan 2019 17:08:40 +0100 Subject: [PATCH] Moving publish jobs to zuulv3 Moving IPA coreos and tinyipa publish jobs to zuulv3 Change-Id: I30c39d309ff065ed51726d0360086b0e740a2c2c --- .../post.yaml | 18 ++-- .../run.yaml | 47 +-------- .../run.yaml | 97 ------------------- .../post.yaml | 43 -------- zuul.d/ironic-jobs.yaml | 21 ++++ zuul.d/legacy-ironic-jobs.yaml | 14 --- 6 files changed, 33 insertions(+), 207 deletions(-) rename playbooks/{legacy/ironic-python-agent-buildimage-coreos => ironic-python-agent-buildimage}/post.yaml (52%) rename playbooks/{legacy/ironic-python-agent-buildimage-tinyipa => ironic-python-agent-buildimage}/run.yaml (54%) delete mode 100644 playbooks/legacy/ironic-python-agent-buildimage-coreos/run.yaml delete mode 100644 playbooks/legacy/ironic-python-agent-buildimage-tinyipa/post.yaml diff --git a/playbooks/legacy/ironic-python-agent-buildimage-coreos/post.yaml b/playbooks/ironic-python-agent-buildimage/post.yaml similarity index 52% rename from playbooks/legacy/ironic-python-agent-buildimage-coreos/post.yaml rename to playbooks/ironic-python-agent-buildimage/post.yaml index 88049f6ca..8bfe46e7f 100644 --- a/playbooks/legacy/ironic-python-agent-buildimage-coreos/post.yaml +++ b/playbooks/ironic-python-agent-buildimage/post.yaml @@ -3,14 +3,14 @@ - name: Ensure artifacts directory exists file: - path: '{{ zuul.executor.work_root }}/artifacts/coreos/files' + path: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/files' state: directory delegate_to: localhost - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + - name: Copy files from {{ ansible_user_dir }}/src/ironic-python-agent on node synchronize: - src: '{{ ansible_user_dir }}/workspace/UPLOAD_RAW/' - dest: '{{ zuul.executor.work_root }}/artifacts/coreos/files/' + src: '{{ ansible_user_dir }}/src/ironic-python-agent/UPLOAD_RAW/' + dest: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/files/' mode: pull copy_links: true verify_host: true @@ -18,10 +18,10 @@ - --include=/* - --prune-empty-dirs - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + - name: Copy files from {{ ansible_user_dir }}/src/ironic-python-agent on node synchronize: - src: '{{ ansible_user_dir }}/workspace/UPLOAD_TAR/' - dest: '{{ zuul.executor.work_root }}/artifacts/coreos/' + src: '{{ ansible_user_dir }}/src/ironic-python-agent/UPLOAD_TAR/' + dest: '{{ zuul.executor.work_root }}/artifacts/{{ image_name }}/' mode: pull copy_links: true verify_host: true @@ -29,9 +29,9 @@ - --include=/* - --prune-empty-dirs - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + - name: Copy files from {{ ansible_user_dir }}/src/ironic-python-agent on node synchronize: - src: '{{ ansible_user_dir }}/workspace/' + src: '{{ ansible_user_dir }}/src/ironic-python-agent/' dest: '{{ zuul.executor.log_root }}' mode: pull copy_links: true diff --git a/playbooks/legacy/ironic-python-agent-buildimage-tinyipa/run.yaml b/playbooks/ironic-python-agent-buildimage/run.yaml similarity index 54% rename from playbooks/legacy/ironic-python-agent-buildimage-tinyipa/run.yaml rename to playbooks/ironic-python-agent-buildimage/run.yaml index ca9ccf619..33a720727 100644 --- a/playbooks/legacy/ironic-python-agent-buildimage-tinyipa/run.yaml +++ b/playbooks/ironic-python-agent-buildimage/run.yaml @@ -1,45 +1,5 @@ - hosts: all - name: Autoconverted job legacy-ironic-python-agent-buildimage-tinyipa from old job - ironic-python-agent-buildimage-tinyipa-ubuntu-xenial - roles: - - bindep - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - function cleanup { - # In cases where zuul-cloner is aborted during a git - # clone operation, git will remove the git work tree in - # its cleanup. The work tree in these jobs is the - # workspace directory, which means that subsequent - # jenkins post-build actions can not run because the - # workspace has been removed. - # To reduce the likelihood of this having an impact, - # recreate the workspace directory if needed - mkdir -p $WORKSPACE - rm -f $CLONEMAP - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - EOF - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - git://git.openstack.org $ZUUL_PROJECT - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - shell: cmd: | set -e @@ -51,7 +11,7 @@ mkdir UPLOAD_RAW mkdir UPLOAD_TAR - JOBNAME=ironic-python-agent-buildimage-{image-type}-{node} + JOBNAME='ironic-python-agent-buildimage-{{ image_name }}' TRANS_START_TIME=$(date +%s) SUBUNIT_OUTPUT=testrepository.subunit ERRORS=1 @@ -74,7 +34,7 @@ fi } - type="tinyipa" + type='{{ image_name }}' case $type in tinyipa) export BUILD_AND_INSTALL_TINYIPA=true @@ -94,5 +54,4 @@ esac ERRORS=0 executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' + chdir: '{{ ansible_user_dir }}/src/ironic-python-agent' diff --git a/playbooks/legacy/ironic-python-agent-buildimage-coreos/run.yaml b/playbooks/legacy/ironic-python-agent-buildimage-coreos/run.yaml deleted file mode 100644 index 98ceea73b..000000000 --- a/playbooks/legacy/ironic-python-agent-buildimage-coreos/run.yaml +++ /dev/null @@ -1,97 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-ironic-python-agent-buildimage-coreos from old job - ironic-python-agent-buildimage-coreos-ubuntu-xenial - roles: - - bindep - - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - function cleanup { - # In cases where zuul-cloner is aborted during a git - # clone operation, git will remove the git work tree in - # its cleanup. The work tree in these jobs is the - # workspace directory, which means that subsequent - # jenkins post-build actions can not run because the - # workspace has been removed. - # To reduce the likelihood of this having an impact, - # recreate the workspace directory if needed - mkdir -p $WORKSPACE - rm -f $CLONEMAP - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - EOF - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - git://git.openstack.org $ZUUL_PROJECT - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - BRANCH=$ZUUL_REFNAME - # After migration to zuulv3 BRANCH now looks like refs/heads/master - export BRANCH_PATH=`echo $BRANCH | sed -e "s/refs\/heads\///" | tr / -` - - mkdir UPLOAD_RAW - mkdir UPLOAD_TAR - - JOBNAME=ironic-python-agent-buildimage-{image-type}-{node} - 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="coreos" - case $type in - tinyipa) - export BUILD_AND_INSTALL_TINYIPA=true - (cd imagebuild/tinyipa && make) - mv imagebuild/tinyipa/tinyipa*.tar.gz* UPLOAD_TAR - mv imagebuild/tinyipa/tinyipa*.* UPLOAD_RAW - # NOTE(sambetts) Must clean up chroot directories before - # publisher rsync command tries and fails to read them - (cd imagebuild/tinyipa && make clean) - ;; - coreos) - imagebuild/coreos/full_trusty_build.sh - mv imagebuild/coreos/UPLOAD/coreos_production_pxe* UPLOAD_RAW - mv ipa-coreos*.tar.gz* UPLOAD_TAR - ;; - esac - ERRORS=0 - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/legacy/ironic-python-agent-buildimage-tinyipa/post.yaml b/playbooks/legacy/ironic-python-agent-buildimage-tinyipa/post.yaml deleted file mode 100644 index b25997408..000000000 --- a/playbooks/legacy/ironic-python-agent-buildimage-tinyipa/post.yaml +++ /dev/null @@ -1,43 +0,0 @@ -- hosts: primary - tasks: - - - name: Ensure artifacts directory exists - file: - path: '{{ zuul.executor.work_root }}/artifacts/tinyipa/files' - state: directory - delegate_to: localhost - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/UPLOAD_RAW/' - dest: '{{ zuul.executor.work_root }}/artifacts/tinyipa/files/' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/UPLOAD_TAR/' - dest: '{{ zuul.executor.work_root }}/artifacts/tinyipa/' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/* - - --prune-empty-dirs - - - 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=/testrepository.subunit.gz - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml index 641e9050b..150159535 100644 --- a/zuul.d/ironic-jobs.yaml +++ b/zuul.d/ironic-jobs.yaml @@ -85,3 +85,24 @@ IRONIC_INSPECTOR_BUILD_RAMDISK: True devstack_plugins: ironic-inspector: git://git.openstack.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/ironic-python-agent + +- job: + name: ironic-python-agent-buildimage-coreos + parent: ironic-python-agent-buildimage-base + vars: + image_name: 'coreos' + +- job: + name: ironic-python-agent-buildimage-tinyipa + parent: ironic-python-agent-buildimage-base + vars: + image_name: 'tinyipa' diff --git a/zuul.d/legacy-ironic-jobs.yaml b/zuul.d/legacy-ironic-jobs.yaml index cc5242db0..4f57a4691 100644 --- a/zuul.d/legacy-ironic-jobs.yaml +++ b/zuul.d/legacy-ironic-jobs.yaml @@ -51,20 +51,6 @@ post-run: playbooks/legacy/ipa-tempest-dsvm-wholedisk-bios-ipmi-iscsi-coreos-src/post.yaml timeout: 7200 -- job: - name: ironic-python-agent-buildimage-coreos - parent: legacy-publish-openstack-artifacts - run: playbooks/legacy/ironic-python-agent-buildimage-coreos/run.yaml - post-run: playbooks/legacy/ironic-python-agent-buildimage-coreos/post.yaml - timeout: 1800 - -- job: - name: ironic-python-agent-buildimage-tinyipa - parent: legacy-publish-openstack-artifacts - run: playbooks/legacy/ironic-python-agent-buildimage-tinyipa/run.yaml - post-run: playbooks/legacy/ironic-python-agent-buildimage-tinyipa/post.yaml - timeout: 1800 - - job: name: ipa-tempest-dsvm-partition-bios-ipmi-iscsi-tinyipa256-src parent: legacy-ipa-dsvm-base