-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcp_command.sh
18 lines (13 loc) · 1.19 KB
/
gcp_command.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format='value(projectNumber)')
gcloud artifacts repositories create aomori --repository-format=docker --location=asia-southeast1 --description="FastAPI Skeleton"
gcloud builds submit --region=asia-southeast1 --tag asia-southeast1-docker.pkg.dev/jakartaresearch/aomori/aomori:latest
gcloud projects add-iam-policy-binding $PROJECT_ID --member=serviceAccount:[email protected] --role=roles/run.admin
gcloud iam service-accounts add-iam-policy-binding \
--member=serviceAccount:[email protected] \
--role=roles/iam.serviceAccountUser
gcloud run deploy aomori --image asia-southeast1-docker.pkg.dev/jakartaresearch/aomori/aomori:latest --region asia-southeast1 --platform managed \
--args aomori.main:app,--host,0.0.0.0,--port,8080 --cpu 1 --memory 256Mi --timeout 300 --concurrency 100 \
--set-env-vars IS_DEBUG=False,API_KEY=1103371a-e057-4874-b5b9-e96417c711f3,DEFAULT_MODEL_PATH=./sample_model/lin_reg_california_housing_model.joblib \
--allow-unauthenticated