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
|
|
@ -87,6 +87,10 @@ keywords: Ultralytics, utils, TQDM, Python, ML, Machine Learning utilities, YOLO
|
||||||
|
|
||||||
<br><br><hr><br>
|
<br><br><hr><br>
|
||||||
|
|
||||||
|
## ::: ultralytics.utils.is_runpod
|
||||||
|
|
||||||
|
<br><br><hr><br>
|
||||||
|
|
||||||
## ::: ultralytics.utils.is_docker
|
## ::: ultralytics.utils.is_docker
|
||||||
|
|
||||||
<br><br><hr><br>
|
<br><br><hr><br>
|
||||||
|
|
|
||||||
|
|
@ -577,6 +577,16 @@ def is_jupyter():
|
||||||
return IS_COLAB or IS_KAGGLE
|
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:
|
def is_docker() -> bool:
|
||||||
"""
|
"""
|
||||||
Determine if the script is running inside a Docker container.
|
Determine if the script is running inside a Docker container.
|
||||||
|
|
@ -1042,7 +1052,7 @@ def set_sentry():
|
||||||
auto_enabling_integrations=False,
|
auto_enabling_integrations=False,
|
||||||
traces_sample_rate=1.0,
|
traces_sample_rate=1.0,
|
||||||
release=__version__,
|
release=__version__,
|
||||||
environment="production", # 'dev' or 'production'
|
environment="runpod" if is_runpod() else "production",
|
||||||
before_send=before_send,
|
before_send=before_send,
|
||||||
ignore_errors=[KeyboardInterrupt, FileNotFoundError],
|
ignore_errors=[KeyboardInterrupt, FileNotFoundError],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue