Skip to content

Commit

Permalink
Support configuring object store inline
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Dec 20, 2023
1 parent 2ecf789 commit a65dd8a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/source/admin/galaxy_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,24 @@
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~
``object_store_config``
~~~~~~~~~~~~~~~~~~~~~~~

:Description:
Rather than specifying an object_store_config_file, the object
store configuration can be embedded into Galaxy's config with this
option.
This option has no effect if the file specified by
object_store_config_file exists. Otherwise, if this option is set,
it overrides any other objectstore settings.
The syntax, available instrumenters, and documentation of their
options is explained in detail in the object store sample
configuration file, `object_store_conf.sample.yml`
:Default: ``None``
:Type: seq


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``object_store_cache_monitor_driver``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
10 changes: 10 additions & 0 deletions lib/galaxy/config/sample/galaxy.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,16 @@ galaxy:
# <config_dir>.
#object_store_config_file: object_store_conf.xml

# Rather than specifying an object_store_config_file, the object store
# configuration can be embedded into Galaxy's config with this option.
# This option has no effect if the file specified by
# object_store_config_file exists. Otherwise, if this option is set,
# it overrides any other objectstore settings.
# The syntax, available instrumenters, and documentation of their
# options is explained in detail in the object store sample
# configuration file, `object_store_conf.sample.yml`
#object_store_config: null

# Specify where cache monitoring is driven for caching object stores
# such as S3, Azure, and iRODS. This option has no affect on disk
# object stores. For production instances, the cache should be
Expand Down
14 changes: 14 additions & 0 deletions lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,20 @@ mapping:
Configuration file for the object store
If this is set and exists, it overrides any other objectstore settings.
object_store_config:
type: seq
sequence:
- type: any
desc: |
Rather than specifying an object_store_config_file, the object store configuration can be embedded into
Galaxy's config with this option.
This option has no effect if the file specified by object_store_config_file exists. Otherwise, if this option
is set, it overrides any other objectstore settings.
The syntax, available instrumenters, and documentation of their options is explained in detail in the
object store sample configuration file, `object_store_conf.sample.yml`
object_store_cache_monitor_driver:
type: str
default: 'auto'
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/model/unittest_utils/data_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self, root=None, **kwd):

# objectstore config values...
self.object_store_config_file = ""
self.object_store_config = None
self.object_store = "disk"
self.object_store_check_old_style = False
self.object_store_cache_path = "/tmp/cache"
Expand Down
6 changes: 6 additions & 0 deletions lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ def build_object_store_from_config(
if config_xml is None and config_dict is None:
config_file = config.object_store_config_file
if os.path.exists(config_file):
log.debug("Reading object store config from file: %s", config_file)
if config_file.endswith(".xml") or config_file.endswith(".xml.sample"):
# This is a top level invocation of build_object_store_from_config, and
# we have an object_store_conf.xml -- read the .xml and build
Expand All @@ -1448,6 +1449,11 @@ def build_object_store_from_config(
config_dict = yaml.safe_load(f)
from_object = "dict"
store = config_dict.get("type")
elif config.object_store_config:
log.debug("Reading object store config from object_store_config option")
from_object = "dict"
config_dict = config.object_store_config
store = config_dict.get("type")
else:
store = config.object_store
elif config_xml is not None:
Expand Down

0 comments on commit a65dd8a

Please sign in to comment.