-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_google_cloud.sh
More file actions
executable file
·75 lines (60 loc) · 2.56 KB
/
Copy pathsetup_google_cloud.sh
File metadata and controls
executable file
·75 lines (60 loc) · 2.56 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
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Google Cloud Setup Script for Startup Analyst Platform
echo "🚀 Setting up Google Cloud services for Startup Analyst Platform..."
# Set project ID
PROJECT_ID="startup-analyst-platform"
echo "📋 Project ID: $PROJECT_ID"
# Set default project
gcloud config set project $PROJECT_ID
echo "🔧 Enabling required Google Cloud APIs..."
# Enable required APIs
gcloud services enable aiplatform.googleapis.com
gcloud services enable firestore.googleapis.com
gcloud services enable run.googleapis.com
gcloud services enable cloudbuild.googleapis.com
gcloud services enable containerregistry.googleapis.com
gcloud services enable logging.googleapis.com
gcloud services enable monitoring.googleapis.com
gcloud services enable storage.googleapis.com
echo "✅ APIs enabled successfully"
# Set up Vertex AI
echo "🤖 Setting up Vertex AI..."
gcloud ai models list --region=us-central1
# Set up Firestore
echo "🔥 Setting up Firestore..."
gcloud firestore databases create --region=us-central1
# Set up Cloud Storage bucket
echo "💾 Setting up Cloud Storage..."
gsutil mb gs://$PROJECT_ID-startup-analyst-data
# Set up service account
echo "🔐 Setting up service account..."
gcloud iam service-accounts create startup-analyst-sa \
--display-name="Startup Analyst Service Account" \
--description="Service account for Startup Analyst Platform"
# Grant necessary permissions
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:startup-analyst-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:startup-analyst-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/datastore.user"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:startup-analyst-sa@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/storage.objectAdmin"
# Create and download service account key
echo "🔑 Creating service account key..."
gcloud iam service-accounts keys create service-account-key.json \
--iam-account=startup-analyst-sa@$PROJECT_ID.iam.gserviceaccount.com
echo "✅ Google Cloud setup completed!"
echo ""
echo "📝 Next steps:"
echo "1. Set GOOGLE_APPLICATION_CREDENTIALS environment variable:"
echo " export GOOGLE_APPLICATION_CREDENTIALS=\$(pwd)/service-account-key.json"
echo ""
echo "2. Test the setup:"
echo " python3 test_gemini.py"
echo ""
echo "3. Deploy the application:"
echo " gcloud run deploy startup-analyst --source ."
echo ""
echo "🎉 Your Google Cloud environment is ready for the hackathon!"