【发布时间】:2020-06-05 05:47:00
【问题描述】:
我有一个像这样的 Google AppEngine Yaml 文件:
entrypoint: mlflow server \
--host 0.0.0.0 \
--workers 4 \
--backend-store-uri postgresql+psycopg2://$DB_USER:$DB_PASS@/$DB_NAME?host=/cloudsql/<project_id>:us-east1:<cloud-sql-instance> \
--default-artifact-root gs://$GCP_STORAGE_BUCKET \
--port $PORT
service: mlflow-tracking-server
runtime: python37
beta_settings:
cloud_sql_instances: <project_id>:us-east1:<cloud-sql-instance>
resources:
cpu: 4
memory_gb: 12
disk_size_gb: 60
如何用它们各自的值替换这些占位符变量?
我知道 Kubernetes,我有一个 bash 脚本可以做到这一点。
例子:
#!/usr/bin/env bash
sed "s/GCLOUD_SERVICE_KEY_ENC_REPLACE/$(printf "%s" "$GCLOUD_SERVICE_KEY_ENC"|base64)/g" mlflow_gcp_secret.yaml | \
sed "s/GCP_STORAGE_BUCKET_REPLACE/$(printf "%s" "$GCP_STORAGE_BUCKET"|base64)/g" | \
sed "s/CLOUDSQL_USER_REPLACE/$(printf "%s" "$DB_USER"|base64)/g" | \
sed "s/CLOUDSQL_PASS_REPLACE/$(printf "%s" "$DB_PASS"|base64)/g" | \
sed "s/CLOUDSQL_DB_REPLACE/$(printf "%s" "$DB_NAME"|base64)/g" | \
kubectl apply -f -
现在我想为 App Engine yaml 文件做点什么。
【问题讨论】:
标签: python bash google-app-engine google-cloud-platform yaml