Skip to content

Commit 81fc1c7

Browse files
committed
Update Azure and S3 storage settings for 3.13
Set new storage settings in template_config.yml based on pulpcore requirement (>=3.49.0,<3.85). 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 81fc1c7

File tree

3 files changed

+31
-57
lines changed

3 files changed

+31
-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: {"MEDIA_ROOT": "", "STORAGES": {"default": {"BACKEND": "storages.backends.azure_storage.AzureStorage", "OPTIONS": {"account_key": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", "account_name": "devstoreaccount1", "azure_container": "pulp-test", "connection_string": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;", "expiration_secs": 120, "location": "pulp3", "overwrite_files": true}}, "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}}, "content_origin": null, "domain_enabled": true}\
114113
pulp_scenario_env: {}\
115114
' vars/main.yaml
116115
fi

template_config.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,39 @@ pulp_settings:
4747
orphan_protection_time: 0
4848
pypi_api_hostname: https://pulp:443
4949
pulp_settings_azure:
50+
MEDIA_ROOT: ''
51+
STORAGES:
52+
default:
53+
BACKEND: storages.backends.azure_storage.AzureStorage
54+
OPTIONS:
55+
account_key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
56+
account_name: devstoreaccount1
57+
azure_container: pulp-test
58+
connection_string: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;
59+
expiration_secs: 120
60+
location: pulp3
61+
overwrite_files: true
62+
staticfiles:
63+
BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
5064
content_origin: null
5165
domain_enabled: true
5266
pulp_settings_gcp: null
5367
pulp_settings_s3:
68+
MEDIA_ROOT: ''
69+
STORAGES:
70+
default:
71+
BACKEND: storages.backends.s3boto3.S3Boto3Storage
72+
OPTIONS:
73+
access_key: AKIAIT2Z5TDYPX3ARJBA
74+
addressing_style: path
75+
bucket_name: pulp3
76+
default_acl: '@none'
77+
endpoint_url: http://minio:9000
78+
region_name: eu-central-1
79+
secret_key: fqRvjWaPU5o0fCqQuUWbj9Fainj2pVZtBCiDiieS
80+
signature_version: s3v4
81+
staticfiles:
82+
BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
5483
domain_enabled: true
5584
pydocstyle: true
5685
release_email: pulp-infra@redhat.com
@@ -70,6 +99,5 @@ test_lowerbounds: true
7099
test_performance: false
71100
test_reroute: true
72101
test_s3: true
73-
test_storages_compat_layer: true
74102
use_issue_template: true
75103

0 commit comments

Comments
 (0)