diff --git a/nodepool/elements/cache-devstack/README.rst b/nodepool/elements/cache-devstack/README.rst index 1a568aceed..073f045e6f 100644 --- a/nodepool/elements/cache-devstack/README.rst +++ b/nodepool/elements/cache-devstack/README.rst @@ -1 +1,17 @@ -Pre-cache all of the things devstack might need +cache-devstack +============== + +Pre-cache a range of things into CI images. This element uses the +``source-repositories`` element to acquire files to be cached. The +standard cache location is ``/opt/cache/files``. + +A number of strategies are used to get the files to be cached. + +We have a number of ``source-repository-*`` files for each package +package that should be cached into images. + +``extra-data.d/55-cache-devstack-repos`` goes through each devstack +branch and runs the ``tools/image_list.sh`` script to dynamically +build a list of files to cache as requested by devstack. This is +mostly virtual machine images, but also some other peripheral packages. + diff --git a/nodepool/elements/cache-devstack/source-repository-zanatacli b/nodepool/elements/cache-devstack/source-repository-zanatacli new file mode 100644 index 0000000000..fc2463495c --- /dev/null +++ b/nodepool/elements/cache-devstack/source-repository-zanatacli @@ -0,0 +1 @@ +zanata-cli file /opt/cache/files/zanata-cli-3.8.1-dist.tar.gz https://search.maven.org/remotecontent?filepath=org/zanata/zanata-cli/3.8.1/zanata-cli-3.8.1-dist.tar.gz \ No newline at end of file diff --git a/roles/prep-zanata/README.rst b/roles/prep-zanata/README.rst index ed6d81ceae..94498dbf52 100644 --- a/roles/prep-zanata/README.rst +++ b/roles/prep-zanata/README.rst @@ -27,3 +27,8 @@ Prepare zanata client use :default: 3.8.1 The version of zanata client to install + +.. zuul:rolevar:: zanata_client_checksum + :default: cc4ecfa2d530ff314076bd0173bdf829824737d48d4f4a2f4ca18d263e9da7c3 + + The expected SHA256 checksum of the zanata client diff --git a/roles/prep-zanata/defaults/main.yaml b/roles/prep-zanata/defaults/main.yaml index 5b95a80e58..be4b3264a2 100644 --- a/roles/prep-zanata/defaults/main.yaml +++ b/roles/prep-zanata/defaults/main.yaml @@ -1,2 +1,3 @@ --- zanata_client_version: 3.8.1 +zanata_client_checksum: cc4ecfa2d530ff314076bd0173bdf829824737d48d4f4a2f4ca18d263e9da7c3 \ No newline at end of file diff --git a/roles/prep-zanata/tasks/main.yaml b/roles/prep-zanata/tasks/main.yaml index cce92485c5..f89940952b 100644 --- a/roles/prep-zanata/tasks/main.yaml +++ b/roles/prep-zanata/tasks/main.yaml @@ -14,12 +14,30 @@ state: directory become: true -- name: extract zanata client tarball +- name: Look for cached zanata client + stat: + path: "/opt/cache/files/zanata-cli-{{ zanata_client_version }}-dist.tar.gz" + checksum_algorithm: sha256 + register: cached_client + +- name: Ensure correct checksum of cached client + assert: cached_client.checksum == "{{ zanata_client_checksum }}" + when: cached_client.exists + +- name: Extract cached client tarball + unarchive: + src: "/opt/cache/files/zanata-cli-{{ zanata_client_version }}-dist.tar.gz" + dest: "/opt/zanata" + creates: "/opt/zanata/zanata-cli-{{ zanata_client_version }}/bin/zanata-cli" + when: cached_client.exists + +- name: Download and extract zanata client tarball unarchive: src: "https://search.maven.org/remotecontent?filepath=org/zanata/zanata-cli/{{ zanata_client_version }}/zanata-cli-{{ zanata_client_version }}-dist.tar.gz" remote_src: yes dest: "/opt/zanata/" creates: "/opt/zanata/zanata-cli-{{ zanata_client_version }}/bin/zanata-cli" + when: not cached_client.exists - name: ensure zanata-cli perms file: