New is_runpod() function (#18761)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
87fd0b1b30
commit
42a220c71d
2 changed files with 15 additions and 1 deletions
|
|
@ -577,6 +577,16 @@ def is_jupyter():
|
|||
return IS_COLAB or IS_KAGGLE
|
||||
|
||||
|
||||
def is_runpod():
|
||||
"""
|
||||
Check if the current script is running inside a RunPod container.
|
||||
|
||||
Returns:
|
||||
(bool): True if running in RunPod, False otherwise.
|
||||
"""
|
||||
return "RUNPOD_POD_ID" in os.environ
|
||||
|
||||
|
||||
def is_docker() -> bool:
|
||||
"""
|
||||
Determine if the script is running inside a Docker container.
|
||||
|
|
@ -1042,7 +1052,7 @@ def set_sentry():
|
|||
auto_enabling_integrations=False,
|
||||
traces_sample_rate=1.0,
|
||||
release=__version__,
|
||||
environment="production", # 'dev' or 'production'
|
||||
environment="runpod" if is_runpod() else "production",
|
||||
before_send=before_send,
|
||||
ignore_errors=[KeyboardInterrupt, FileNotFoundError],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue