Skip to content

Commit 61a5e2d

Browse files
Change env variable
1 parent b24ac1d commit 61a5e2d

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

inference/core/env.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,7 @@
741741
)
742742
WEBRTC_MODAL_RTSP_PLACEHOLDER = os.getenv("WEBRTC_MODAL_RTSP_PLACEHOLDER")
743743
WEBRTC_MODAL_RTSP_PLACEHOLDER_URL = os.getenv("WEBRTC_MODAL_RTSP_PLACEHOLDER_URL")
744-
WEBRTC_MODAL_IMAGE_FROM_GCP = str2bool(
745-
os.getenv("WEBRTC_MODAL_IMAGE_FROM_GCP", "False")
746-
)
744+
WEBRTC_MODAL_GCP_SECRET_NAME = os.getenv("WEBRTC_MODAL_GCP_SECRET_NAME")
747745
HTTP_API_SHARED_WORKFLOWS_THREAD_POOL_ENABLED = str2bool(
748746
os.getenv("HTTP_API_SHARED_WORKFLOWS_THREAD_POOL_ENABLED", "True")
749747
)

inference/core/interfaces/webrtc_worker/modal.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
WEBRTC_MODAL_FUNCTION_MIN_CONTAINERS,
2828
WEBRTC_MODAL_FUNCTION_SCALEDOWN_WINDOW,
2929
WEBRTC_MODAL_FUNCTION_TIME_LIMIT,
30-
WEBRTC_MODAL_IMAGE_FROM_GCP,
30+
WEBRTC_MODAL_GCP_SECRET_NAME,
3131
WEBRTC_MODAL_IMAGE_NAME,
3232
WEBRTC_MODAL_IMAGE_TAG,
3333
WEBRTC_MODAL_RESPONSE_TIMEOUT,
@@ -59,24 +59,19 @@
5959

6060
if modal is not None:
6161
docker_tag: str = WEBRTC_MODAL_IMAGE_TAG if WEBRTC_MODAL_IMAGE_TAG else __version__
62-
if WEBRTC_MODAL_IMAGE_FROM_GCP:
62+
if WEBRTC_MODAL_GCP_SECRET_NAME:
6363
# https://modal.com/docs/reference/modal.Secret#from_name
64-
secret = modal.Secret.from_name("SERVICE_ACCOUNT_JSON")
64+
secret = modal.Secret.from_name(WEBRTC_MODAL_GCP_SECRET_NAME)
6565
# https://modal.com/docs/reference/modal.Image#from_gcp_artifact_registry
66-
video_processing_image = (
67-
modal.Image.from_gcp_artifact_registry(
68-
f"{WEBRTC_MODAL_IMAGE_NAME}:{docker_tag}",
69-
secret=secret,
70-
)
71-
.pip_install("modal")
72-
.entrypoint([])
66+
video_processing_image = modal.Image.from_gcp_artifact_registry(
67+
f"{WEBRTC_MODAL_IMAGE_NAME}:{docker_tag}",
68+
secret=secret,
7369
)
7470
else:
75-
video_processing_image = (
76-
modal.Image.from_registry(f"{WEBRTC_MODAL_IMAGE_NAME}:{docker_tag}")
77-
.pip_install("modal")
78-
.entrypoint([])
71+
video_processing_image = modal.Image.from_registry(
72+
f"{WEBRTC_MODAL_IMAGE_NAME}:{docker_tag}"
7973
)
74+
video_processing_image = video_processing_image.pip_install("modal").entrypoint([])
8075

8176
# https://modal.com/docs/reference/modal.Volume
8277
rfcache_volume = modal.Volume.from_name("rfcache", create_if_missing=True)

0 commit comments

Comments
 (0)