From 990ca271ca84a0e095cae9c1ac2e423f82f1e684 Mon Sep 17 00:00:00 2001 From: KIMB-technologies Date: Fri, 4 Oct 2024 22:29:47 +0200 Subject: [PATCH] Docker conf --- Dockerfile | 15 +++++++++++++++ docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ src/__init__.py | 0 3 files changed, 55 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 src/__init__.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..adc6384 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +ARG IMAGE_FROM +FROM $IMAGE_FROM + +# become root +USER root + +# do somthing as root, e.g. install packages, set up things ... +# RUN ... + +# copy the source of the agent in this repo +COPY --chown=user:user ./src/ /ums-agenten/project/src/ +# fix permissions +RUN chown -R user:user /ums-agenten +# switch back to user +USER user \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a786d30 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ + +services: + management: + # select the correct one base on platform this is running on + image: git.chai.uni-hamburg.de/ums-agenten/management:arm64 + #image: git.chai.uni-hamburg.de/ums-agenten/management:amd64 + ports: + # external (to host) http port + - 8080:80 + environment: + # *register* the agents to the management + - AGENTS_PROCESS=http://agent_process_1:3001,http://agent_process_2:3001 + - AGENTS_SOLVE=http://agent_solve_1:3001 + - AGENTS_GATEKEEPER=http://agent_gatekeeper_1:3001 + 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 large data via files + - /data/share/:/ums-agent/share/ + # the folder *persist* is different for each container and can be used to store data permanently + - /data/persist-management/:/ums-agenten/persist/ + + agent_process_1: + # this allow to do installs etc. in the docker image (a new image will be built on top of the provided one) + build: + context: . + dockerfile: Dockerfile + args: + # select the correct one base on platform this is running on + - 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 + environment: + # tell the agent where the management is accessible + - MANAGEMENT=http://management + volumes: + - /data/share/:/ums-agent/share/ + - /data/persist-process-1/:/ums-agenten/persist/ + # this is for development (s.t. the changes in ./src/ are directly applied) + - ./src/:/ums-agenten/project/src/:ro + entrypoint: ... # TODO \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29