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

[experiment] #6202

Closed
wants to merge 6 commits into from
Closed

Conversation

pedro-psb
Copy link
Member

No description provided.

Comment on lines 32 to 46
{% if STORAGES in pulp_scenario_settings %}
STORAGES = {{ pulp_scenario_settings["STORAGES"] }}
{% else %}
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
AWS_ACCESS_KEY_ID = "{{ minio_access_key }}"
AWS_SECRET_ACCESS_KEY = "{{ minio_secret_key }}"
AWS_S3_REGION_NAME = "eu-central-1"
AWS_S3_ADDRESSING_STYLE = "path"
AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_STORAGE_BUCKET_NAME = "pulp3"
AWS_S3_ENDPOINT_URL = "http://minio:9000"
AWS_DEFAULT_ACL = "@none None"
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

Ohhhh. This file is not templated by the template but by the CI.
I think what you can do is fall back to writing the if in python.

And we need to tackle making all of this simpler soon.

Copy link
Member

Choose a reason for hiding this comment

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

Forget that, I think you just forgot to quote "STORAGES"...

@pedro-psb pedro-psb force-pushed the experiment-plugin-template branch from dd9f312 to 63bc396 Compare January 13, 2025 18:35
@pedro-psb pedro-psb force-pushed the experiment-plugin-template branch from 63bc396 to 65a595a Compare January 13, 2025 18:49
@pedro-psb
Copy link
Member Author

pedro-psb commented Jan 13, 2025

Looks like this is worked (here the final settings).
What has been done:

  1. Defined STORAGES for the s3 scenario in template_config.yml
  2. Modified plugin-template to use plugin-defined storages if present
  3. Applied plugin-template

I'm actually a bit surprised that the minio variable interpolation worked, since the code with the curly braces was itself injected through templating.

"endpoint_url": "http://minio:9000"
"default_acl": "@none None"
"staticfiles":
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
Copy link
Member Author

Choose a reason for hiding this comment

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

@mdellweg the storage settings were provided by the template and now they would be provided per-plugin.
Maybe we should just add a flag to whether to use or not the new form and leave the fallback in plugin-template?

@pedro-psb pedro-psb force-pushed the experiment-plugin-template branch from d93848c to 228fe56 Compare January 13, 2025 19:32
@mdellweg
Copy link
Member

Are you saying we now use the literal string "{{ minio_access_key }}" as the key? I agree, a new flag just once again could be the easier solution here.

@pedro-psb
Copy link
Member Author

Are you saying we now use the literal string "{{ minio_access_key }}" as the key?

No, I'm saying I expected it to yield the literal, but it didnt. Anyway, I'm going with the YAPTF (yet another plugin template flag).

@mdellweg
Copy link
Member

Are you saying we now use the literal string "{{ minio_access_key }}" as the key?

No, I'm saying I expected it to yield the literal, but it didnt. Anyway, I'm going with the YAPTF (yet another plugin template flag).

Thank you. That's definitely better than a solution we don't understand.

@pedro-psb pedro-psb force-pushed the experiment-plugin-template branch from 9e72bb2 to b6993f6 Compare January 14, 2025 13:54
@pedro-psb pedro-psb closed this Jan 15, 2025
@pedro-psb pedro-psb deleted the experiment-plugin-template branch January 15, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants