From 675bb510f1a3491bf14a6ded17faa5083395aeb9 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 30 Jan 2020 14:53:37 +1100 Subject: [PATCH] Testing publishing artifacts to AFS This is part of our efforts to get tarball publishing onto AFS volumes [1]. Test a new artifact publishing job that puts output at /afs/.openstack.org/project/tarballs.opendev.org. This is intended to replace the existing publishing job when it is working. [1] https://docs.opendev.org/opendev/infra-specs/latest/specs/retire-static.html Change-Id: Ied96194e1904fee232e144a4e89ec8ba2252e42e --- .../openstack-artifacts-with-afs-test.yaml | 14 +++++++++++ .../publish/openstack-artifacts-with-afs.yaml | 13 ++++++++++ zuul.d/jobs.yaml | 24 +++++++++++++++++++ zuul.d/projects.yaml | 1 + zuul.d/secrets.yaml | 16 +++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 playbooks/publish/openstack-artifacts-with-afs-test.yaml create mode 100644 playbooks/publish/openstack-artifacts-with-afs.yaml diff --git a/playbooks/publish/openstack-artifacts-with-afs-test.yaml b/playbooks/publish/openstack-artifacts-with-afs-test.yaml new file mode 100644 index 0000000000..035d6c419f --- /dev/null +++ b/playbooks/publish/openstack-artifacts-with-afs-test.yaml @@ -0,0 +1,14 @@ +- hosts: all + + tasks: + + - name: Ensure artifacts directory exists + file: + path: '{{ zuul.executor.work_root }}/artifacts/afs-copy-test/' + state: directory + delegate_to: localhost + + - name: Write a dummy artifact file + copy: + content: 'This is an artifact created by {{ zuul.change }}/{{ zuul.patchset }}' + dest: '{{ zuul.executor.work_root }}/artifacts/afs-copy-test/{{ zuul.newrev }}' \ No newline at end of file diff --git a/playbooks/publish/openstack-artifacts-with-afs.yaml b/playbooks/publish/openstack-artifacts-with-afs.yaml new file mode 100644 index 0000000000..9eb7468dad --- /dev/null +++ b/playbooks/publish/openstack-artifacts-with-afs.yaml @@ -0,0 +1,13 @@ +- hosts: localhost + tasks: + - block: + - name: Create AFS token + include_role: + name: create-afs-token + - name: Upload to AFS + include_role: + name: upload-afs + - name: Destroy AFS token + include_role: + name: destory-afs-token + when: zuul_success | bool diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index bdc2847fe1..a4eb451fa7 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -79,6 +79,22 @@ - secret: site_tarballs name: fileserver +# NOTE(ianw) 2020-01-30 : we are moving tarballs to publish to an AFS +# volume. This job is intended to replace publish-openstack-artifacts +# when it is debugged and ready. +- job: + name: publish-openstack-artifacts-with-afs + description: | + Publish job to upload artifacts to /afs/.openstack.org/project/tarballs.opendev.org + post-review: true + post-run: playbooks/publish/openstack-artifacts-with-afs.yaml + vars: + afs_source: "{{ zuul.executor.work_root }}/artifacts" + afs_target: "/afs/.openstack.org/project/tarballs.opendev.org/{{ zuul.project.name }}" + secrets: + - secret: afs_tarballs_opendev_org + name: afs + - job: name: release-openstack-puppet parent: publish-openstack-artifacts @@ -1293,3 +1309,11 @@ The testing is done for Ubuntu Xenial. nodeset: ubuntu-xenial + +# NOTE(ianw) : 2020-01-31 temporary job for testing +- job: + name: project-config-test-artifacts-to-afs + parent: publish-openstack-artifacts-with-afs + description: | + Temporary job to test uploading artifacts to AFS + pre-run: playbooks/publish/openstack-artifacts-with-afs-test.yaml diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 7b6354296d..457f50ab54 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -3307,6 +3307,7 @@ files: *infra-docs-index - promote-openstack-specs-site: files: *specs-site + - project-config-test-artifacts-to-afs periodic: jobs: - propose-project-config-update diff --git a/zuul.d/secrets.yaml b/zuul.d/secrets.yaml index ce4bb3e256..423cf921be 100644 --- a/zuul.d/secrets.yaml +++ b/zuul.d/secrets.yaml @@ -489,6 +489,22 @@ CDih/PpK9ofisCqVyvl0E+4l75l4P4TCdi7d96/9qTQSIP0b8uraGnw1QvGj46j4Cus1o 4tjgrxleCEIUTCykp5IWhjbfYUIMK1dqaaEoGE27qBC8FY5rrq9cEVtFvGCUOM= +- secret: + name: afs_tarballs_opendev_org + data: + service_name: service/opendev-zuul@OPENSTACK.ORG + keytab: !encrypted/pkcs1-oaep + - txRUZj32sPR8b8q8WLxO1h6uReCNaJDzDnv0CWGZaMWgJRGoIw8I4//2A1qs4Vy/jcUD6 + Az2fEmdWNqftna2Pcs80tUqJhYJb0MX3BfzQuh43exuQGtVyNaQ8Bzvdsrmb35+Ly+Ebc + MlqWFJBCoeoUjRZ2L2vkBb8hWMS11rmXObXH96c36er8ugej7or53GeWIUyetPcc75fgI + 3G8RHlCTL0FwnY2uMaYCGcaToS8mR9JhaGzT9pSa8XvRcEMyWgmF6LlUg/iBnRDF6L1nW + 6P30lz/S4cGUSaT8ZpbI2i11Zhkja4UrLVvvusTTYZGmFH+UWcsptQfBisuCpcBbQlBgt + rqz9oQ50au8TRSPdtPs+TWIbe554AZunJ2B/JXj0wLNEIPI/N18l/ZGs02AeHg3cJSjUx + 2X7DzuKDIp10lbuzrT9pU3jBDM4x6pxzWdJLIr+FZrVxHfFHgENUod08nrlz+WqXv2T5S + XDl0XJmpimye2A6nStv7GtZ9I8fXKfxflu1pbaU2/72EfEJj0ZRw9xs12qxkWlOjYzaBs + tEtQC3S99eeJKvWuhhDLm6RnFmkqCkwjlNAyJ1GxspuSF98Qg76wq9mNjrkQ0TMsLfhaT + Xh1TqCsYtbfLR+EzCp54l/QV4oaYXrmYzHT7DW5oS61MLKYb/KO2PW5j0WktGo= + - secret: name: gpg_key data: