Einstieg Doku

This commit is contained in:
2024-10-30 22:12:51 +01:00
parent 807e7cefb6
commit ebe4a58f90
15 changed files with 204 additions and 144 deletions

View File

@ -1,5 +1,8 @@
services:
# first the management
management:
# select the correct one base on platform this is running on
image: git.chai.uni-hamburg.de/ums-agenten/management:arm64
@ -11,12 +14,16 @@ services:
environment:
# limit number of trials for solving a riddle
- SOLUTION_MAX_TRIALS=5
# limit to prevent messages in never ending cycles
- MESSAGE_MAX_CONTACTS=100
# how to access management (the host name is the name of the service in this file)
- MANAGEMENT_URL=http://management
# *register* the agents to the management
- AGENTS_PROCESS=http://agent_extract_1:8000,http://agent_extract_2:8000
- AGENTS_PROCESS=http://agent_extract:8000
- AGENTS_SOLVE=http://agent_solve:8000
- AGENTS_GATEKEEPER=http://agent_gatekeeper:8000
# divide multiple agents of same type by comma
#- AGENTS_PROCESS=http://agent_extract_1:8000,http://agent_extract_2:8000
volumes:
# all data is bind-mounted from ./data on the host into the containers
# the folder *share* is shared with all agents, it can be used to pass the data via files
@ -24,10 +31,12 @@ services:
# the folder *persist* is different for each container and is used to store data permanently
- ./data/persist-management/:/ums-agenten/persist/
agent_solve:
# afterwards the agents
agent_extract:
# this allow to do installs etc. in the docker image (a new image will be built on top of the provided one)
build:
context: ./agent-solve
context: .
dockerfile: Dockerfile
args:
# select the correct one base on platform this is running on
@ -39,28 +48,20 @@ services:
- 8081:8000
environment:
# python package:variable_name of the list of agents implemeted here
- AGENTS_LIST=src.agent:AGENT_CLASSES
- AGENTS_LIST=src.extract.agent:AGENT_CLASSES
# tell the agent where the management is accessible
- MANAGEMENT_URL=http://management
volumes:
- ./data/share/:/ums-agenten/share/
- ./data/persist-solve/:/ums-agenten/persist/
- ./data/persist-extract/:/ums-agenten/persist/
# this is for development (s.t. the changes in ./src/ are directly applied)
- ./agent-solve/src/:/ums-agenten/project/src/:ro
- ./src/:/ums-agenten/project/src/:ro
# for development: will detect file changes and reload server with new source
entrypoint: bash -c "SERVE=true uvicorn ums.agent.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir /ums-agenten/project/src/"
networks:
# this is a trick: we add multiple host names to the same container
# later, each agent will get its own container, but for testing, by this
# one container can become *all* agents
default:
aliases:
- agent_extract_2
- agent_gatekeeper
agent_extract_1:
agent_solve:
build:
context: ./agent-extract
context: .
dockerfile: Dockerfile
args:
- IMAGE_FROM=git.chai.uni-hamburg.de/ums-agenten/base-agent:cpu-arm64
@ -69,9 +70,30 @@ services:
ports:
- 8082:8000
environment:
- AGENTS_LIST=src.agent:AGENT_CLASSES
- AGENTS_LIST=src.solve.agent:AGENT_CLASSES
- MANAGEMENT_URL=http://management
volumes:
- ./data/share/:/ums-agenten/share/
- ./data/persist-extract/:/ums-agenten/persist/
- ./agent-extract/src/:/ums-agenten/project/src/:ro
- ./data/persist-solve/:/ums-agenten/persist/
- ./src/:/ums-agenten/project/src/:ro
entrypoint: bash -c "SERVE=true uvicorn ums.agent.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir /ums-agenten/project/src/"
agent_gatekeeper:
build:
context: .
dockerfile: Dockerfile
args:
- IMAGE_FROM=git.chai.uni-hamburg.de/ums-agenten/base-agent:cpu-arm64
#- IMAGE_FROM=git.chai.uni-hamburg.de/ums-agenten/base-agent:cpu-amd64
#- IMAGE_FROM=git.chai.uni-hamburg.de/ums-agenten/base-agent:gpu-amd64
ports:
- 8083:8000
environment:
- AGENTS_LIST=src.validate.agent:AGENT_CLASSES
- MANAGEMENT_URL=http://management
volumes:
- ./data/share/:/ums-agenten/share/
- ./data/persist-validate/:/ums-agenten/persist/
- ./src/:/ums-agenten/project/src/:ro
entrypoint: bash -c "SERVE=true uvicorn ums.agent.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir /ums-agenten/project/src/"