Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install towncrier twine wheel httpie docker netaddr boto3 'ansible~=10.3.0' mkdocs jq jsonpatch bump-my-version
pip install towncrier twine wheel httpie docker netaddr boto3 ansible mkdocs jq jsonpatch bump-my-version
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/pulp_catdog/.ci/assets/httpie/" >> $GITHUB_ENV
echo ::endgroup::

Expand Down
66 changes: 35 additions & 31 deletions templates/github/.ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
# Ansible playbook to start the pulp service container and its supporting services
---
- hosts: localhost
- hosts: "localhost"
gather_facts: false
vars_files:
- vars/main.yaml
- "vars/main.yaml"
tasks:
- name: "Create Settings Directories"
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
state: "directory"
mode: "0755"
loop:
- settings
- ssh
- ~/.config/pulp_smash
- "settings"

- name: "Generate Pulp Settings"
template:
src: settings.py.j2
dest: settings/settings.py

- name: "Configure pulp-smash"
copy:
src: smash-config.json
dest: ~/.config/pulp_smash/settings.json
src: "settings.py.j2"
dest: "settings/settings.py"

- name: "Setup docker networking"
docker_network:
name: pulp_ci_bridge
name: "pulp_ci_bridge"

- name: "Start Service Containers"
docker_container:
Expand All @@ -37,24 +30,24 @@
recreate: true
privileged: true
networks:
- name: pulp_ci_bridge
- name: "pulp_ci_bridge"
aliases: "{{ item.name }}"
volumes: "{{ item.volumes | default(omit) }}"
env: "{{ item.env | default(omit) }}"
command: "{{ item.command | default(omit) }}"
state: started
state: "started"
loop: "{{ services | default([]) }}"

- name: "Retrieve Docker Network Info"
docker_network_info:
name: pulp_ci_bridge
register: pulp_ci_bridge_info
name: "pulp_ci_bridge"
register: "pulp_ci_bridge_info"

- name: "Update /etc/hosts"
lineinfile:
path: /etc/hosts
path: "/etc/hosts"
regexp: "\\s{{ item.value.Name }}\\s*$"
line: "{{ item.value.IPv4Address | ipaddr('address') }}\t{{ item.value.Name }}"
line: "{{ item.value.IPv4Address | ansible.utils.ipaddr('address') }}\t{{ item.value.Name }}"
loop: "{{ pulp_ci_bridge_info.network.Containers | dict2items }}"
become: true

Expand All @@ -63,19 +56,19 @@
aws_access_key: "{{ minio_access_key }}"
aws_secret_key: "{{ minio_secret_key }}"
s3_url: "http://minio:9000"
region: eu-central-1
name: pulp3
state: present
when: s3_test | default(false)
region: "eu-central-1"
name: "pulp3"
state: "present"
when: "s3_test | default(false)"

- block:
- name: "Wait for Pulp"
uri:
url: "http://pulp{{ lookup('env', 'PULP_API_ROOT') | default('\/pulp\/', True) }}api/v3/status/"
follow_redirects: all
validate_certs: no
register: result
until: result.status == 200
follow_redirects: "all"
validate_certs: "no"
register: "result"
until: "result.status == 200"
retries: 12
delay: 5
rescue:
Expand All @@ -86,7 +79,7 @@
- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] | canonical_semver == (component_version | canonical_semver)
- "(result.json.versions | items2dict(key_name='component', value_name='version'))[item.app_label] | canonical_semver == (component_version | canonical_semver)"
fail_msg: |
Component {{ item.app_label }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] }}.
Expand All @@ -100,9 +93,20 @@
login admin
password password

- hosts: pulp
- hosts: "pulp"
gather_facts: false
tasks:
- name: "Create directory for pulp-smash config"
ansible.builtin.file:
path: "/var/lib/pulp/.config/pulp_smash/"
state: "directory"
mode: "0755"

- name: "Configure pulp-smash"
ansible.builtin.copy:
src: "smash-config.json"
dest: "/var/lib/pulp/.config/pulp_smash/settings.json"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. at least in 3.49. Didn't look any further than that...

- name: "Set pulp admin password"
command:
cmd: "pulpcore-manager reset-admin-password --password password"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ services:
image: "pulp:ci_build"
volumes:
- "./settings:/etc/pulp"
- "./ssh:/keys/"
- "~/.config:/var/lib/pulp/.config"
- "../../../pulp-openapi-generator:/root/pulp-openapi-generator"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you dropped ssh dir. Do you know why we had it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we had a sftp test runner where we were able to test the redirect to content app feature.
But it turned out that paramicoSSH was never safe to be used within the async content app.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That test scenario is gone for a looooooong time now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I've only heard stories about this sftp storage

env:
PULP_WORKERS: "4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
# Developers often want to know the final pulp config
echo
echo "# Pulp config:"
tail -v -n +1 .ci/ansible/settings/settings.* ~/.config/pulp_smash/settings.json
tail -v -n +1 .ci/ansible/settings/settings.*

echo
echo "# Containerfile:"
Expand Down
4 changes: 0 additions & 4 deletions templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ cp ~/.config/pulp/cli.toml "${REPO_ROOT}/../{{ cli_package }}/tests/cli.toml"
ansible-playbook build_container.yaml
ansible-playbook start_container.yaml

# .config needs to be accessible by the pulp user in the container, but some
# files will likely be modified on the host by post/pre scripts.
chmod 777 ~/.config/pulp_smash/
chmod 666 ~/.config/pulp_smash/settings.json
{% if test_cli -%}
# Plugins often write to ~/.config/pulp/cli.toml from the host
chmod 777 ~/.config/pulp
Expand Down