mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 21:42:09 +08:00
Add gcs_service_enabled function to avoid getting environment variable directly (#7742)
This commit is contained in:
@@ -13,6 +13,12 @@ def env_integer(key, default):
|
||||
return default
|
||||
|
||||
|
||||
def env_bool(key, default):
|
||||
if key in os.environ:
|
||||
return True if os.environ[key].lower() == "true" else False
|
||||
return default
|
||||
|
||||
|
||||
ID_SIZE = 20
|
||||
|
||||
# The default maximum number of bytes to allocate to the object store unless
|
||||
@@ -197,4 +203,4 @@ MACH_PAGE_SIZE_BYTES = 4096
|
||||
# RAY_GCS_SERVICE_ENABLED only set in ci job.
|
||||
# TODO(ffbin): Once we entirely migrate to service-based GCS, we should
|
||||
# remove it.
|
||||
RAY_GCS_SERVICE_ENABLED = "RAY_GCS_SERVICE_ENABLED"
|
||||
GCS_SERVICE_ENABLED = env_bool("RAY_GCS_SERVICE_ENABLED", True)
|
||||
|
||||
Reference in New Issue
Block a user