Skip to content

Commit 13aeceb

Browse files
committed
Update CI files
1 parent b8528d3 commit 13aeceb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+621
-619
lines changed

.ci/ansible/Containerfile.j2

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
1-
FROM {{ ci_base | default(pulp_default_container) }}
1+
FROM {{ image.ci_base }}
2+
{%- if image.webserver_snippet %}
23

3-
# Add source directories to container
4-
{% for item in plugins %}
5-
ADD ./{{ item.name }} ./{{ item.name }}
6-
{% endfor %}
4+
ADD ./{{ plugin_name }}/{{ plugin_name | replace("-", "_") }}/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ plugin_name }}.conf
5+
{%- endif %}
6+
7+
{%- for item in extra_files | default([]) %}
78

8-
{% for item in extra_files | default([]) %}
99
ADD ./{{ item.origin }} {{ item.destination }}
10-
{% endfor %}
10+
{%- endfor %}
1111

1212
# This MUST be the ONLY call to pip install in inside the container.
1313
RUN pip3 install --upgrade pip setuptools wheel && \
1414
rm -rf /root/.cache/pip && \
15-
pip3 install
16-
{%- if s3_test | default(false) -%}
17-
{{ " " }}git+https://github.com/gerrod3/botocore.git@fix-100-continue
15+
pip3 install {{ image.source }}
16+
{%- if image.upperbounds | default(false) -%}
17+
{{ " " }}-c ./{{ plugin_name }}/upperbounds_constraints.txt
1818
{%- endif -%}
19-
{%- for item in plugins -%}
20-
{{ " " }}{{ item.source }}
21-
{%- if item.upperbounds | default(false) -%}
22-
{{ " " }}-c ./{{ item.name }}/upperbounds_constraints.txt
19+
{%- if image.lowerbounds | default(false) -%}
20+
{{ " " }}-c ./{{ plugin_name }}/lowerbounds_constraints.txt
2321
{%- endif -%}
24-
{%- if item.lowerbounds | default(false) -%}
25-
{{ " " }}-c ./{{ item.name }}/lowerbounds_constraints.txt
22+
{%- if image.ci_requirements | default(false) -%}
23+
{{ " " }}-r ./{{ plugin_name }}/ci_requirements.txt
2624
{%- endif -%}
27-
{%- if item.ci_requirements | default(false) -%}
28-
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt
29-
{%- endif -%}
30-
{%- endfor %}
31-
{{ " " }}-c ./{{ plugins[0].name }}/.ci/assets/ci_constraints.txt && \
25+
{{ " " }}-c ./{{ plugin_name }}/.ci/assets/ci_constraints.txt && \
3226
rm -rf /root/.cache/pip
3327

3428
{% if pulp_env is defined and pulp_env %}
@@ -46,11 +40,12 @@ ENV {{ key | upper }}={{ value }}
4640
USER pulp:pulp
4741
RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \
4842
/usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link
43+
44+
RUN mkdir /var/lib/pulp/.config
4945
USER root:root
5046

51-
{% for item in plugins %}
52-
RUN export plugin_path="$(pip3 show {{ item.name }} | sed -n -e 's/Location: //p')/{{ item.name }}" && \
53-
ln $plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
54-
{% endfor %}
47+
# Lots of plugins try to use this path, and throw warnings if they cannot access it.
48+
RUN mkdir /.pytest_cache
49+
RUN chown pulp:pulp /.pytest_cache
5550

5651
ENTRYPOINT ["/init"]

.ci/ansible/build_container.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Ansible playbook to create the pulp service containers image
22
---
3-
- hosts: localhost
3+
- name: "Build CI Container Image"
4+
hosts: "localhost"
45
gather_facts: false
56
vars_files:
6-
- vars/main.yaml
7+
- "vars/main.yaml"
78
tasks:
89
- name: "Generate Containerfile from template"
9-
template:
10-
src: Containerfile.j2
11-
dest: Containerfile
10+
ansible.builtin.template:
11+
src: "Containerfile.j2"
12+
dest: "Containerfile"
1213

1314
- name: "Build pulp image"
1415
# We build from the ../.. (parent dir of pulpcore git repo) Docker build
@@ -19,9 +20,20 @@
1920
# 1-off-builds and CI purposes (which has no cache across CI runs.)
2021
# Run build.yaml with -e cache=false if your builds are using outdated
2122
# layers.
22-
command: "docker build --network host --no-cache={{ not cache | default(true) | bool }} -t {{ image.name }}:{{ image.tag }} -f {{ playbook_dir }}/Containerfile ../../.."
23+
ansible.builtin.command:
24+
argv:
25+
- "docker"
26+
- "build"
27+
- "--network"
28+
- "host"
29+
- "--no-cache={{ not cache | default(true) | bool }}"
30+
- "-t"
31+
- "{{ image.name }}:{{ image.tag }}"
32+
- "-f"
33+
- "{{ playbook_dir }}/Containerfile"
34+
- "../../.."
2335

