-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry-point.sh
More file actions
executable file
·51 lines (38 loc) · 1.48 KB
/
entry-point.sh
File metadata and controls
executable file
·51 lines (38 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -e
# Verify that all required variables are set
if [[ -z "${GCP_PROJECT}" ]]; then
echo "Error: GCP_PROJECT not set"
exit 1
fi
# Fetch secrets from Secret Manager in CGP
export MLFLOW_TRACKING_USERNAME="$(python3 app/get_secret.py --project="${GCP_PROJECT}" --secret=mlflow_tracking_username)"
export MLFLOW_TRACKING_PASSWORD="$(python3 app/get_secret.py --project="${GCP_PROJECT}" --secret=mlflow_tracking_password)"
export ARTIFACT_URL="$(python3 app/get_secret.py --project="${GCP_PROJECT}" --secret=mlflow_artifact_url)"
if [[ -z "${DATABASE_URL}" ]]; then # Allow overriding for local deployment
export DATABASE_URL="$(python3 app/get_secret.py --project="${GCP_PROJECT}" --secret=mlflow_database_url)"
fi
# Verify that all required variables are set
if [[ -z "${MLFLOW_TRACKING_USERNAME}" ]]; then
echo "Error: MLFLOW_TRACKING_USERNAME not set"
exit 1
fi
if [[ -z "${MLFLOW_TRACKING_PASSWORD}" ]]; then
echo "Error: MLFLOW_TRACKING_PASSWORD not set"
exit 1
fi
if [[ -z "${ARTIFACT_URL}" ]]; then
echo "Error: ARTIFACT_URL not set"
exit 1
fi
if [[ -z "${DATABASE_URL}" ]]; then
echo "Error: DATABASE_URL not set"
exit 1
fi
export WSGI_AUTH_CREDENTIALS="${MLFLOW_TRACKING_USERNAME}:${MLFLOW_TRACKING_PASSWORD}"
export _MLFLOW_SERVER_ARTIFACT_ROOT="${ARTIFACT_URL}"
export _MLFLOW_SERVER_FILE_STORE="${DATABASE_URL}"
# Start MLflow and ngingx using supervisor
exec mlflow server \
--host 0.0.0.0 \
--port $PORT \