Skip to content

Update CI files for branch 3.10 #937

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

Closed
wants to merge 1 commit into from
Closed
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
113 changes: 92 additions & 21 deletions .ci/ansible/settings.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ API_ROOT = {{ api_root | repr }}
{% endfor %}
{% endif %}

{% if s3_test | default(false) %}
MEDIA_ROOT: ""
S3_USE_SIGV4 = True
{% if test_storages_compat_layer is defined and test_storages_compat_layer %}
{# =======================================
Macros for legacy and new storage settings
========================================== -#}

{%- macro s3_settings(legacy) -%}
{%- if legacy %}
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"
{%- else %}
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
Expand All @@ -48,34 +60,93 @@ STORAGES = {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
{% 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 %}
{% endif %}
{%- endif %}
{%- endmacro -%}

{% if azure_test | default(false) %}
{%- macro azure_settings(legacy) -%}
{%- if legacy %}
DEFAULT_FILE_STORAGE = "storages.backends.azure_storage.AzureStorage"
MEDIA_ROOT = ""
AZURE_ACCOUNT_KEY = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
AZURE_ACCOUNT_NAME = "devstoreaccount1"
AZURE_CONTAINER = "pulp-test"
AZURE_LOCATION = "pulp3"
AZURE_OVERWRITE_FILES = True
AZURE_URL_EXPIRATION_SECS = 120
AZURE_CONNECTION_STRING = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;'
{% endif %}
{%- else %}
STORAGES = {
"default": {
"BACKEND": "storages.backends.azure_storage.AzureStorage",
"OPTIONS": {
"account_key": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
"account_name": "devstoreaccount1",
"location": "pulp3",
"azure_container": "pulp-test",
"overwrite_files": True,
"expiration_secs": 120,
"connection_string": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;",
},
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
{%- endif %}
{%- endmacro -%}

{% if gcp_test | default(false) %}
{%- macro gcp_settings(legacy) -%}
{%- if legacy %}
DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
MEDIA_ROOT = ""
GS_BUCKET_NAME = "gcppulp"
GS_CUSTOM_ENDPOINT = "http://ci-gcp:4443"
{%- else %}
STORAGES = {
"default": {
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
"OPTIONS": {
"bucket_name": "gcppulp",
"custom_endpoint": "http://ci-gcp:4443",
},
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
{%- endif %}
{%- endmacro -%}

{#- ==========================================
Render according to test_storages_compat_layer
==============================================

Case 1) test_storages_compat_layer is unset
- All storages render the legacy setting
- Branches using pulpcore <3.70 must leave this key unset (use legacy)

Case 2) test_storages_compat_layer is True
- To tests both work, only one setting uses the new storage setting
- Branches using pulpcore >=3.70,<3.85 must set this key to True (test both)

Case 3) test_storages_compat_layer is False
- All storages render the new setting
- Branches using pulpcore >=3.85 must set this key to False (use new)
-#}

{% if s3_test | default(false) or azure_test | default(false) or gcp_test | default(false)%}
MEDIA_ROOT=""
{% endif %}
{%- if test_storages_compat_layer is not defined -%}
{%- if s3_test | default(false) -%}{{ s3_settings(legacy=True) }}{%- endif -%}
{%- if azure_test | default(false) -%}{{ azure_settings(legacy=True) }}{%- endif -%}
{%- if gcp_test | default(false) -%}{{ gcp_settings(legacy=True) }}{%- endif -%}
{%- else -%}
{%- if test_storages_compat_layer is true -%}
{%- if s3_test | default(false) -%}{{ s3_settings(legacy=False) }}{%- endif -%}
{%- if azure_test | default(false) -%}{{ azure_settings(legacy=True) }}{%- endif -%}
{%- if gcp_test | default(false) -%}{{ gcp_settings(legacy=True) }}{%- endif -%}
{%- elif test_storages_compat_layer is false -%}
{%- if s3_test | default(false) -%}{{ s3_settings(legacy=False) }}{%- endif -%}
{%- if azure_test | default(false) -%}{{ azure_settings(legacy=False) }}{%- endif -%}
{%- if gcp_test | default(false) -%}{{ gcp_settings(legacy=False) }}{%- endif -%}
{%- endif -%}
{%- endif -%}
1 change: 1 addition & 0 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ if [ "$TEST" = "azure" ]; then
sed -i -e '$a azure_test: true\
pulp_scenario_settings: null\
pulp_scenario_env: {}\
test_storages_compat_layer: false\
' vars/main.yaml
fi

Expand Down
Loading