Skip to content

Commit 92fdd88

Browse files
mdellwegggainey
authored andcommitted
Add 0.27 to supported branches
1 parent 8eafca9 commit 92fdd88

8 files changed

Lines changed: 71 additions & 100 deletions

File tree

.ci/ansible/Containerfile.j2

Lines changed: 17 additions & 26 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
18-
{%- endif -%}
19-
{%- for item in plugins -%}
20-
{{ " " }}{{ item.source }}
21-
{%- if item.upperbounds | default(false) -%}
22-
{{ " " }}-c ./{{ item.name }}/upperbounds_constraints.txt
15+
pip3 install {{ image.source }}
16+
{%- if image.upperbounds | default(false) -%}
17+
{{ " " }}-c ./{{ plugin_name }}/upperbounds_constraints.txt
2318
{%- endif -%}
24-
{%- if item.lowerbounds | default(false) -%}
25-
{{ " " }}-c ./{{ item.name }}/lowerbounds_constraints.txt
19+
{%- if image.lowerbounds | default(false) -%}
20+
{{ " " }}-c ./{{ plugin_name }}/lowerbounds_constraints.txt
2621
{%- endif -%}
27-
{%- if item.ci_requirements | default(false) -%}
28-
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt
22+
{%- if image.ci_requirements | default(false) -%}
23+
{{ " " }}-r ./{{ plugin_name }}/ci_requirements.txt
2924
{%- 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,8 @@ 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
49-
USER root:root
5043

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 %}
44+
RUN mkdir /var/lib/pulp/.config
45+
USER root:root
5546

5647
ENTRYPOINT ["/init"]

.ci/ansible/build_container.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Ansible playbook to create the pulp service containers image
22
---
3-
- hosts: localhost
3+
- hosts: "localhost"
44
gather_facts: false
55
vars_files:
6-
- vars/main.yaml
6+
- "vars/main.yaml"
77
tasks:
88
- name: "Generate Containerfile from template"
9-
template:
10-
src: Containerfile.j2
11-
dest: Containerfile
12-
9+
ansible.builtin.template:
10+
src: "Containerfile.j2"
11+
dest: "Containerfile"
1312
- name: "Build pulp image"
1413
# We build from the ../.. (parent dir of pulpcore git repo) Docker build
1514
# "context" so that repos like pulp-smash are accessible to Docker

.ci/ansible/start_container.yaml

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
# Ansible playbook to start the pulp service container and its supporting services
22
---
3-
- hosts: localhost
3+
- hosts: "localhost"
44
gather_facts: false
55
vars_files:
6-
- vars/main.yaml
6+
- "vars/main.yaml"
77
tasks:
88
- name: "Create Settings Directories"
9-
file:
9+
ansible.builtin.file:
1010
path: "{{ item }}"
11-
state: directory
11+
state: "directory"
1212
mode: "0755"
1313
loop:
14-
- settings
15-
- ssh
16-
- ~/.config/pulp_smash
14+
- "settings"
1715

1816
- name: "Generate Pulp Settings"
1917
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+
src: "settings.py.j2"
19+
dest: "settings/settings.py"
2720

2821
- name: "Setup docker networking"
2922
docker_network:
30-
name: pulp_ci_bridge
23+
name: "pulp_ci_bridge"
3124

3225
- name: "Start Service Containers"
3326
docker_container:
@@ -37,24 +30,24 @@
3730
recreate: true
3831
privileged: true
3932
networks:
40-
- name: pulp_ci_bridge
33+
- name: "pulp_ci_bridge"
4134
aliases: "{{ item.name }}"
4235
volumes: "{{ item.volumes | default(omit) }}"
4336
env: "{{ item.env | default(omit) }}"
4437
command: "{{ item.command | default(omit) }}"
45-
state: started
38+
state: "started"
4639
loop: "{{ services | default([]) }}"
4740

