Skip to content
Closed
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
13 changes: 12 additions & 1 deletion python/ray/_private/runtime_env/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ def __new__(cls, value, doc=None):
HTTPS = "https", "Remote https path, assumes everything packed in one zip file."
S3 = "s3", "Remote s3 path, assumes everything packed in one zip file."
GS = "gs", "Remote google storage path, assumes everything packed in one zip file."
OBS = "obs", "Remote huawei obs path, assumes everything packed in one zip file."
FILE = "file", "File storage path, assumes everything packed in one zip file."

@classmethod
def remote_protocols(cls):
# Returns a list of protocols that support remote storage
# These protocols should only be used with paths that end in ".zip" or ".whl"
return [cls.HTTPS, cls.S3, cls.GS, cls.FILE]
return [cls.HTTPS, cls.S3, cls.GS, cls.FILE, cls.OBS]


def _xor_bytes(left: bytes, right: bytes) -> bytes:
Expand Down Expand Up @@ -719,6 +720,16 @@ async def download_and_unpack_package(
"to fetch URIs in Google Cloud Storage bucket."
+ install_warning
)
elif protocol == Protocol.OBS:
try:
from obs import ObsClient # noqa: F401
from smart_open import open as open_file
except ImportError:
raise ImportError(
"You must `pip install smart_open` and "
"`pip install esdk-obs-python` to fetch URIs in obs "
"bucket. " + install_warning
)
elif protocol == Protocol.FILE:
pkg_uri = pkg_uri[len("file://") :]

Expand Down