File size: 2,052 Bytes
162c75a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
76
# Fix GCP Permissions for Deployment

## Current Issue

Your account (`jameswilsonlearnsrocode@gmail.com`) needs permissions on project `spherical-gate-477614-q7`.

## Required Permissions

You need one of these roles on the project:
- **Editor** (recommended) - Full access except billing/admin
- **Owner** - Full access including billing
- Or these specific roles:
  - `roles/cloudbuild.builds.editor`
  - `roles/run.admin`
  - `roles/serviceusage.serviceUsageConsumer`
  - `roles/storage.admin`

## Steps to Fix

### Step 1: Grant Permissions

1. Visit: https://console.cloud.google.com/iam-admin/iam/project?project=spherical-gate-477614-q7
2. Click **"Grant Access"** or **"Add Principal"**
3. Enter your email: `jameswilsonlearnsrocode@gmail.com`
4. Select role: **Editor** (or **Owner**)
5. Click **Save**
6. **Wait 2-3 minutes** for permissions to propagate

### Step 2: Enable APIs

After permissions are granted, run:

```bash
gcloud config set project spherical-gate-477614-q7
gcloud services enable cloudbuild.googleapis.com run.googleapis.com containerregistry.googleapis.com
```

### Step 3: Deploy

```bash
cd Milestone-6/router-agent/zero-gpu-space
export GCP_PROJECT_ID="spherical-gate-477614-q7"
./deploy-cloud-build.sh
```

## Alternative: Use Service Account

If you can't get user permissions, create a service account:

```bash
# Create service account
gcloud iam service-accounts create router-agent-deploy \
    --display-name="Router Agent Deployment" \
    --project=spherical-gate-477614-q7

# Grant permissions
gcloud projects add-iam-policy-binding spherical-gate-477614-q7 \
    --member="serviceAccount:router-agent-deploy@spherical-gate-477614-q7.iam.gserviceaccount.com" \
    --role="roles/editor"

# Use service account
gcloud auth activate-service-account router-agent-deploy@spherical-gate-477614-q7.iam.gserviceaccount.com \
    --key-file=path/to/key.json
```

## Quick Test

Test if permissions are working:

```bash
gcloud projects describe spherical-gate-477614-q7
```

If this works, you're ready to deploy!