4841
- name: "Retrieve Docker Network Info"
4942
docker_network_info:
50-
name: pulp_ci_bridge
51-
register: pulp_ci_bridge_info
43+
name: "pulp_ci_bridge"
44+
register: "pulp_ci_bridge_info"
5245

5346
- name: "Update /etc/hosts"
5447
lineinfile:
55-
path: /etc/hosts
48+
path: "/etc/hosts"
5649
regexp: "\\s{{ item.value.Name }}\\s*$"
57-
line: "{{ item.value.IPv4Address | ipaddr('address') }}\t{{ item.value.Name }}"
50+
line: "{{ item.value.IPv4Address | ansible.utils.ipaddr('address') }}\t{{ item.value.Name }}"
5851
loop: "{{ pulp_ci_bridge_info.network.Containers | dict2items }}"
5952
become: true
6053

@@ -63,19 +56,19 @@
6356
aws_access_key: "{{ minio_access_key }}"
6457
aws_secret_key: "{{ minio_secret_key }}"
6558
s3_url: "http://minio:9000"
66-
region: eu-central-1
67-
name: pulp3
68-
state: present
69-
when: s3_test | default(false)
59+
region: "eu-central-1"
60+
name: "pulp3"
61+
state: "present"
62+
when: "s3_test | default(false)"
7063

7164
- block:
7265
- name: "Wait for Pulp"
7366
uri:
7467
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
68+
follow_redirects: "all"
69+
validate_certs: "no"
70+
register: "result"
71+
until: "result.status == 200"
7972
retries: 12
8073
delay: 5
8174
rescue:
@@ -86,7 +79,7 @@
8679
- name: "Check version of component being tested"
8780
assert:
8881
that:
89-
- (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] | canonical_semver == (component_version | canonical_semver)
82+
- "(result.json.versions | items2dict(key_name='component', value_name='version'))[item.app_label] | canonical_semver == (component_version | canonical_semver)"
9083
fail_msg: |
9184
Component {{ item.app_label }} was expected to be installed in version {{ component_version }}.
9285
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] }}.
@@ -100,9 +93,20 @@
10093
login admin
10194
password password
10295
103-
- hosts: pulp
96+
- hosts: "pulp"
10497
gather_facts: false
10598
tasks:
99+
- name: "Create directory for pulp-smash config"
100+
ansible.builtin.file:
101+
path: "/var/lib/pulp/.config/pulp_smash/"
102+
state: "directory"
103+
mode: "0755"
104+
105+
- name: "Configure pulp-smash"
106+
ansible.builtin.copy:
107+
src: "smash-config.json"
108+
dest: "/var/lib/pulp/.config/pulp_smash/settings.json"
109+
106110
- name: "Set pulp admin password"
107111
command:
108112
cmd: "pulpcore-manager reset-admin-password --password password"

.github/workflows/scripts/before_install.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
COMPONENT_VERSION="$(bump-my-version show current_version | tail -n -1 | python -c 'from packaging.version import Version; print(Version(input()))')"
2727
COMPONENT_SOURCE="./pulp_container/dist/pulp_container-${COMPONENT_VERSION}-py3-none-any.whl"
2828
if [ "$TEST" = "s3" ]; then
29-
COMPONENT_SOURCE="${COMPONENT_SOURCE} pulpcore[s3]"
29+
COMPONENT_SOURCE="${COMPONENT_SOURCE} pulpcore[s3] git+https://github.com/gerrod3/botocore.git@fix-100-continue"
3030
fi
3131
if [ "$TEST" = "azure" ]; then
3232
COMPONENT_SOURCE="${COMPONENT_SOURCE} pulpcore[azure]"
@@ -38,6 +38,7 @@ fi
3838
if [[ "$TEST" = "lowerbounds" ]]; then
3939
python3 .ci/scripts/calc_constraints.py pyproject.toml > lowerbounds_constraints.txt
4040
fi
41+
4142
export PULP_API_ROOT=$(test "${TEST}" = "s3" && echo "/rerouted/djnd/" || echo "/pulp/")
4243

