Skip to content

Commit 98e7ec7

Browse files
committed
[add]Assessment with docker
1 parent 75a0f76 commit 98e7ec7

6 files changed

Lines changed: 48 additions & 6 deletions

File tree

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ RUN \
1313

1414
COPY scenarios scenarios
1515
COPY benchmark benchmark
16-
17-
COPY .env ./
1816

1917
ENTRYPOINT ["uv", "run", "fwa-server"]
2018
CMD ["--host", "0.0.0.0"]

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,29 @@ This command will:
8888
To run this example manually, start the agent servers in separate terminals, and then in another terminal run the A2A client on the scenario.toml file to initiate the assessment.
8989

9090
## Running with Docker
91+
92+
### Running Complete Assessment (Recommended)
93+
94+
Build both Green Agent and Test Purple Agent images, then run the complete scenario:
95+
96+
```bash
97+
bash docker_build.sh
98+
bash docker_run_scenario.sh
9199
```
100+
101+
This will:
102+
- Start both Green Agent and Test Purple Agent containers with environment variables from `.env` file
103+
- Wait for agents to initialize (40 seconds)
104+
- Execute the assessment scenario
105+
- Display logs and clean up containers
106+
107+
### Running Green Agent Server Only
108+
109+
To run only the Green Agent server for development or testing:
110+
111+
```bash
92112
docker build -t fwa_green_agent .
93-
docker run -p 9009:9009 fwa_green_agent
113+
docker run -p 9009:9009 --env-file .env fwa_green_agent
94114
```
95115

96116
**Note:** This only starts the GreenAgent server and does not execute the assessment using test_agent.

docker_build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
docker build . -f Dockerfile -t green_agent
4+
docker build . -f scenarios/fwa/Dockerfile.purple_agent -t purple_agent

docker_run_scenario.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Check if .env file exists
4+
if [ -f .env ]; then
5+
echo "Starting containers with environment variables from .env file..."
6+
docker run --rm -d --network host --env-file .env --name gc green_agent --host 127.0.0.1 --port 9009
7+
docker run --rm -d --network host --env-file .env --name pc purple_agent --host 127.0.0.1 --port 9019
8+
else
9+
echo "Warning: .env file not found. Starting containers without environment file..."
10+
docker run --rm -d --network host --name gc green_agent --host 127.0.0.1 --port 9009
11+
docker run --rm -d --network host --name pc purple_agent --host 127.0.0.1 --port 9019
12+
fi
13+
14+
# wait for agents to start
15+
echo "Waiting for agents to start... 40 seconds"
16+
sleep 40
17+
18+
# Run scenario using fwa-run command from green agent container
19+
docker exec gc uv run fwa-run scenarios/fwa/scenario.toml
20+
docker exec gc cat logs/FWA_green_agent.log
21+
docker stop gc
22+
docker stop pc

scenarios/fwa/Dockerfile.purple_agent

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ RUN \
1616

1717
COPY scenarios scenarios
1818

19-
COPY .env ./
20-
2119
ENTRYPOINT ["uv", "run", "scenarios/fwa/purple_agent/test_agent.py"]
2220
CMD ["--host", "0.0.0.0"]
2321
EXPOSE 9019

src/fieldworkarena/agent/metrics/tasks/data_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(
5757
force_download: bool = False,
5858
):
5959
self.repo_id = repo_id
60-
self.access_token = access_token
60+
self.access_token = access_token.strip() if access_token else ""
6161
self.repo_type = repo_type
6262
self.cache_dir = cache_dir
6363
self.force_download = force_download

0 commit comments

Comments
 (0)