fix: decode Vertex ADC with Python
This commit is contained in:
@@ -12,12 +12,15 @@ services:
|
|||||||
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/config.yaml:ro
|
- ./config.yaml:/app/config.yaml:ro
|
||||||
entrypoint: ["/bin/sh", "-c"]
|
entrypoint: ["python", "-c"]
|
||||||
command:
|
command:
|
||||||
- |
|
- |
|
||||||
umask 077
|
import base64, os
|
||||||
printf '%s' "$${GOOGLE_ADC_B64}" | base64 -d > /tmp/application_default_credentials.json
|
path = "/tmp/application_default_credentials.json"
|
||||||
exec litellm --config /app/config.yaml --host 0.0.0.0 --port 4000
|
with open(path, "wb") as credential_file:
|
||||||
|
credential_file.write(base64.b64decode(os.environ["GOOGLE_ADC_B64"]))
|
||||||
|
os.chmod(path, 0o600)
|
||||||
|
os.execvp("litellm", ["litellm", "--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"])
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
|||||||
Reference in New Issue
Block a user