Skip to content

Commit 14cfe5a

Browse files
committed
Update Azure and S3 storage settings for 3.13
Set storage settings in template_config.yml based on pulpcore requirement (>=3.49.0,<3.85). Storage formats: Azure (legacy), S3 (new STORAGES) This addresses the recent change where plugin-template stopped automatically setting test scenario storage settings and now requires plugins to define them in their template_config.yml.
1 parent c7282be commit 14cfe5a

File tree

3 files changed

+26
-57
lines changed

3 files changed

+26
-57
lines changed

.ci/ansible/settings.py.j2

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,3 @@ API_ROOT = {{ api_root | repr }}
2626
{% endfor %}
2727
{% endif %}
2828

29-
{% if s3_test | default(false) %}
30-
MEDIA_ROOT: ""
31-
S3_USE_SIGV4 = True
32-
{% if test_storages_compat_layer is defined and test_storages_compat_layer %}
33-
STORAGES = {
34-
"default": {
35-
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
36-
"OPTIONS": {
37-
"access_key": "{{ minio_access_key }}",
38-
"secret_key": "{{ minio_secret_key }}",
39-
"region_name": "eu-central-1",
40-
"addressing_style": "path",
41-
"signature_version": "s3v4",
42-
"bucket_name": "pulp3",
43-
"endpoint_url": "http://minio:9000",
44-
"default_acl": "@none None",
45-
},
46-
},
47-
"staticfiles": {
48-
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
49-
},
50-
}
51-
{% else %}
52-
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
53-
AWS_ACCESS_KEY_ID = "{{ minio_access_key }}"
54-
AWS_SECRET_ACCESS_KEY = "{{ minio_secret_key }}"
55-
AWS_S3_REGION_NAME = "eu-central-1"
56-
AWS_S3_ADDRESSING_STYLE = "path"
57-
AWS_S3_SIGNATURE_VERSION = "s3v4"
58-
AWS_STORAGE_BUCKET_NAME = "pulp3"
59-
AWS_S3_ENDPOINT_URL = "http://minio:9000"
60-
AWS_DEFAULT_ACL = "@none None"
61-
{% endif %}
62-
{% endif %}
63-
64-
{% if azure_test | default(false) %}
65-
DEFAULT_FILE_STORAGE = "storages.backends.azure_storage.AzureStorage"
66-
MEDIA_ROOT = ""
67-
AZURE_ACCOUNT_KEY = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
68-
AZURE_ACCOUNT_NAME = "devstoreaccount1"
69-
AZURE_CONTAINER = "pulp-test"
70-
AZURE_LOCATION = "pulp3"
71-
AZURE_OVERWRITE_FILES = True
72-
AZURE_URL_EXPIRATION_SECS = 120
73-
AZURE_CONNECTION_STRING = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;'
74-
{% endif %}
75-
76-
{% if gcp_test | default(false) %}
77-
DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
78-
MEDIA_ROOT = ""
79-
GS_BUCKET_NAME = "gcppulp"
80-
GS_CUSTOM_ENDPOINT = "http://ci-gcp:4443"
81-
{% endif %}

.github/workflows/scripts/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ if [ "$TEST" = "s3" ]; then
9595
sed -i -e '$a s3_test: true\
9696
minio_access_key: "'$MINIO_ACCESS_KEY'"\
9797
minio_secret_key: "'$MINIO_SECRET_KEY'"\
98-
pulp_scenario_settings: {"domain_enabled": true}\
98+
pulp_scenario_settings: {"MEDIA_ROOT": "", "STORAGES": {"default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage", "OPTIONS": {"access_key": "AKIAIT2Z5TDYPX3ARJBA", "addressing_style": "path", "bucket_name": "pulp3", "default_acl": "@none", "endpoint_url": "http://minio:9000", "region_name": "eu-central-1", "secret_key": "fqRvjWaPU5o0fCqQuUWbj9Fainj2pVZtBCiDiieS", "signature_version": "s3v4"}}, "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}}, "domain_enabled": true}\
9999
pulp_scenario_env: {}\
100-
test_storages_compat_layer: true\
101100
' vars/main.yaml
102101
export PULP_API_ROOT="/rerouted/djnd/"
103102
fi
@@ -110,7 +109,7 @@ if [ "$TEST" = "azure" ]; then
110109
- ./azurite:/etc/pulp\
111110
command: "azurite-blob --blobHost 0.0.0.0"' vars/main.yaml
112111
sed -i -e '$a azure_test: true\
113-
pulp_scenario_settings: {"content_origin": null, "domain_enabled": true}\
112+
pulp_scenario_settings: {"AZURE_ACCOUNT_KEY": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", "AZURE_ACCOUNT_NAME": "devstoreaccount1", "AZURE_CONNECTION_STRING": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;", "AZURE_CONTAINER": "pulp-test", "AZURE_LOCATION": "pulp3", "AZURE_OVERWRITE_FILES": true, "AZURE_URL_EXPIRATION_SECS": 120, "DEFAULT_FILE_STORAGE": "storages.backends.azure_storage.AzureStorage", "MEDIA_ROOT": "", "content_origin": null, "domain_enabled": true}\
114113
pulp_scenario_env: {}\
115114
' vars/main.yaml
116115
fi

template_config.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,34 @@ pulp_settings:
4747
orphan_protection_time: 0
4848
pypi_api_hostname: https://pulp:443
4949
pulp_settings_azure:
50+
AZURE_ACCOUNT_KEY: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
51+
AZURE_ACCOUNT_NAME: devstoreaccount1
52+
AZURE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;
53+
AZURE_CONTAINER: pulp-test
54+
AZURE_LOCATION: pulp3
55+
AZURE_OVERWRITE_FILES: true
56+
AZURE_URL_EXPIRATION_SECS: 120
57+
DEFAULT_FILE_STORAGE: storages.backends.azure_storage.AzureStorage
58+
MEDIA_ROOT: ''
5059
content_origin: null
5160
domain_enabled: true
5261
pulp_settings_gcp: null
5362
pulp_settings_s3:
63+
MEDIA_ROOT: ''
64+
STORAGES:
65+
default:
66+
BACKEND: storages.backends.s3boto3.S3Boto3Storage
67+
OPTIONS:
68+
access_key: AKIAIT2Z5TDYPX3ARJBA
69+
addressing_style: path
70+
bucket_name: pulp3
71+
default_acl: '@none'
72+
endpoint_url: http://minio:9000
73+
region_name: eu-central-1
74+
secret_key: fqRvjWaPU5o0fCqQuUWbj9Fainj2pVZtBCiDiieS
75+
signature_version: s3v4
76+
staticfiles:
77+
BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
5478
domain_enabled: true
5579
pydocstyle: true
5680
release_email: pulp-infra@redhat.com
@@ -70,6 +94,5 @@ test_lowerbounds: true
7094
test_performance: false
7195
test_reroute: true
7296
test_s3: true
73-
test_storages_compat_layer: true
7497
use_issue_template: true
7598

0 commit comments

Comments
 (0)