fix: restore ADC init sidecar for stock LiteLLM
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
FROM ghcr.io/berriai/litellm:main-stable
|
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN apk add --no-cache coreutils
|
|
||||||
|
|
||||||
COPY vertex-entrypoint.sh /app/vertex-entrypoint.sh
|
|
||||||
RUN chmod 0755 /app/vertex-entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/app/vertex-entrypoint.sh"]
|
|
||||||
@@ -1,21 +1,40 @@
|
|||||||
services:
|
services:
|
||||||
|
adc-init:
|
||||||
|
image: alpine:3.22
|
||||||
|
restart: "no"
|
||||||
|
environment:
|
||||||
|
GOOGLE_ADC_B64: ${GOOGLE_ADC_B64}
|
||||||
|
volumes:
|
||||||
|
- google-adc:/credentials
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
umask 077
|
||||||
|
printf '%s' "$${GOOGLE_ADC_B64}" | base64 -d > /credentials/application_default_credentials.json
|
||||||
|
|
||||||
litellm:
|
litellm:
|
||||||
build: .
|
image: ghcr.io/berriai/litellm:main-stable
|
||||||
image: local/litellm-vertex:main-stable
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
adc-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
ports:
|
ports:
|
||||||
- "${LISTEN_IP:-127.0.0.1}:${HOST_PORT:-4000}:4000"
|
- "${LISTEN_IP:-127.0.0.1}:${HOST_PORT:-4000}:4000"
|
||||||
environment:
|
environment:
|
||||||
GOOGLE_ADC_B64: ${GOOGLE_ADC_B64}
|
GOOGLE_APPLICATION_CREDENTIALS: /credentials/application_default_credentials.json
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: /tmp/application_default_credentials.json
|
|
||||||
VERTEXAI_PROJECT: ${VERTEXAI_PROJECT}
|
VERTEXAI_PROJECT: ${VERTEXAI_PROJECT}
|
||||||
VERTEXAI_LOCATION: ${VERTEXAI_LOCATION:-global}
|
VERTEXAI_LOCATION: ${VERTEXAI_LOCATION:-global}
|
||||||
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
|
||||||
|
- google-adc:/credentials:ro
|
||||||
command: ["--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"]
|
command: ["--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"]
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
max-size: 1m
|
max-size: 1m
|
||||||
max-file: "2"
|
max-file: "2"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
google-adc:
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
umask 077
|
|
||||||
printf '%s' "${GOOGLE_ADC_B64}" | base64 -d > "${GOOGLE_APPLICATION_CREDENTIALS}"
|
|
||||||
|
|
||||||
exec /app/docker/prod_entrypoint.sh "$@"
|
|
||||||
Reference in New Issue
Block a user