2436
- name: "Clean image cache"
25-
docker_prune:
26-
images : true
37+
community.docker.docker_prune:
38+
images: true
2739
...

.ci/ansible/settings.py.j2

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ REDIS_HOST = "localhost"
1010
REDIS_PORT = 6379
1111
ANALYTICS = False
1212

13-
{% if api_root is defined %}
14-
API_ROOT = {{ api_root | repr }}
15-
{% endif %}
16-
1713
{% if pulp_settings %}
1814
{% for key, value in pulp_settings.items() %}
1915
{{ key | upper }} = {{ value | repr }}

.ci/ansible/start_container.yaml

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,127 @@
11
# Ansible playbook to start the pulp service container and its supporting services
22
---
3-
- hosts: localhost
3+
- name: "Start CI Containers"
4+
hosts: "localhost"
45
gather_facts: false
56
vars_files:
6-
- vars/main.yaml
7+
- "vars/main.yaml"
78
tasks:
89
- name: "Create Settings Directories"
9-
file:
10+
ansible.builtin.file:
1011
path: "{{ item }}"
11-
state: directory
12+
state: "directory"
1213
mode: "0755"
1314
loop:
14-
- settings
15-
- ssh
16-
- ~/.config/pulp_smash
15+
- "settings"
1716

1817
- name: "Generate Pulp Settings"
19-
template:
20-
src: settings.py.j2
21-
dest: settings/settings.py
22-
23-
- name: "Configure pulp-smash"
24-
copy:
25-
src: smash-config.json
26-
dest: ~/.config/pulp_smash/settings.json
18+
ansible.builtin.template:
19+
src: "settings.py.j2"
20+
dest: "settings/settings.py"
2721

2822
- name: "Setup docker networking"
29-
docker_network:
30-
name: pulp_ci_bridge
23+
community.docker.docker_network:
24+
name: "pulp_ci_bridge"
3125

3226
- name: "Start Service Containers"
33-
docker_container:
27+
community.docker.docker_container:
3428
name: "{{ item.name }}"
3529
image: "{{ item.image }}"
3630
auto_remove: true
3731
recreate: true
3832
privileged: true
3933
networks:
40-
- name: pulp_ci_bridge
34+
- name: "pulp_ci_bridge"
4135
aliases: "{{ item.name }}"
4236
volumes: "{{ item.volumes | default(omit) }}"
4337
env: "{{ item.env | default(omit) }}"
4438
command: "{{ item.command | default(omit) }}"
45-
state: started
39+
state: "started"
4640
loop: "{{ services | default([]) }}"
4741

4842
- name: "Retrieve Docker Network Info"
49-
docker_network_info:
50-
name: pulp_ci_bridge
51-
register: pulp_ci_bridge_info
43+
community.docker.docker_network_info:
44+
name: "pulp_ci_bridge"
45+
register: "pulp_ci_bridge_info"
5246

5347
- name: "Update /etc/hosts"
54-
lineinfile:
55-
path: /etc/hosts
48+
ansible.builtin.lineinfile:
49+
path: "/etc/hosts"
5650
regexp: "\\s{{ item.value.Name }}\\s*$"
57-
line: "{{ item.value.IPv4Address | ipaddr('address') }}\t{{ item.value.Name }}"
51+
line: "{{ item.value.IPv4Address | ansible.utils.ipaddr('address') }}\t{{ item.value.Name }}"
5852
loop: "{{ pulp_ci_bridge_info.network.Containers | dict2items }}"
5953
become: true
6054

6155
- name: "Create Pulp Bucket"
6256
amazon.aws.s3_bucket:
6357
aws_access_key: "{{ minio_access_key }}"
6458
aws_secret_key: "{{ minio_secret_key }}"
65-
s3_url: "http://minio:9000"
66-
region: eu-central-1
67-
name: pulp3
68-
state: present
69-
when: s3_test | default(false)
59+
endpoint_url: "http://minio:9000"
60+
region: "eu-central-1"
61+
name: "pulp3"
62+
state: "present"
63+
when: "s3_test | default(false)"
64+
65+
- name: "Wait on Services"
66+
block:
67+
- name: "Wait for azurite"
68+
ansible.builtin.uri:
69+
url: "http://ci-azurite:10000/"
70+
status_code:
71+
- 200
72+
- 400
73+
when: "azure_test | default(false)"
74+
retries: 2
75+
delay: 5
7076

