Spaces:
Running
Running
steps: | |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk" | |
entrypoint: "bash" | |
id: upload-model | |
args: | |
- "-c" | |
- | | |
gcloud ai models upload \ | |
--region="us-central1" \ | |
--container-ports=8080 \ | |
--container-image-uri="us-central1-docker.pkg.dev/${PROJECT_ID}/interview-ai-detector/model-prediction:latest" \ | |
--container-predict-route="/predict" \ | |
--container-health-route="/health" \ | |
--display-name="interview-ai-detector-model" | |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk" | |
entrypoint: "bash" | |
id: create-endpoint | |
waitFor: ["upload-model"] | |
args: | |
- "-c" | |
- | | |
gcloud ai endpoints create \ | |
--region="us-central1" \ | |
--display-name="interview-ai-detector-endpoint" \ | |
--format="value(name)" | |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk" | |
entrypoint: "bash" | |
waitFor: ["create-endpoint"] | |
args: | |
- "-c" | |
- | | |
_MODEL_ID=$(gcloud ai models list --region=us-central1 --format="value(name)" | head -n 1) \ | |
_ENDPOINT_ID=$(gcloud ai endpoints list --region=us-central1 --format="value(name)" | head -n 1) \ | |
gcloud ai endpoints deploy-model $_ENDPOINT_ID \ | |
--region="us-central1" \ | |
--model=$_MODEL_ID \ | |
--display-name="interview-ai-detector-deployment" \ | |
--machine-type="n1-standard-4" \ | |
--accelerator="count=1,type=nvidia-tesla-t4" \ | |
--service-account="vertex-ai-user-managed-sa@steady-climate-416810.iam.gserviceaccount.com" | |