|
27 | 27 | WEBRTC_MODAL_FUNCTION_MIN_CONTAINERS, |
28 | 28 | WEBRTC_MODAL_FUNCTION_SCALEDOWN_WINDOW, |
29 | 29 | WEBRTC_MODAL_FUNCTION_TIME_LIMIT, |
30 | | - WEBRTC_MODAL_IMAGE_FROM_GCP, |
| 30 | + WEBRTC_MODAL_GCP_SECRET_NAME, |
31 | 31 | WEBRTC_MODAL_IMAGE_NAME, |
32 | 32 | WEBRTC_MODAL_IMAGE_TAG, |
33 | 33 | WEBRTC_MODAL_RESPONSE_TIMEOUT, |
|
59 | 59 |
|
60 | 60 | if modal is not None: |
61 | 61 | 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: |
63 | 63 | # 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) |
65 | 65 | # 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, |
73 | 69 | ) |
74 | 70 | 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}" |
79 | 73 | ) |
| 74 | + video_processing_image = video_processing_image.pip_install("modal").entrypoint([]) |
80 | 75 |
|
81 | 76 | # https://modal.com/docs/reference/modal.Volume |
82 | 77 | rfcache_volume = modal.Volume.from_name("rfcache", create_if_missing=True) |
|
0 commit comments