Skip to content
Merged
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
2 changes: 1 addition & 1 deletion dev/deploy-to-container/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, MORE_STORAGE_NAMES
from ietf.settings import STORAGES, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config

ALLOWED_HOSTS = ['*']
Expand Down
2 changes: 1 addition & 1 deletion dev/diff/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, MORE_STORAGE_NAMES
from ietf.settings import STORAGES, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config

ALLOWED_HOSTS = ['*']
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, MORE_STORAGE_NAMES
from ietf.settings import STORAGES, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config

ALLOWED_HOSTS = ['*']
Expand Down
2 changes: 1 addition & 1 deletion docker/configs/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, MORE_STORAGE_NAMES
from ietf.settings import STORAGES, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config

ALLOWED_HOSTS = ['*']
Expand Down
2 changes: 1 addition & 1 deletion ietf/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import shutil
import tempfile
from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, TEST_CODE_COVERAGE_CHECKER, MORE_STORAGE_NAMES
from ietf.settings import STORAGES, TEST_CODE_COVERAGE_CHECKER, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config
import debug # pyflakes:ignore
debug.debug = True
Expand Down
44 changes: 19 additions & 25 deletions k8s/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

from ietf import __release_hash__
from ietf.settings import * # pyflakes:ignore
from ietf.settings import STORAGES, MORE_STORAGE_NAMES, BLOBSTORAGE_CONNECT_TIMEOUT, BLOBSTORAGE_READ_TIMEOUT, BLOBSTORAGE_MAX_ATTEMPTS
import botocore.config


def _multiline_to_list(s):
Expand Down Expand Up @@ -324,29 +326,21 @@ def _multiline_to_list(s):
_blob_store_read_timeout = (
os.environ.get("DATATRACKER_BLOB_STORE_READ_TIMEOUT", BLOBSTORAGE_READ_TIMEOUT)
)
try:
from ietf.settings import MORE_STORAGE_NAMES
except ImportError:
pass # Don't fail if MORE_STORAGE_NAMES is not there, just don't configure it
else:
from ietf.settings import STORAGES # do fail if these aren't found!
import botocore.config

for storage_name in MORE_STORAGE_NAMES:
STORAGES[storage_name] = {
"BACKEND": "ietf.doc.storage_backends.CustomS3Storage",
"OPTIONS": dict(
endpoint_url=_blob_store_endpoint_url,
access_key=_blob_store_access_key,
secret_key=_blob_store_secret_key,
security_token=None,
client_config=botocore.config.Config(
signature_version="s3v4",
connect_timeout=_blob_store_connect_timeout,
read_timeout=_blob_store_read_timeout,
retries={"total_max_attempts": _blob_store_max_attempts},
),
bucket_name=f"{_blob_store_bucket_prefix}{storage_name}".strip(),
ietf_log_blob_timing=_blob_store_enable_profiling,
for storage_name in MORE_STORAGE_NAMES:
STORAGES[storage_name] = {
"BACKEND": "ietf.doc.storage_backends.CustomS3Storage",
"OPTIONS": dict(
endpoint_url=_blob_store_endpoint_url,
access_key=_blob_store_access_key,
secret_key=_blob_store_secret_key,
security_token=None,
client_config=botocore.config.Config(
signature_version="s3v4",
connect_timeout=_blob_store_connect_timeout,
read_timeout=_blob_store_read_timeout,
retries={"total_max_attempts": _blob_store_max_attempts},
),
}
bucket_name=f"{_blob_store_bucket_prefix}{storage_name}".strip(),
ietf_log_blob_timing=_blob_store_enable_profiling,
),
}