Skip to content

Commit 5741bbd

Browse files
Initial release: UnitOne AgentGateway
UnitOne's wrapper around the AgentGateway project, providing: - WASM-based Python security guards for MCP protocol - Server Spoofing & Whitelisting Guard implementation - Terraform infrastructure for Azure deployment - Multi-scope configuration support - MIT License The agentgateway submodule contains the WASM guard runtime framework.
0 parents  commit 5741bbd

104 files changed

Lines changed: 19266 additions & 0 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Rust build artifacts
2+
agentgateway/target/
3+
**/target/
4+
# Exception: Allow pre-built binary for Docker image
5+
!agentgateway/target/release/agentgateway
6+
7+
# Git directories
8+
.git/
9+
**/.git/
10+
11+
# IDE directories
12+
.vscode/
13+
.idea/
14+
**/.vscode/
15+
**/.idea/
16+
17+
# Temporary files
18+
*.tmp
19+
*.log
20+
**/*.tmp
21+
**/*.log
22+
23+
# Node modules
24+
node_modules/
25+
**/node_modules/
26+
27+
# Next.js build artifacts
28+
.next/
29+
**/.next/
30+
out/
31+
**/out/
32+
# Exception: Allow UI build output for Docker image
33+
!agentgateway/ui/out/
34+
35+
# Test artifacts
36+
test-results/
37+
coverage/
38+
39+
# Documentation and README files (not needed in builds)
40+
*.md
41+
docs/
42+
documentation/
43+
44+
# CI/CD configurations
45+
.github/
46+
.gitlab-ci.yml
47+
azure-pipelines.yml
48+
.circleci/
49+
50+
# Scripts (deploy scripts not needed in image)
51+
scripts/
52+
*.sh
53+
# Exception: Allow entrypoint script for Docker image
54+
!entrypoint.sh
55+
56+
# Examples and test code
57+
examples/
58+
**/examples/
59+
tests/
60+
**/tests/
61+
62+
# Environment files
63+
.env
64+
.env.*
65+
*.env
66+
67+
# macOS files
68+
.DS_Store
69+
70+
# Build logs
71+
*.log
72+
**/*.log
73+
/tmp/
74+
75+
# Lock files (except Cargo.lock which is needed)
76+
!Cargo.lock
77+
!agentgateway/Cargo.lock
78+
package-lock.json
79+
80+
# Terraform
81+
terraform/
82+
*.tf
83+
*.tfvars
84+
85+
# Docker files (not needed inside container)
86+
Dockerfile*
87+
.dockerignore
88+
89+
# Git files
90+
.gitignore
91+
.gitattributes
92+
.gitmodules

.github/REBUILD_TRIGGER.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Trigger rebuild with health probe fix

.github/workflows/azure-deploy.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# UnitOne AgentGateway - Azure Deployment Workflow
2+
#
3+
# This workflow:
4+
# 1. Runs local tests on push/PR (no Azure required)
5+
# 2. Builds and deploys to Azure Container Apps (requires secrets)
6+
#
7+
# Required GitHub Secrets (for deployment):
8+
# - AZURE_CREDENTIALS: Azure service principal credentials (JSON)
9+
# - ACR_NAME: Your Azure Container Registry name (e.g., myacr)
10+
# - RESOURCE_GROUP: Your Azure resource group name
11+
# - CONTAINER_APP_NAME: Your Container App name
12+
13+
name: CI/CD
14+
15+
on:
16+
push:
17+
branches:
18+
- main
19+
pull_request:
20+
branches:
21+
- main
22+
workflow_dispatch:
23+
inputs:
24+
environment:
25+
description: 'Environment to deploy to'
26+
required: true
27+
default: 'dev'
28+
type: choice
29+
options:
30+
- dev
31+
- staging
32+
- prod
33+
34+
jobs:
35+
# Basic validation - always runs, no secrets needed
36+
validate:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout repository with submodules
40+
uses: actions/checkout@v4
41+
with:
42+
submodules: 'recursive'
43+
44+
- name: Validate Dockerfile
45+
run: |
46+
echo "Checking Dockerfile.acr exists..."
47+
test -f Dockerfile.acr
48+
echo "✓ Dockerfile.acr found"
49+
50+
- name: Validate config files
51+
run: |
52+
echo "Checking config files..."
53+
test -f azure-config.yaml
54+
echo "✓ azure-config.yaml found"
55+
test -f terraform/main.tf
56+
echo "✓ terraform/main.tf found"
57+
58+
- name: Check submodule
59+
run: |
60+
echo "Checking agentgateway submodule..."
61+
test -f agentgateway/Cargo.toml
62+
echo "✓ Submodule initialized correctly"
63+
64+
# Azure deployment - only runs if secrets are configured
65+
build-and-deploy:
66+
runs-on: ubuntu-latest
67+
needs: [validate]
68+
# Only run on push to main or workflow_dispatch, and only if secrets exist
69+
if: |
70+
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
71+
github.event_name == 'workflow_dispatch'
72+
73+
steps:
74+
- name: Check if Azure secrets are configured
75+
id: check-secrets
76+
run: |
77+
if [ -n "${{ secrets.AZURE_CREDENTIALS }}" ] && [ -n "${{ secrets.ACR_NAME }}" ]; then
78+
echo "has_secrets=true" >> $GITHUB_OUTPUT
79+
else
80+
echo "has_secrets=false" >> $GITHUB_OUTPUT
81+
echo "⚠️ Azure secrets not configured - skipping deployment"
82+
echo "To enable deployment, configure these repository secrets:"
83+
echo " - AZURE_CREDENTIALS"
84+
echo " - ACR_NAME"
85+
echo " - RESOURCE_GROUP"
86+
echo " - CONTAINER_APP_NAME"
87+
fi
88+
89+
- name: Checkout repository with submodules
90+
if: steps.check-secrets.outputs.has_secrets == 'true'
91+
uses: actions/checkout@v4
92+
with:
93+
submodules: 'recursive'
94+
fetch-depth: 0
95+
96+
- name: Determine environment and tag
97+
if: steps.check-secrets.outputs.has_secrets == 'true'
98+
id: config
99+
run: |
100+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
101+
ENV="${{ inputs.environment }}"
102+
else
103+
ENV="dev"
104+
fi
105+
106+
TAG="${{ github.sha }}"
107+
SHORT_SHA=$(echo ${TAG} | cut -c1-7)
108+
109+
echo "environment=${ENV}" >> $GITHUB_OUTPUT
110+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
111+
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
112+
113+
- name: Azure Login
114+
if: steps.check-secrets.outputs.has_secrets == 'true'
115+
uses: azure/login@v1
116+
with:
117+
creds: ${{ secrets.AZURE_CREDENTIALS }}
118+
119+
- name: Build and push Docker image to ACR
120+
if: steps.check-secrets.outputs.has_secrets == 'true'
121+
run: |
122+
az acr build \
123+
--registry ${{ secrets.ACR_NAME }} \
124+
--image unitone-agentgateway:${{ steps.config.outputs.short_sha }} \
125+
--image unitone-agentgateway:latest \
126+
--file Dockerfile.acr \
127+
--platform linux/amd64 \
128+
.
129+
130+
- name: Deploy to Azure Container App
131+
if: steps.check-secrets.outputs.has_secrets == 'true'
132+
run: |
133+
az containerapp update \
134+
--name ${{ secrets.CONTAINER_APP_NAME }} \
135+
--resource-group ${{ secrets.RESOURCE_GROUP }} \
136+
--image ${{ secrets.ACR_NAME }}.azurecr.io/unitone-agentgateway:${{ steps.config.outputs.short_sha }}
137+
138+
- name: Verify deployment
139+
if: steps.check-secrets.outputs.has_secrets == 'true'
140+
run: |
141+
sleep 30
142+
143+
STATUS=$(az containerapp show \
144+
--name ${{ secrets.CONTAINER_APP_NAME }} \
145+
--resource-group ${{ secrets.RESOURCE_GROUP }} \
146+
--query properties.runningStatus \
147+
-o tsv)
148+
149+
if [ "$STATUS" != "Running" ]; then
150+
echo "Deployment failed: status is $STATUS"
151+
exit 1
152+
fi
153+
154+
URL=$(az containerapp show \
155+
--name ${{ secrets.CONTAINER_APP_NAME }} \
156+
--resource-group ${{ secrets.RESOURCE_GROUP }} \
157+
--query properties.configuration.ingress.fqdn \
158+
-o tsv)
159+
160+
echo "Deployment successful!"
161+
echo "UI URL: https://${URL}/ui"
162+
echo "MCP Endpoint: https://${URL}/mcp"

0 commit comments

Comments
 (0)