4344
echo "PULP_API_ROOT=${PULP_API_ROOT}" >> "$GITHUB_ENV"
@@ -48,30 +49,31 @@ mkdir -p .ci/ansible/vars
4849
cat > .ci/ansible/vars/main.yaml << VARSYAML
4950
---
5051
scenario: "${TEST}"
52+
plugin_name: "pulp_container"
5153
legacy_component_name: "pulp_container"
5254
component_name: "container"
5355
component_version: "${COMPONENT_VERSION}"
5456
pulp_env: {}
5557
pulp_settings: {"allowed_content_checksums": ["sha1", "sha224", "sha256", "sha384", "sha512"], "allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"], "flatpak_index": true}
5658
pulp_scheme: "https"
57-
pulp_default_container: "ghcr.io/pulp/pulp-ci-centos9:latest"
5859
api_root: "${PULP_API_ROOT}"
5960
image:
6061
name: "pulp"
6162
tag: "ci_build"
62-
plugins:
63-
- name: "pulp_container"
64-
source: "${COMPONENT_SOURCE}"
65-
ci_requirements: $(test -f ci_requirements.txt && echo -n true || echo -n false)
66-
upperbounds: $(test "${TEST}" = "pulp" && echo -n true || echo -n false)
67-
lowerbounds: $(test "${TEST}" = "lowerbounds" && echo -n true || echo -n false)
63+
ci_base: "ghcr.io/pulp/pulp-ci-centos9:latest"
64+
source: "${COMPONENT_SOURCE}"
65+
ci_requirements: $(test -f ci_requirements.txt && echo -n true || echo -n false)
66+
upperbounds: $(test "${TEST}" = "pulp" && echo -n true || echo -n false)
67+
lowerbounds: $(test "${TEST}" = "lowerbounds" && echo -n true || echo -n false)
68+
webserver_snippet: $(test -f pulp_container/app/webserver_snippets/nginx.conf && echo -n true || echo -n false )
69+
extra_files:
70+
- origin: "pulp_container"
71+
destination: "pulp_container"
6872
services:
6973
- name: "pulp"
7074
image: "pulp:ci_build"
7175
volumes:
7276
- "./settings:/etc/pulp"
73-
- "./ssh:/keys/"
74-
- "~/.config:/var/lib/pulp/.config"
7577
- "../../../pulp-openapi-generator:/root/pulp-openapi-generator"
7678
env:
7779
PULP_WORKERS: "4"

.github/workflows/scripts/before_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
# Developers often want to know the final pulp config
2424
echo
2525
echo "# Pulp config:"
26-
tail -v -n +1 .ci/ansible/settings/settings.* ~/.config/pulp_smash/settings.json
26+
tail -v -n +1 .ci/ansible/settings/settings.*
2727

2828
echo
2929
echo "# Containerfile:"

.github/workflows/scripts/install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../pulp-cli/tests/cli.toml"
4444
ansible-playbook build_container.yaml
4545
ansible-playbook start_container.yaml
4646

47-
# .config needs to be accessible by the pulp user in the container, but some
48-
# files will likely be modified on the host by post/pre scripts.
49-
chmod 777 ~/.config/pulp_smash/
50-
chmod 666 ~/.config/pulp_smash/settings.json
5147
# Plugins often write to ~/.config/pulp/cli.toml from the host
5248
chmod 777 ~/.config/pulp
5349
chmod 666 ~/.config/pulp/cli.toml

.github/workflows/scripts/pre_before_script.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

template_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ supported_release_branches:
109109
- "2.22"
110110
- "2.24"
111111
- "2.26"
112+
- "2.27"
112113
sync_ci: true
113114
test_azure: true
114115
test_cli: true
115116
test_deprecations: true
116117
test_gcp: false
117118
test_lowerbounds: true
118119
test_performance: false
119-
test_reroute: true
120120
test_s3: true
121121
use_issue_template: true
122122
...

0 commit comments

Comments
 (0)