Skip to content

Commit 4f4da44

Browse files
stuaganocharmcrush
andcommitted
refactor: Consolidate agents and remove mock data
This commit refactors the security agent by merging the functionality of `enhanced_agent.py` into `agent.py`, creating a single, comprehensive agent. Key changes: - Merged API Hub, dependency analysis, and risk propagation tools into the main agent. - Removed mock data fallbacks from `frontend/enhanced_security_agent_app.py` and `backend/api/gcp.py` to ensure robust error handling. - Stabilized the `run.sh` script by removing the `--reload` flag and improving the Streamlit command. - Deleted the redundant `agents/enhanced_agent.py`. These changes improve maintainability and align the application with the "no mock data" core principle. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
1 parent edcc4d2 commit 4f4da44

49 files changed

Lines changed: 2313 additions & 35438 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ wheels/
7676
*.log
7777
logs/
7878
log/
79+
src/google/adk/a2a/logs/
80+
7981

8082
# Local development settings
8183
.env.local
@@ -98,3 +100,10 @@ Thumbs.db
98100
*.bak
99101
*.tmp
100102
*.temp
103+
.crush/
104+
105+
# Media files
106+
*.png
107+
*.pdf
108+
109+

contributing/samples/personal_assistant_agent/cloudbuild.yaml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,26 +209,4 @@ substitutions:
209209

210210
# Images to be pushed
211211
images:
212-
- '${_AR_IMAGE}'
213-
214-
# Build triggers configuration
215-
# This section is used when setting up automated triggers
216-
# but is not processed during manual builds
217-
trigger:
218-
name: 'personal-assistant-agent-trigger'
219-
description: 'Automated deployment trigger for Personal Assistant Agent'
220-
github:
221-
owner: 'your-username'
222-
name: 'your-repo-name'
223-
push:
224-
branch: '^main$'
225-
substitutions:
226-
_REGION: 'us-central1'
227-
_SERVICE_NAME: 'personal-assistant-agent'
228-
_ENVIRONMENT: 'production'
229-
includedFiles:
230-
- 'ADK/contributing/samples/personal_assistant_agent/**'
231-
ignoredFiles:
232-
- '**/*.md'
233-
- '**/README.md'
234-
- '**/*.txt'
212+
- '${_AR_IMAGE}'

contributing/samples/security_agent/.cursorrules

Lines changed: 0 additions & 186 deletions
This file was deleted.

contributing/samples/security_agent/.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ coverage.xml
5050
*.py,cover
5151
.hypothesis/
5252
.pytest_cache/
53+
.streamlit/
5354

5455
# Distribution / packaging
5556
.Python
@@ -82,6 +83,10 @@ log/
8283
.env.development.local
8384
.env.test.local
8485
.env.production.local
86+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/CLAUDE.md
87+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/run.log
88+
.cursorrules
89+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/=1.31.0
8590

8691
# Google Cloud specific
8792
.gcloudignore
@@ -96,4 +101,5 @@ site/
96101
Thumbs.db
97102
*.bak
98103
*.tmp
99-
*.temp
104+
*.temp
105+
.crush/
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Multi-stage build for optimized backend container
2+
FROM python:3.11-slim as builder
3+
4+
# Install system dependencies
5+
RUN apt-get update && apt-get install -y \
6+
gcc \
7+
g++ \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
WORKDIR /app
11+
12+
# Copy requirements and install dependencies
13+
COPY requirements.txt .
14+
RUN pip install --user --no-cache-dir -r requirements.txt
15+
16+
# Production stage
17+
FROM python:3.11-slim
18+
19+
# Install system dependencies for runtime
20+
RUN apt-get update && apt-get install -y \
21+
curl \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
WORKDIR /app
25+
26+
# Copy installed packages from builder stage
27+
COPY --from=builder /root/.local /root/.local
28+
29+
# Make sure scripts in .local are usable
30+
ENV PATH=/root/.local/bin:$PATH
31+
32+
# Copy application code
33+
COPY backend/ ./backend/
34+
COPY agents/ ./agents/
35+
COPY .env .env
36+
37+
# Set environment variables for Vertex AI
38+
ENV GOOGLE_CLOUD_PROJECT=mgm-digitalconcierge
39+
ENV GOOGLE_CLOUD_LOCATION=us-central1
40+
ENV PYTHONPATH=/app
41+
42+
# Expose port
43+
EXPOSE 8000
44+
45+
# Health check
46+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
47+
CMD curl -f http://localhost:8000/health || exit 1
48+
49+
# Run the application
50+
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Multi-stage build for optimized frontend container
2+
FROM python:3.11-slim as builder
3+
4+
# Install system dependencies
5+
RUN apt-get update && apt-get install -y \
6+
gcc \
7+
g++ \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
WORKDIR /app
11+
12+
# Copy requirements and install dependencies
13+
COPY requirements.txt .
14+
RUN pip install --user --no-cache-dir -r requirements.txt
15+
16+
# Production stage
17+
FROM python:3.11-slim
18+
19+
# Install system dependencies for runtime
20+
RUN apt-get update && apt-get install -y \
21+
curl \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
WORKDIR /app
25+
26+
# Copy installed packages from builder stage
27+
COPY --from=builder /root/.local /root/.local
28+
29+
# Make sure scripts in .local are usable
30+
ENV PATH=/root/.local/bin:$PATH
31+
32+
# Copy application code
33+
COPY frontend/ ./frontend/
34+
COPY .env .env
35+
36+
# Set environment variables
37+
ENV GOOGLE_CLOUD_PROJECT=mgm-digitalconcierge
38+
ENV GOOGLE_CLOUD_LOCATION=us-central1
39+
ENV BACKEND_URL=https://security-agent-backend-xxx-uc.a.run.app
40+
41+
# Expose port
42+
EXPOSE 8501
43+
44+
# Health check
45+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
46+
CMD curl -f http://localhost:8501/_stcore/health || exit 1
47+
48+
# Run the application
49+
CMD ["streamlit", "run", "frontend/enhanced_security_agent_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

0 commit comments

Comments
 (0)