Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct dependencies are installed for lowerbounds and cloud storage tests #822

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 7 additions & 10 deletions templates/github/.ci/ansible/Containerfile.j2.copy
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ FROM {{ ci_base | default("ghcr.io/pulp/pulp-ci-centos:" + pulp_container_tag) }

# Add source directories to container
{% for item in plugins %}
{% if item.source.startswith("./") or item.ci_requirements | default(false) %}
ADD ./{{ item.name }} ./{{ item.name }}
{% endif %}
{% endfor %}

# Install python packages
# S3 botocore needs to be patched to handle responses from minio during 0-byte uploads
# Hacking botocore (https://github.com/boto/botocore/pull/1990)

RUN pip3 install
{%- if s3_test | default(false) -%}
{{ " " }}git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue
{%- endif -%}
{%- for item in plugins -%}
{%- if item.name == "pulp-certguard" -%}
{{ " " }}python-dateutil rhsm
Copy link
Member

Choose a reason for hiding this comment

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

Can we move that into certguards ci-requirements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, going to require a separate PR though. Interestingly rhsm is installed in the base image (https://github.com/pulp/pulp-oci-images/blob/latest/images/Containerfile.core.base#L75), but not python-dateutil.

Copy link
Member

Choose a reason for hiding this comment

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

Ooof 🤦.

Anyway:
pulp/pulp-certguard#331

{%- endif -%}
{{ " " }}{{ item.source }}
{%- if item.name == "pulpcore" -%}
{%- if s3_test | default(false) -%}
[s3]
{%- elif azure_test | default(false) -%}
[azure]
{%- elif gcp_test | default(false) -%}
[google]
{%- endif -%}
{%- if item.lowerbounds | default(false) -%}
{{ " " }}-c ./{{ item.name }}/lowerbounds_constraints.txt
{%- endif -%}
{%- if item.ci_requirements | default(false) -%}
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ then
fi

if [[ "$TEST" = "lowerbounds" ]]; then
python3 .ci/scripts/calc_deps_lowerbounds.py > lowerbounds_requirements.txt
mv lowerbounds_requirements.txt requirements.txt
Copy link
Member

Choose a reason for hiding this comment

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

I love this part of the change!
Shall we name the file lowerbounds_contstraints.txt instead?

python3 .ci/scripts/calc_deps_lowerbounds.py > lowerbounds_constraints.txt
fi

if [ -f $POST_BEFORE_INSTALL ]; then
Expand Down
27 changes: 26 additions & 1 deletion templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,44 @@ fi

cd .ci/ansible/

{%- set PULPCORE_PREFIX = "" if plugin_name == "pulpcore" else " pulpcore" %}
PLUGIN_SOURCE="${PLUGIN_NAME}"
{%- if test_s3 %}
if [ "$TEST" = "s3" ]; then
PLUGIN_SOURCE="${PLUGIN_SOURCE}{{ PULPCORE_PREFIX }}[s3]"
fi
{%- endif %}
{%- if test_azure %}
if [ "$TEST" = "azure" ]; then
PLUGIN_SOURCE="${PLUGIN_SOURCE}{{ PULPCORE_PREFIX }}[azure]"
fi
{%- endif %}
{%- if test_gcp %}
if [ "$TEST" = "gcp" ]; then
PLUGIN_SOURCE="${PLUGIN_SOURCE}{{ PULPCORE_PREFIX }}[google]"
fi
{%- endif %}

cat >> vars/main.yaml << VARSYAML
image:
name: pulp
tag: "ci_build"
plugins:
- name: {{ plugin_name }}
source: "${PLUGIN_NAME}"
source: "${PLUGIN_SOURCE}"
VARSYAML
if [[ -f ../../ci_requirements.txt ]]; then
cat >> vars/main.yaml << VARSYAML
ci_requirements: true
VARSYAML
fi
{%- if test_lowerbounds %}
if [ "$TEST" = "lowerbounds" ]; then
cat >> vars/main.yaml << VARSYAML
lowerbounds: true
VARSYAML
fi
{%- endif %}

cat >> vars/main.yaml << VARSYAML
services:
Expand Down
Loading