71-
- block:
7277
- name: "Wait for Pulp"
73-
uri:
74-
url: "http://pulp{{ lookup('env', 'PULP_API_ROOT') | default('\/pulp\/', True) }}api/v3/status/"
75-
follow_redirects: all
76-
validate_certs: no
77-
register: result
78-
until: result.status == 200
78+
ansible.builtin.uri:
79+
url: "http://pulp{{ pulp_scenario_settings.api_root | default(pulp_settings.api_root | default('\/pulp\/', True), True) }}api/v3/status/"
80+
follow_redirects: "all"
81+
validate_certs: "no"
82+
register: "result"
83+
until: "result.status == 200"
7984
retries: 12
8085
delay: 5
8186
rescue:
8287
- name: "Output pulp container log"
83-
command: "docker logs pulp"
88+
ansible.builtin.command:
89+
cmd: "docker logs pulp"
8490
failed_when: true
8591

8692
- name: "Check version of component being tested"
87-
assert:
93+
ansible.builtin.assert:
8894
that:
89-
- (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] | canonical_semver == (component_version | canonical_semver)
95+
- "(result.json.versions | items2dict(key_name='component', value_name='version'))[item.app_label] | canonical_semver == (component_version | canonical_semver)"
9096
fail_msg: |
9197
Component {{ item.app_label }} was expected to be installed in version {{ component_version }}.
9298
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] }}.
9399
loop: "{{ 'plugins' | ansible.builtin.extract(lookup('ansible.builtin.file', '../../template_config.yml') | from_yaml) }}"
94100

95101
- name: "Set pulp password in .netrc"
96-
copy:
102+
ansible.builtin.copy:
97103
dest: "~/.netrc"
98104
content: |
99105
machine pulp
100106
login admin
101107
password password
102108
103-
- hosts: pulp
109+
- name: "Prepare Pulp Application Container"
110+
hosts: "pulp"
104111
gather_facts: false
105112
tasks:
113+
- name: "Create directory for pulp-smash config"
114+
ansible.builtin.file:
115+
path: "/var/lib/pulp/.config/pulp_smash/"
116+
state: "directory"
117+
mode: "0755"
118+
119+
- name: "Configure pulp-smash"
120+
ansible.builtin.copy:
121+
src: "smash-config.json"
122+
dest: "/var/lib/pulp/.config/pulp_smash/settings.json"
123+
106124
- name: "Set pulp admin password"
107-
command:
125+
ansible.builtin.command:
108126
cmd: "pulpcore-manager reset-admin-password --password password"
109127
...

.ci/assets/ci_constraints.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Pulpcore versions without the openapi command do no longer work in the CI
2-
pulpcore>=3.21.30,!=3.23.*,!=3.24.*,!=3.25.*,!=3.26.*,!=3.27.*,!=3.29.*,!=3.30.*,!=3.31.*,!=3.32.*,!=3.33.*,!=3.34.*,!=3.35.*,!=3.36.*,!=3.37.*,!=3.38.*,!=3.40.*,!=3.41.*,!=3.42.*,!=3.43.*,!=3.44.*,!=3.45.*,!=3.46.*,!=3.47.*,!=3.48.*,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*
2+
# Pulpcore versions without the django 5 storage compatibility will fail, >3.63,<3.70
3+
pulpcore>=3.21.30,!=3.23.*,!=3.24.*,!=3.25.*,!=3.26.*,!=3.27.*,!=3.29.*,!=3.30.*,!=3.31.*,!=3.32.*,!=3.33.*,!=3.34.*,!=3.35.*,!=3.36.*,!=3.37.*,!=3.38.*,!=3.40.*,!=3.41.*,!=3.42.*,!=3.43.*,!=3.44.*,!=3.45.*,!=3.46.*,!=3.47.*,!=3.48.*,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*,!=3.64.*,!=3.65.*,!=3.66.*,!=3.67.*,!=3.68.*,!=3.69.*
34

45

56
tablib!=3.6.0
@@ -8,3 +9,11 @@ tablib!=3.6.0
89

910
multidict!=6.3.0
1011
# This release failed the lower bounds test for some case sensitivity in CIMultiDict.
12+
13+
14+
azure-storage-blob!=12.28.*
15+
# Apparently does not work with current azurite.
16+
17+
18+
pycares<5
19+
# older aiodns versions don't pin pycares UB, and are broken by pycares>=5

0 commit comments

Comments
 (0)