-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
62 lines (56 loc) · 1.59 KB
/
deploy.sh
File metadata and controls
62 lines (56 loc) · 1.59 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
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Deploy Weber electrodynamics simulation to Google Cloud Run with GPU
#
# Prerequisites:
# - gcloud CLI authenticated
# - Docker or Cloud Build access
# - Project: gnosis-459403
set -e
PROJECT_ID="gnosis-459403"
REGION="us-central1"
SERVICE_NAME="weber-sim"
IMAGE="gcr.io/${PROJECT_ID}/${SERVICE_NAME}"
echo "=== Weber Electrodynamics — Cloud Run GPU Deployment ==="
echo " Project: ${PROJECT_ID}"
echo " Region: ${REGION}"
echo " Service: ${SERVICE_NAME}"
echo " Image: ${IMAGE}"
echo
# Build with Cloud Build (has access to GPU-capable build machines)
echo ">>> Submitting build to Cloud Build..."
gcloud builds submit \
--project "${PROJECT_ID}" \
--tag "${IMAGE}" \
--timeout=1800 \
--machine-type=e2-highcpu-8 \
.
echo
echo ">>> Deploying to Cloud Run with GPU..."
gcloud run deploy "${SERVICE_NAME}" \
--project "${PROJECT_ID}" \
--region "${REGION}" \
--image "${IMAGE}" \
--execution-environment gen2 \
--gpu 1 \
--gpu-type nvidia-l4 \
--memory 32Gi \
--cpu 8 \
--timeout 3600 \
--concurrency 1 \
--min-instances 0 \
--max-instances 1 \
--port 8080 \
--allow-unauthenticated \
--set-env-vars "CUDA_VISIBLE_DEVICES=0"
echo
echo ">>> Deployment complete."
SERVICE_URL=$(gcloud run services describe "${SERVICE_NAME}" \
--project "${PROJECT_ID}" \
--region "${REGION}" \
--format "value(status.url)")
echo " URL: ${SERVICE_URL}"
echo
echo "Test:"
echo " curl ${SERVICE_URL}/health"
echo " curl ${SERVICE_URL}/reference"
echo " curl -X POST ${SERVICE_URL}/run -H 'Content-Type: application/json' -d '{\"binary\":\"brake-recoil\"}'"