Skip to content

Commit 268abb1

Browse files
committed
Bump Pulp squeezer to latest version
Bumps Pulp squeezer to version 0.3.0, along with bumping and adding required dependencies. The `chunk_size` parameter has been set to 4194304 bytes in `pulp.squeezer.file_content` tasks to workaround a Python bug[0] relating to SSL errors with large requests (fixed in 3.13). Co-Authored-by: Alex Welsh <alex@stackhpc.com> 0: python/cpython#110467
1 parent 562cc0f commit 268abb1

4 files changed

Lines changed: 31 additions & 67 deletions

File tree

etc/kayobe/ansible/pulp/pulp-artifact-upload.yml

Lines changed: 17 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,11 @@
2626
- ndg-httpsclient
2727
- pyasn1
2828
- urllib3
29+
- packaging
30+
- pulp-glue<0.34.0,>=0.33.0
31+
- pulp-glue-deb<0.4.0,>=0.3.0
2932
state: present
3033

31-
- name: Upload an artifact
32-
pulp.squeezer.artifact:
33-
pulp_url: "{{ remote_pulp_url }}"
34-
username: "{{ remote_pulp_username }}"
35-
password: "{{ remote_pulp_password }}"
36-
file: "{{ found_files.files[0].path }}"
37-
state: present
38-
register: upload_result
39-
until: upload_result is success
40-
retries: 3
41-
delay: 60
42-
4334
- name: Get sha256 hash
4435
ansible.builtin.stat:
4536
path: "{{ found_files.files[0].path }}"
@@ -58,87 +49,51 @@
5849
checksum_algorithm: sha256
5950
register: checksum_stats
6051

61-
- name: Upload checksum artifact
62-
pulp.squeezer.artifact:
52+
- name: Ensure file repo exists
53+
pulp.squeezer.file_repository:
6354
pulp_url: "{{ remote_pulp_url }}"
6455
username: "{{ remote_pulp_username }}"
6556
password: "{{ remote_pulp_password }}"
66-
file: "/tmp/{{ found_files.files[0].path | basename }}.sha256"
57+
name: "{{ repository_name }}"
6758
state: present
68-
register: checksum_upload_result
69-
until: checksum_upload_result is success
59+
register: file_repo_result
60+
until: file_repo_result is success
7061
retries: 3
71-
delay: 60
72-
when: upload_checksum
62+
delay: 5
7363

74-
- name: Create file content from artifact
64+
- name: Upload artifact
7565
pulp.squeezer.file_content:
7666
pulp_url: "{{ remote_pulp_url }}"
7767
username: "{{ remote_pulp_username }}"
7868
password: "{{ remote_pulp_password }}"
69+
file: "{{ found_files.files[0].path }}"
7970
sha256: "{{ file_stats.stat.checksum }}"
8071
relative_path: "{{ found_files.files[0].path | basename }}"
8172
state: present
73+
repository: "{{ repository_name }}"
74+
chunk_size: 4194304
8275
register: file_content_result
8376
until: file_content_result is success
8477
retries: 3
8578
delay: 5
8679

87-
- name: Create checksum content from artifact
80+
- name: Upload checksum
8881
pulp.squeezer.file_content:
8982
pulp_url: "{{ remote_pulp_url }}"
9083
username: "{{ remote_pulp_username }}"
9184
password: "{{ remote_pulp_password }}"
85+
file: "/tmp/{{ found_files.files[0].path | basename }}.sha256"
9286
sha256: "{{ checksum_stats.stat.checksum }}"
9387
relative_path: "{{ found_files.files[0].path | basename }}.sha256"
9488
state: present
89+
repository: "{{ repository_name }}"
90+
chunk_size: 4194304
9591
register: checksum_content_result
9692
until: checksum_content_result is success
9793
retries: 3
9894
delay: 5
9995
when: upload_checksum
10096

101-
- name: Ensure file repo exists
102-
pulp.squeezer.file_repository:
103-
pulp_url: "{{ remote_pulp_url }}"
104-
username: "{{ remote_pulp_username }}"
105-
password: "{{ remote_pulp_password }}"
106-
name: "{{ repository_name }}"
107-
state: present
108-
register: file_repo_result
109-
until: file_repo_result is success
110-
retries: 3
111-
delay: 5
112-
113-
- name: Add content to file repo
114-
pulp.squeezer.file_repository_content:
115-
pulp_url: "{{ remote_pulp_url }}"
116-
username: "{{ remote_pulp_username }}"
117-
password: "{{ remote_pulp_password }}"
118-
repository: "{{ repository_name }}"
119-
present_content:
120-
- relative_path: "{{ found_files.files[0].path | basename }}"
121-
sha256: "{{ file_stats.stat.checksum }}"
122-
register: file_repo_content_result
123-
until: file_repo_content_result is success
124-
retries: 3
125-
delay: 5
126-
127-
- name: Add checksum content to file repo
128-
pulp.squeezer.file_repository_content:
129-
pulp_url: "{{ remote_pulp_url }}"
130-
username: "{{ remote_pulp_username }}"
131-
password: "{{ remote_pulp_password }}"
132-
repository: "{{ repository_name }}"
133-
present_content:
134-
- relative_path: "{{ found_files.files[0].path | basename }}.sha256"
135-
sha256: "{{ checksum_stats.stat.checksum }}"
136-
register: checksum_repo_content_result
137-
until: checksum_repo_content_result is success
138-
retries: 3
139-
delay: 5
140-
when: upload_checksum
141-
14297
- name: Create a new publication to point to this version
14398
pulp.squeezer.file_publication:
14499
pulp_url: "{{ remote_pulp_url }}"

etc/kayobe/ansible/requirements.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
collections:
33
- name: stackhpc.cephadm
44
version: 1.22.0
5-
# NOTE: Pinning pulp.squeezer to 0.0.13 because 0.0.14+ depends on the
6-
# pulp_glue Python library being installed.
75
- name: pulp.squeezer
8-
version: 0.0.13
6+
version: 0.3.0
97
- name: stackhpc.pulp
10-
version: 0.5.5
8+
version: full-parallel
9+
type: git
10+
source: https://github.com/stackhpc/ansible-collection-pulp
1111
- name: stackhpc.hashicorp
1212
version: 2.7.1
1313
- name: stackhpc.kayobe_workflows
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
features:
3+
- |
4+
The ``pulp.squeezer`` collection has been updated to the latest version
5+
(0.3.0), with dependencies added and updated as required. The
6+
``stackhpc.pulp`` collection has also been updated to it's latest version
7+
(0.7.0). Combined, these two updates drastically improve the time taken
8+
for artifacts to be pushed to Pulp.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
kayobe@git+https://github.com/stackhpc/kayobe@stackhpc/18.3.0.16
22
ansible-modules-hashivault>=5.3.0
3-
pulp-glue<0.32,>=0.29.2
3+
pulp-glue==0.33.*
4+
pulp-glue-deb==0.3.*
45
jmespath

0 commit comments

Comments
 (0)