Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onedata objectstore #17540

Merged
merged 13 commits into from
May 19, 2024
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
3 changes: 3 additions & 0 deletions lib/galaxy/config/sample/file_sources_conf.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,12 @@
public_name: ${user.preferences['zenodo_sandbox|public_name']}
writable: true

# Note for developers: you can easily set up a minimal, dockerized Onedata environment
# using the so-called "demo-mode": https://onedata.org/#/home/documentation/topic/stable/demo-mode
- type: onedata
id: onedata1
label: Onedata
doc: Your Onedata files - configure an access token via user preferences
accessToken: ${user.preferences['onedata|access_token']}
onezoneDomain: ${user.preferences['onedata|onezone_domain']}
disableTlsCertificateValidation: ${user.preferences['onedata|disable_tls_certificate_validation']}
32 changes: 32 additions & 0 deletions lib/galaxy/config/sample/object_store_conf.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,38 @@ extra_dirs:
- type: job_work
path: database/job_working_directory_s3

#
# Sample Onedata Object Store
#
# Note for developers: you can easily set up a minimal, dockerized Onedata environment
# using the so-called "demo-mode": https://onedata.org/#/home/documentation/topic/stable/demo-mode
#

type: onedata
auth:
# an access token suitable for data access (allowing calls to the Oneprovider REST API).
access_token: ...
connection:
# the domain of the Onezone service (e.g. "demo.onedata.org"), or its IP address for
# devel instances (see above).
onezone_domain: demo.onedata.org
# Allows connection to Onedata servers that do not present trusted SSL certificates.
# SHOULD NOT be used unless you really know what you are doing.
disable_tls_certificate_validation: false
space:
# the name of the Onedata space where the Galaxy data will be stored.
name: demo-space
# the relative directory path in the space under which the Galaxy data will be stored.
# Optional, if not provided, the data will be stored in the root of space.
path: galaxy-data
cache:
path: database/object_store_cache_s3
size: 1000
cache_updated_data: true
extra_dirs:
- type: job_work
path: database/job_working_directory_s3

#
# Sample iRODS Object Store configuration
#
Expand Down
36 changes: 36 additions & 0 deletions lib/galaxy/config/sample/object_store_conf.xml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,42 @@
</object_store>
-->

<!--
Sample Onedata Object Store

Note for developers: you can easily set up a minimal, dockerized Onedata environment
using the so-called "demo-mode": https://onedata.org/#/home/documentation/topic/stable/demo-mode

Onedata specific options:
//auth/@access_token -
an access token suitable for data access (allowing calls to the Oneprovider REST API).

//connection/@onezone_domain -
the domain of the Onezone service (e.g. "demo.onedata.org"), or its IP address for
devel instances (see above).

//connection/@disable_tls_certificate_validation -
Allows connection to Onedata servers that do not present trusted SSL certificates.
SHOULD NOT be used unless you really know what you are doing.

//space/@name -
the name of the Onedata space where the Galaxy data will be stored.

//space/@path -
the relative directory path in the space under which the Galaxy data will be stored.
Optional, if not provided, the data will be stored in the root of space.
-->
<!--
<object_store type="onedata">
<auth access_token="..." />
<connection onezone_domain="demo.onedata.org" disable_tls_certificate_validation="False"/>
<space name="demo-space" path="galaxy-data" />
<cache path="database/object_store_cache" size="1000" cache_updated_data="True" />
<extra_dir type="job_work" path="database/job_working_directory_onedata"/>
<extra_dir type="temp" path="database/tmp_onedata"/>
</object_store>
-->

<!--
Sample iRODS Object Store
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,8 @@ preferences:
label: Your access token, suitable for REST API access in a Oneprovider service
type: password
required: False
- name: disable_tls_certificate_validation
label: Allow connection to Onedata servers that do not present trusted SSL certificates. SHOULD NOT be used unless you really know what you are doing.
type: boolean
required: False
value: False
3 changes: 3 additions & 0 deletions lib/galaxy/dependencies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def check_fs_gcsfs(self):
def check_google_cloud_storage(self):
return "googlecloudstorage" in self.file_sources

def check_onedatafilerestclient(self):
return "onedata" in self.object_stores

def check_fs_onedatarestfs(self):
return "onedata" in self.file_sources

Expand Down
5 changes: 4 additions & 1 deletion lib/galaxy/dependencies/conditional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fs.googledrivefs # type: googledrive
fs-gcsfs # type: googlecloudstorage
# fs-gcsfs doesn't pin google-cloud-storage, and old versions log noisy exceptions and break test discovery
google-cloud-storage>=2.8.0 # type: googlecloudstorage
fs.onedatarestfs # type: onedata
fs.onedatarestfs # type: onedata, depends on onedatafilerestclient
fs-basespace # type: basespace

# Vault backend
Expand All @@ -40,6 +40,9 @@ pykube-ng==21.3.0
# Synnefo / Pithos+ object store client
kamaki

# Onedata REST-based client for data access, required by the Onedata object store
onedatafilerestclient

watchdog

# Error reporters optional modules
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/dependencies/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ myst-parser==3.0.0 ; python_version >= "3.8" and python_version < "3.13"
nh3==0.2.17 ; python_version >= "3.8" and python_version < "3.13"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.9"
numpy==1.26.4 ; python_version >= "3.9" and python_version < "3.13"
onedatafilerestclient==21.2.5rc1 ; python_version >= "3.8" and python_version < "3.13"
outcome==1.3.0.post0 ; python_version >= "3.8" and python_version < "3.13"
packaging==24.0 ; python_version >= "3.8" and python_version < "3.13"
pathspec==0.12.1 ; python_version >= "3.8" and python_version < "3.13"
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/files/sources/onedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def _open_fs(self, user_context=None, opts: Optional[FilesSourceOptions] = None)
onezone_domain = props.pop("onezoneDomain", "") or ""
onezone_domain = remove_prefix("http://", remove_prefix("https://", onezone_domain))
access_token = props.pop("accessToken", "") or ""
handle = OnedataRESTFS(onezone_domain, access_token)
disable_tls_certificate_validation = props.pop("disableTlsCertificateValidation", False) or False
handle = OnedataRESTFS(onezone_domain, access_token, verify_ssl=not disable_tls_certificate_validation)
return handle


Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,10 @@ def type_to_object_store_class(store: str, fsmon: bool = False) -> Tuple[Type[Ba
from .rucio import RucioObjectStore

objectstore_class = RucioObjectStore
elif store == "onedata":
from .onedata import OnedataObjectStore

objectstore_class = OnedataObjectStore
else:
raise Exception(f"Unrecognized object store definition: {store}")
# Disable the Pulsar object store for now until it receives some attention
Expand Down
Loading
Loading