Skip to content

Commit a3f1ed8

Browse files
Simplify getting started with SRE Agent using a CLI that guides you through the setup (#88)
* SRE-Agent Cli * Allow user to update existing configuration * Update cli for be ux * Show diagnosis result in cli * Restructure service lifecycle commands * Temp fix for pre-commit * Fix all mypy * Fix bandit for platofrm * Fix all bandits error * Fix all bandits error again * Update docs with new service lifecycle commands * Fix mypy issues * Update everything to prepare for v0.0.1 release * Build image and push to ghcr * Pushed images * Update docker build push action version * Add comments * Add command history feature * Add progress bar for SRE agent build * fix last mypy bits * Update readme * Update readme * Remove security test workflow * Update development.md * Update development workflow * update license * Update license * Update description * Update project name * remove index stuff * Update compose file path * Fix paths * switch to interactive menus * Remove outdated docs * Auto docker compose down when exit * Auto spin up * improve config menu * add option to enable slack/firewall * fix and improve slack/firewall config * update client to use firewall if configured * update client to use slack if configured * Remove outdated CLAUDE.md file * Remove legacy compose files * Update readme * Remove redundant docs * Update compose file with GCHR images for Slack/Firewall * Update readme for config and add on * Improve readme * Revert version * PR review update --------- Co-authored-by: alanbijuthomas <[email protected]>
1 parent 33589e8 commit a3f1ed8

Some content is hidden

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

54 files changed

+5045
-1542
lines changed

.env.example

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: Build and Push Service Images
1+
name: Build and Push Core Service Images
22

33
on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'sre_agent/**'
9+
- 'pyproject.toml'
10+
- 'uv.lock'
11+
workflow_dispatch:
712

813
permissions:
9-
id-token: write
1014
contents: read
15+
packages: write
1116

1217
jobs:
1318
build-and-push:
@@ -16,51 +21,54 @@ jobs:
1621
strategy:
1722
matrix:
1823
include:
19-
- name: github
20-
context: sre_agent/
21-
dockerfile: sre_agent/servers/github/Dockerfile
2224
- name: kubernetes
2325
context: sre_agent/servers/mcp-server-kubernetes
2426
dockerfile: sre_agent/servers/mcp-server-kubernetes/Dockerfile
25-
- name: slack
27+
- name: github
2628
context: sre_agent/
27-
dockerfile: sre_agent/servers/slack/Dockerfile
28-
- name: sre-orchestrator
29+
dockerfile: sre_agent/servers/github/Dockerfile
30+
- name: prompt-server
2931
context: .
30-
dockerfile: sre_agent/client/Dockerfile
32+
dockerfile: sre_agent/servers/prompt_server/Dockerfile
3133
- name: llm-server
3234
context: .
3335
dockerfile: sre_agent/llm/Dockerfile
34-
- name: prompt-server
35-
context: .
36-
dockerfile: sre_agent/servers/prompt_server/Dockerfile
37-
- name: llama-firewall
36+
- name: orchestrator
3837
context: .
39-
dockerfile: sre_agent/firewall/Dockerfile
40-
41-
env:
42-
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
43-
AWS_REGION: ${{ secrets.AWS_REGION }}
44-
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
38+
dockerfile: sre_agent/client/Dockerfile
4539

4640
steps:
4741
- name: Checkout
48-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
4946

50-
- name: Configure AWS credentials
51-
uses: aws-actions/configure-aws-credentials@v4
47+
- name: Log in to GitHub Container Registry
48+
uses: docker/login-action@v3
5249
with:
53-
role-to-assume: ${{ env.AWS_ROLE_ARN }}
54-
aws-region: ${{ env.AWS_REGION }}
50+
registry: ghcr.io
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
5553

56-
- name: Login to Amazon ECR
57-
id: login-ecr
58-
uses: aws-actions/amazon-ecr-login@v2
54+
- name: Extract metadata
55+
id: meta
56+
uses: docker/metadata-action@v5
57+
with:
58+
images: ghcr.io/${{ github.repository_owner }}/sre-agent-${{ matrix.name }}
59+
tags: |
60+
type=ref,event=branch
61+
type=ref,event=pr
62+
type=sha,prefix={{branch}}-
63+
type=raw,value=latest,enable={{is_default_branch}}
5964
6065
- name: Build and Push ${{ matrix.name }}
6166
uses: docker/build-push-action@v6
6267
with:
6368
context: ${{ matrix.context }}
6469
file: ${{ matrix.dockerfile }}
6570
push: true
66-
tags: ${{ steps.login-ecr.outputs.registry }}/mcp/${{ matrix.name }}:latest
71+
tags: ${{ steps.meta.outputs.tags }}
72+
labels: ${{ steps.meta.outputs.labels }}
73+
cache-from: type=gha
74+
cache-to: type=gha,mode=max

.github/workflows/ci.yml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -74,41 +74,42 @@ jobs:
7474
run: |
7575
uv run pytest tests/unit_tests
7676
77-
security_tests:
78-
name: Security Tests
79-
runs-on: ubuntu-latest
80-
81-
steps:
82-
- name: Checkout
83-
uses: actions/checkout@v3
84-
85-
- name: Set up Docker Buildx
86-
uses: docker/setup-buildx-action@v3
87-
88-
- name: Set up Docker Compose
89-
run: |
90-
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
91-
sudo chmod +x /usr/local/bin/docker-compose
92-
93-
- name: Deploy Agent
94-
run: HF_TOKEN=${{ secrets.HF_TOKEN }} docker compose -f compose.tests.yaml up -d --build
95-
96-
- name: Setup Python
97-
uses: actions/setup-python@v4
98-
with:
99-
python-version: 3.12
100-
101-
- name: Install the latest version of uv
102-
uses: astral-sh/setup-uv@v5
103-
with:
104-
enable-cache: true
105-
cache-dependency-glob: ".pre-commit-config.yaml"
106-
107-
- name: Install dependencies
108-
run: |
109-
uv sync --group ci
110-
alias pip="uv pip" # T
111-
112-
- name: Run Security Tests
113-
run: |
114-
uv run pytest tests/security_tests
77+
# Llama firewall is not yet supported
78+
# security_tests:
79+
# name: Security Tests
80+
# runs-on: ubuntu-latest
81+
82+
# steps:
83+
# - name: Checkout
84+
# uses: actions/checkout@v3
85+
86+
# - name: Set up Docker Buildx
87+
# uses: docker/setup-buildx-action@v3
88+
89+
# - name: Set up Docker Compose
90+
# run: |
91+
# sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
92+
# sudo chmod +x /usr/local/bin/docker-compose
93+
94+
# - name: Deploy Agent
95+
# run: HF_TOKEN=${{ secrets.HF_TOKEN }} docker compose -f compose.tests.yaml up -d --build
96+
97+
# - name: Setup Python
98+
# uses: actions/setup-python@v4
99+
# with:
100+
# python-version: 3.12
101+
102+
# - name: Install the latest version of uv
103+
# uses: astral-sh/setup-uv@v5
104+
# with:
105+
# enable-cache: true
106+
# cache-dependency-glob: ".pre-commit-config.yaml"
107+
108+
# - name: Install dependencies
109+
# run: |
110+
# uv sync --group ci
111+
# alias pip="uv pip" # T
112+
113+
# - name: Run Security Tests
114+
# run: |
115+
# uv run pytest tests/security_tests

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ repos:
3131
- id: ruff
3232
args: [--fix, --exit-non-zero-on-fix, "--config=pyproject.toml"] # enable autofix
3333

34-
- repo: https://github.com/pre-commit/mirrors-mypy
35-
rev: v1.6.1
34+
- repo: local
3635
hooks:
3736
- id: mypy
37+
name: mypy
38+
entry: mypy
3839
language: system
39-
args: ["--config-file=pyproject.toml", "--follow-untyped-imports"]
40-
exclude: ^tests/
40+
types: [python]
41+
args: ["--config-file=pyproject.toml", "--ignore-missing-imports"]
42+
exclude: '.*__init__\.py|tests'
4143

4244
- repo: https://github.com/crate-ci/typos
4345
rev: v1.32.0

0 commit comments

Comments
 (0)