Spaces:
Sleeping
Sleeping
Commit
·
585662b
1
Parent(s):
358e4c4
fix: timeout seconds and format
Browse files- cloudbuild-endpoint.yaml +14 -5
cloudbuild-endpoint.yaml
CHANGED
|
@@ -2,24 +2,33 @@ steps:
|
|
| 2 |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
|
| 3 |
entrypoint: "bash"
|
| 4 |
id: upload-model
|
| 5 |
-
timeout:
|
| 6 |
args:
|
| 7 |
- "-c"
|
| 8 |
- |
|
| 9 |
-
|
| 10 |
--region="us-central1" \
|
| 11 |
--container-ports=8080 \
|
| 12 |
--container-image-uri="us-central1-docker.pkg.dev/${PROJECT_ID}/interview-ai-detector/model-prediction:latest" \
|
| 13 |
--container-predict-route="/predict" \
|
| 14 |
--container-health-route="/health" \
|
| 15 |
-
--display-name="interview-ai-detector-model"
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
echo MODEL_ID > /workspace/model_id.txt
|
| 18 |
|
| 19 |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
|
| 20 |
entrypoint: "bash"
|
| 21 |
id: create-endpoint
|
| 22 |
-
waitFor:
|
| 23 |
args:
|
| 24 |
- "-c"
|
| 25 |
- |
|
|
|
|
| 2 |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
|
| 3 |
entrypoint: "bash"
|
| 4 |
id: upload-model
|
| 5 |
+
timeout: 600s
|
| 6 |
args:
|
| 7 |
- "-c"
|
| 8 |
- |
|
| 9 |
+
gcloud ai models upload \
|
| 10 |
--region="us-central1" \
|
| 11 |
--container-ports=8080 \
|
| 12 |
--container-image-uri="us-central1-docker.pkg.dev/${PROJECT_ID}/interview-ai-detector/model-prediction:latest" \
|
| 13 |
--container-predict-route="/predict" \
|
| 14 |
--container-health-route="/health" \
|
| 15 |
+
--display-name="interview-ai-detector-model"
|
| 16 |
+
|
| 17 |
+
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
|
| 18 |
+
entrypoint: "bash"
|
| 19 |
+
id: fetch-model
|
| 20 |
+
waitFor: upload-model
|
| 21 |
+
timeout: 600s
|
| 22 |
+
args:
|
| 23 |
+
- "-c"
|
| 24 |
+
- |
|
| 25 |
+
MODEL_ID=$(gcloud ai models list --region=us-central1 --format="value(name)" | head -n 1)
|
| 26 |
echo MODEL_ID > /workspace/model_id.txt
|
| 27 |
|
| 28 |
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
|
| 29 |
entrypoint: "bash"
|
| 30 |
id: create-endpoint
|
| 31 |
+
waitFor: fetch-model
|
| 32 |
args:
|
| 33 |
- "-c"
|
| 34 |
- |
|