Skip to content

Commit

Permalink
rename bucket_location to region to be more aligned with s3 config
Browse files Browse the repository at this point in the history
  • Loading branch information
janjagusch authored and wolfv committed Apr 6, 2022
1 parent e08ac0e commit 16d8507
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/source/deploying/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ Quetz can store packages in Google Cloud Storage. To configure, use the followin
bucket_prefix="..."
bucket_suffix="..."
cache_timeout="..."
bucket_location="..."
region="..."
:project: The Google Cloud Project ID to work under
:token: A token to pass the `gcsfs`. See the `gcsfs documention <https://gcsfs.readthedocs.io/en/latest/index.html#credentials>`_ for valid values.
:bucket_prefix:
:bucket_suffix: channel buckets on GCS are created with the following semantics: ``{bucket_prefix}{channel_name}{bucket_suffix}``
:cache_timeout: Timeout in s after which local GCS cache entries are invalidated. Set to a value <=0 to disable caching completely. Default is that entries are never invalidated.
:bucket_location: Location where new buckets are created. You can find a list of available locations here: https://cloud.google.com/storage/docs/locations#available-locations.
:region: Location where new buckets are created. You can find a list of available locations here: https://cloud.google.com/storage/docs/locations#available-locations.

``local_store`` section
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions quetz/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Config:
ConfigEntry("bucket_prefix", str, default=""),
ConfigEntry("bucket_suffix", str, default=""),
ConfigEntry("cache_timeout", int, default=None),
ConfigEntry("bucket_location", str, default=None),
ConfigEntry("region", str, default=None),
],
required=False,
),
Expand Down Expand Up @@ -406,7 +406,7 @@ def get_package_store(self) -> pkgstores.PackageStore:
'bucket_prefix': self.gcs_bucket_prefix,
'bucket_suffix': self.gcs_bucket_suffix,
'cache_timeout': self.gcs_cache_timeout,
'bucket_location': self.bucket_location,
'region': self.region,
}
)
else:
Expand Down
4 changes: 2 additions & 2 deletions quetz/pkgstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ def __init__(self, config):
self.project = config.get("project")
self.token = config.get("token")
self.cache_timeout = config.get("cache_timeout")
self.bucket_location = config.get("bucket_location")
self.region = config.get("region")

self.fs = gcsfs.GCSFileSystem(
project=self.project,
token=self.token if self.token else None,
cache_timeout=self.cache_timeout,
default_location=self.bucket_location,
default_location=self.region,
)

self.bucket_prefix = config['bucket_prefix']
Expand Down

0 comments on commit 16d8507

Please sign in to comment.