Skip to content

Commit f4655e9

Browse files
committed
docs: Add OS-specific instructions and troubleshooting guide
1 parent 673ea2a commit f4655e9

2 files changed

Lines changed: 56 additions & 10 deletions

File tree

contributing/samples/security_agent/README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,59 @@ VERTEX_AI_PROJECT_ID="your-project-id"
130130
VERTEX_AI_LOCATION="us-central1"
131131
```
132132

133-
## 🚀 Deployment Options
133+
## 🚀 Getting Started
134134

135-
### Local Development
135+
### Prerequisites
136+
- **Docker:** Make sure Docker is installed and running on your system. You can download it from [the Docker website](https://www.docker.com/get-started).
137+
138+
### 1. Clone the Repository
139+
```bash
140+
git clone https://github.com/google/adk-python.git
141+
cd adk-python/contributing/samples/security_agent
142+
```
143+
144+
### 2. Configure Environment Variables
145+
Create a file named `.env` and add the following, replacing the placeholder values with your own:
146+
```bash
147+
# Google Cloud Configuration
148+
GOOGLE_CLOUD_PROJECT="your-project-id"
149+
GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account.json"
150+
151+
# ADK Configuration
152+
ADK_EVALUATION_ENABLED="true"
153+
154+
# Vertex AI Configuration (for enterprise features)
155+
VERTEX_AI_PROJECT_ID="your-project-id"
156+
VERTEX_AI_LOCATION="us-central1"
157+
```
158+
159+
### 3. Run the Agent
136160
```bash
137161
./run.sh
138162
```
163+
This script will build the Docker image and start the agent.
164+
165+
### 4. Access the Agent
166+
- **Frontend:** [http://localhost:8501](http://localhost:8501)
167+
- **Backend API Docs:** [http://localhost:8000/docs](http://localhost:8000/docs)
139168

140-
### Google Cloud Run
169+
## troubleshooting
170+
171+
### Docker Daemon Not Running
172+
If you see an error message like "Cannot connect to the Docker daemon", make sure the Docker daemon is running.
173+
174+
- **macOS:** Open the Docker Desktop application.
175+
- **Windows:** Open the Docker Desktop application.
176+
- **Linux:** Run `sudo systemctl start docker`.
177+
178+
### Port Conflicts
179+
If you see an error message like "Port is already allocated", it means that another application is using port 8000 or 8501. You can either stop the other application or change the ports in the `docker-compose.yml` file.
180+
181+
### Issues with `gcloud`
182+
If you have issues with `gcloud` commands, make sure you have the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) installed and authenticated:
141183
```bash
142-
# Deploy to Cloud Run
143-
gcloud run deploy security-agent \
144-
--source . \
145-
--platform managed \
146-
--region us-central1 \
147-
--allow-unauthenticated
184+
gcloud auth login
185+
gcloud auth application-default login
148186
```
149187

188+

contributing/samples/security_agent/run.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ check_docker() {
4545
print_status "Please install Docker from https://www.docker.com/get-started"
4646
exit 1
4747
fi
48-
print_success "Docker is available"
48+
49+
if ! docker info > /dev/null 2>&1; then
50+
print_error "Docker daemon is not running"
51+
print_status "Please start the Docker daemon and try again"
52+
exit 1
53+
fi
54+
print_success "Docker is available and running"
4955
}
5056

57+
5158
# Function to build the Docker image
5259
build_docker_image() {
5360
print_status "Building Docker image..."

0 commit comments

Comments
 (0)