Skip to content

Commit 1122e1f

Browse files
authored
Merge pull request #40 from lbarcziova/compose-refactor
Split into 3-container agent architecture for local development
2 parents 0c31de9 + 72b7b06 commit 1122e1f

File tree

4 files changed

+113
-79
lines changed

4 files changed

+113
-79
lines changed

beeai/Makefile

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,19 @@ COMPOSE ?= $(shell command -v podman >/dev/null 2>&1 && echo "podman compose" ||
77
build:
88
$(COMPOSE) -f $(COMPOSE_FILE) build
99

10-
.PHONY: start-mcp
11-
start-mcp:
12-
$(COMPOSE) -f $(COMPOSE_FILE) up -d mcp-atlassian
13-
14-
.PHONY: stop-mcp
15-
stop-mcp:
16-
$(COMPOSE) -f $(COMPOSE_FILE) stop mcp-atlassian
17-
18-
.PHONY: start-valkey
19-
start-valkey:
20-
$(COMPOSE) -f $(COMPOSE_FILE) up -d valkey
21-
22-
.PHONY: stop-valkey
23-
stop-valkey:
24-
$(COMPOSE) -f $(COMPOSE_FILE) stop valkey
25-
26-
.PHONY: start-phoenix
27-
start-phoenix:
28-
$(COMPOSE) -f $(COMPOSE_FILE) up -d phoenix
29-
30-
.PHONY: stop-phoenix
31-
stop-phoenix:
32-
$(COMPOSE) -f $(COMPOSE_FILE) stop phoenix
3310

3411
.PHONY: run-beeai-bash
3512
run-beeai-bash:
36-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm beeai-agent /bin/bash
13+
$(COMPOSE) -f $(COMPOSE_FILE) run --rm triage-agent /bin/bash
3714

3815
.PHONY: run-triage-agent-standalone
3916
run-triage-agent-standalone:
4017
$(COMPOSE) -f $(COMPOSE_FILE) run --rm \
4118
-e JIRA_ISSUE=$(JIRA_ISSUE) \
42-
beeai-agent /usr/bin/python agents/triage_agent.py
19+
triage-agent
20+
4321

44-
.PHONY: run-triage-agent
45-
run-triage-agent:
46-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm \
47-
beeai-agent /usr/bin/python agents/triage_agent.py
4822

49-
.PHONY: run-triage-agent-detached
50-
run-triage-agent-detached:
51-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm --detach \
52-
beeai-agent /usr/bin/python agents/triage_agent.py
5323

5424
.PHONY: run-rebase-agent-standalone
5525
run-rebase-agent-standalone:
@@ -58,17 +28,11 @@ run-rebase-agent-standalone:
5828
-e VERSION=$(VERSION) \
5929
-e JIRA_ISSUE=$(JIRA_ISSUE) \
6030
-e BRANCH=$(BRANCH) \
61-
beeai-agent /usr/bin/python agents/rebase_agent.py
31+
rebase-agent
32+
33+
6234

63-
.PHONY: run-rebase-agent
64-
run-rebase-agent:
65-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm \
66-
beeai-agent /usr/bin/python agents/rebase_agent.py
6735

68-
.PHONY: run-rebase-agent-detached
69-
run-rebase-agent-detached:
70-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm --detach \
71-
beeai-agent /usr/bin/python agents/rebase_agent.py
7236

7337
.PHONY: run-backport-agent-standalone
7438
run-backport-agent-standalone:
@@ -77,17 +41,57 @@ run-backport-agent-standalone:
7741
-e UPSTREAM_FIX=$(UPSTREAM_FIX) \
7842
-e JIRA_ISSUE=$(JIRA_ISSUE) \
7943
-e BRANCH=$(BRANCH) \
80-
beeai-agent /usr/bin/python agents/backport_agent.py
44+
backport-agent
8145

82-
.PHONY: run-backport-agent
83-
run-backport-agent:
84-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm \
85-
beeai-agent /usr/bin/python agents/backport_agent.py
8646

87-
.PHONY: run-backport-agent-detached
88-
run-backport-agent-detached:
89-
$(COMPOSE) -f $(COMPOSE_FILE) run --rm --detach \
90-
beeai-agent /usr/bin/python agents/backport_agent.py
47+
48+
49+
50+
# Essential 3-Agent Architecture Targets
51+
52+
.PHONY: start
53+
start:
54+
$(COMPOSE) -f $(COMPOSE_FILE) up
55+
56+
.PHONY: start-detached
57+
start-detached:
58+
$(COMPOSE) -f $(COMPOSE_FILE) up -d
59+
60+
.PHONY: stop
61+
stop:
62+
$(COMPOSE) -f $(COMPOSE_FILE) down
63+
64+
65+
66+
.PHONY: logs-triage
67+
logs-triage:
68+
$(COMPOSE) -f $(COMPOSE_FILE) logs -f triage-agent
69+
70+
.PHONY: logs-backport
71+
logs-backport:
72+
$(COMPOSE) -f $(COMPOSE_FILE) logs -f backport-agent
73+
74+
.PHONY: logs-rebase
75+
logs-rebase:
76+
$(COMPOSE) -f $(COMPOSE_FILE) logs -f rebase-agent
77+
78+
.PHONY: status
79+
status:
80+
$(COMPOSE) -f $(COMPOSE_FILE) ps
81+
82+
.PHONY: trigger-pipeline
83+
trigger-pipeline:
84+
@if [ -z "$(JIRA_ISSUE)" ]; then \
85+
echo "Usage: make trigger-pipeline JIRA_ISSUE=RHEL-12345"; \
86+
exit 1; \
87+
fi
88+
@echo "Triggering pipeline for issue: $(JIRA_ISSUE)"
89+
$(COMPOSE) -f $(COMPOSE_FILE) exec valkey redis-cli LPUSH triage_queue '{"metadata": {"issue": "$(JIRA_ISSUE)"}}'
90+
91+
.PHONY: redis-cli
92+
redis-cli:
93+
$(COMPOSE) -f $(COMPOSE_FILE) exec valkey redis-cli
94+
9195

9296
.PHONY: clean
9397
clean:

beeai/README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,44 @@
33
A set of AI agents implemented in the BeeAI Framework, interconnected via Redis.
44
Every agent can run individually or pick up tasks from a Redis queue.
55

6+
## Architecture
7+
8+
Three agents process tasks through Redis queues:
9+
- **Triage Agent**: Analyzes JIRA issues and determines resolution path
10+
- **Rebase Agent**: Updates packages to newer upstream versions
11+
- **Backport Agent**: Applies specific fixes/patches to packages
12+
613
## Setup
714

815
Copy the `templates` directory to `.secrets` and fill in required information.
916

10-
## Running the workflow
17+
## Running as a service
1118

12-
Start the agents using e.g. `make run-triage-agent` or `make run-triage-agent-detached`. This will automatically
13-
start all the related services. There is currently no mechanism to initiate the workflow other than manually
14-
pushing a task to the `triage_queue` Redis list. The easiest way to do that is with:
19+
The agents run continuously, waiting for work from Redis queues. To process a JIRA issue:
1520

21+
**Step 1: Start the system** (if not already running)
1622
```bash
17-
podman compose exec valkey -- redis-cli lpush triage_queue '{"metadata":{"issue":"RHEL-12345"}}'
23+
make start
24+
```
25+
26+
This runs the services in the foreground, showing logs for monitoring and debugging. If you prefer to run the services in the background, use `make start-detached` instead.
27+
28+
**Step 2: Trigger work**
29+
```bash
30+
make trigger-pipeline JIRA_ISSUE=RHEL-12345
1831
```
1932

2033
## Running individual agents
2134

22-
You can run any agent individually with the appropriate make target, passing required input data
23-
via environment variables, e.g. `make JIRA_ISSUE=RHEL-12345 run-triage-agent-standalone`.
35+
You can run any agent individually with the appropriate make target, passing required input data via environment variables, e.g. `make JIRA_ISSUE=RHEL-12345 run-triage-agent-standalone`.
2436
The agent will run only once, print its output and exit.
2537

38+
```bash
39+
make JIRA_ISSUE=RHEL-12345 run-triage-agent-standalone
40+
make PACKAGE=httpd VERSION=2.4.62 JIRA_ISSUE=RHEL-12345 BRANCH=c10s run-rebase-agent-standalone
41+
make PACKAGE=httpd UPSTREAM_FIX=https://github.com/... JIRA_ISSUE=RHEL-12345 BRANCH=c10s run-backport-agent-standalone
42+
```
43+
2644
## Observability
2745

2846
You can connect to http://localhost:6006/ to access Phoenix web interface and trace agents

beeai/compose.yaml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# Base template for BeeAI agents
2+
x-beeai-agent: &beeai-agent
3+
depends_on:
4+
- mcp-atlassian
5+
- valkey
6+
- phoenix
7+
image: beeai-agent
8+
build:
9+
context: .
10+
dockerfile: Containerfile
11+
environment:
12+
- MCP_JIRA_URL=http://mcp-atlassian:9000/sse
13+
- REDIS_URL=redis://valkey:6379/0
14+
- COLLECTOR_ENDPOINT=http://phoenix:6006/v1/traces
15+
- MAX_RETRIES=3
16+
env_file:
17+
- .secrets/beeai-agent.env
18+
volumes:
19+
- ./agents:/home/beeai/agents:ro,z
20+
restart: unless-stopped
21+
122
services:
223
mcp-atlassian:
324
image: ghcr.io/sooperset/mcp-atlassian:latest
@@ -22,26 +43,17 @@ services:
2243
- phoenix-data:/mnt/data
2344
restart: unless-stopped
2445

25-
beeai-agent:
26-
depends_on:
27-
- mcp-atlassian
28-
- valkey
29-
- phoenix
30-
image: beeai-agent
31-
build:
32-
context: .
33-
dockerfile: Containerfile
34-
environment:
35-
- MCP_JIRA_URL=http://mcp-atlassian:9000/sse
36-
- REDIS_URL=redis://valkey:6379/0
37-
- COLLECTOR_ENDPOINT=http://phoenix:6006/v1/traces
38-
env_file:
39-
- .secrets/beeai-agent.env
40-
volumes:
41-
- ./agents:/home/beeai/agents:ro,z
42-
stdin_open: true
43-
tty: true
44-
restart: "no"
46+
triage-agent:
47+
<<: *beeai-agent
48+
command: ["python", "agents/triage_agent.py"]
49+
50+
backport-agent:
51+
<<: *beeai-agent
52+
command: ["python", "agents/backport_agent.py"]
53+
54+
rebase-agent:
55+
<<: *beeai-agent
56+
command: ["python", "agents/rebase_agent.py"]
4557

4658
volumes:
4759
valkey-data:

beeai/templates/mcp-atlassian.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
JIRA_URL=
1+
JIRA_URL=https://issues.redhat.com
22
JIRA_PERSONAL_TOKEN=

0 commit comments

Comments
 (0)