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

Conversation

gerrod3
Copy link
Contributor

@gerrod3 gerrod3 commented Dec 6, 2023

Using MinIO for our S3 test backend requires us to use this patch to avoid timeouts when uploading 0-byte files.

[noissue]

@@ -17,7 +19,7 @@ RUN pip3 install
{{ " " }}{{ item.source }}
{%- if item.name == "pulpcore" -%}
{%- if s3_test | default(false) -%}
[s3]
[s3] git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we needed a rebased version of this fix. Also how do we handle this in production?
Do we need to vendor botocore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only affects MinIO, so if users are using that as their backend they will run into a timeout issue after a 0-byte file is uploaded. Luckily with Pulp's artifact system this will only occur once as the second time a 0-byte file is downloaded/uploaded the artifact will be re-used. Also, looking at the Deb tests that trigger this timeout it doesn't actually fail the sync since we have retries on downloads after the timeout. It would probably be good to use a rebased version of this fix.

Also, I've come to realize this bit of code for backend specific installs only works in the pulpcore repository since the plugins list will usually only have the plugin it's testing.

Second thing I've realized is that our lowerbounds test runner is no longer doing anything with the addition of the build step. We modify the requirements.txt after the build step has already ran. We probably need to use the output of .ci/scripts/calc_deps_lowerbounds.py as a constraint file for the pip install. I'll see if I can modify this PR to include that.

Copy link
Member

Choose a reason for hiding this comment

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

The build step only builds a python package of the plugin. I do not see how this affects the lowerbounds test. But I may need a fresh look tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Builds include the required dependencies list in them. This is where pip gets the info on how to install dependencies.

Copy link
Member

@mdellweg mdellweg Dec 7, 2023

Choose a reason for hiding this comment

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

I think, i get what you say. We only pass the built whl to pip inside the container forgetting about the just adapted requirements.txt. I'll find a solution for that.

edit: Press reload first, next time!

@gerrod3 gerrod3 changed the title Add back patched install of botocore for S3 testing Ensure correct dependencies are installed for lowerbounds and cloud storage tests Dec 7, 2023
@gerrod3
Copy link
Contributor Author

gerrod3 commented Dec 7, 2023

I realized my earlier change to ensure django-storage swas installing from the pulpcore requirements was actually only occurring in the pulpcore repository. It just happens that we install django-storages[boto3,azure] in the base pulp image (https://github.com/pulp/pulp-oci-images/blob/latest/images/Containerfile.core.base#L79), so we didn't see any errors in the plugin repositories. Also, lowerbounds was no longer installing from the recalculated requirements.txt since we switched to the build step, so I fixed that by passing it in as a constraint file.

pulpcore test pr: pulp/pulpcore#4849
pulp_python test pr: pulp/pulp_python#638
Check out the pip list in the install step for lowerbounds and s3/azure runners, they are now correct.

{% if item.source.startswith("./") or item.ci_requirements | default(false) %}
{% if item.source.startswith("./") or item.ci_requirements or item.lowerbounds | default(false) %}
Copy link
Member

Choose a reason for hiding this comment

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

Let me think, item.source.startswith("./") should not happen anymore, right? And the rest are rather shallow conditions. Why not just skip the if altogether and add them all to the container?

@@ -62,7 +62,6 @@ 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?

{%- if test_s3 %}
if [ "$TEST" = "s3" ]; then
cat >> vars/main.yaml << VARSYAML
pulpcore: "${PULPCORE_PREFIX}[s3]"
Copy link
Member

Choose a reason for hiding this comment

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

This is really hard to grasp.
Can we please not have the shell variable PULPCORE_PREFIX. Also can we add this suffix to source in case of pulpcore and maybe even for the plugins?
You can set jinja2 variables in the template if that helps any.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


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

…torage tests

+Add back patched install for botocore for S3 testing
  Using MinIO for our S3 test backend requires us to use this patch
  to avoid timeouts when uploading 0-byte files.

[noissue]
Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

That's not exactly what i was looking for. But let's take it that way for now...

@mdellweg mdellweg merged commit d8d9918 into pulp:main Dec 7, 2023
17 checks passed
@gerrod3 gerrod3 deleted the 100-continue branch December 7, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants