File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 741741)
742742WEBRTC_MODAL_RTSP_PLACEHOLDER = os .getenv ("WEBRTC_MODAL_RTSP_PLACEHOLDER" )
743743WEBRTC_MODAL_RTSP_PLACEHOLDER_URL = os .getenv ("WEBRTC_MODAL_RTSP_PLACEHOLDER_URL" )
744+ WEBRTC_MODAL_GCP_SECRET_NAME = os .getenv ("WEBRTC_MODAL_GCP_SECRET_NAME" )
744745HTTP_API_SHARED_WORKFLOWS_THREAD_POOL_ENABLED = str2bool (
745746 os .getenv ("HTTP_API_SHARED_WORKFLOWS_THREAD_POOL_ENABLED" , "True" )
746747)
Original file line number Diff line number Diff line change 2727 WEBRTC_MODAL_FUNCTION_MIN_CONTAINERS ,
2828 WEBRTC_MODAL_FUNCTION_SCALEDOWN_WINDOW ,
2929 WEBRTC_MODAL_FUNCTION_TIME_LIMIT ,
30+ WEBRTC_MODAL_GCP_SECRET_NAME ,
3031 WEBRTC_MODAL_IMAGE_NAME ,
3132 WEBRTC_MODAL_IMAGE_TAG ,
3233 WEBRTC_MODAL_RESPONSE_TIMEOUT ,
5859
5960if modal is not None :
6061 docker_tag : str = WEBRTC_MODAL_IMAGE_TAG if WEBRTC_MODAL_IMAGE_TAG else __version__
61- # https://modal.com/docs/reference/modal.Image
62- video_processing_image = (
63- modal .Image .from_registry (f"{ WEBRTC_MODAL_IMAGE_NAME } :{ docker_tag } " )
64- .pip_install ("modal" )
65- .entrypoint ([])
66- )
62+ if WEBRTC_MODAL_GCP_SECRET_NAME :
63+ # https://modal.com/docs/reference/modal.Secret#from_name
64+ secret = modal .Secret .from_name (WEBRTC_MODAL_GCP_SECRET_NAME )
65+ # https://modal.com/docs/reference/modal.Image#from_gcp_artifact_registry
66+ video_processing_image = modal .Image .from_gcp_artifact_registry (
67+ f"{ WEBRTC_MODAL_IMAGE_NAME } :{ docker_tag } " ,
68+ secret = secret ,
69+ )
70+ else :
71+ video_processing_image = modal .Image .from_registry (
72+ f"{ WEBRTC_MODAL_IMAGE_NAME } :{ docker_tag } "
73+ )
74+ video_processing_image = video_processing_image .pip_install ("modal" ).entrypoint ([])
6775
6876 # https://modal.com/docs/reference/modal.Volume
6977 rfcache_volume = modal .Volume .from_name ("rfcache" , create_if_missing = True )
You can’t perform that action at this time.
0 commit comments