Optim. Repo Structure
This commit is contained in:
parent
414c18ef08
commit
53bc4ac219
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,7 +1,9 @@
|
||||
__pycache__
|
||||
|
||||
# data of containers
|
||||
/data/*
|
||||
|
||||
# ignore local venv
|
||||
/bin/
|
||||
/lib/
|
||||
/include/
|
||||
|
29
Readme.md
29
Readme.md
@ -1,26 +1,33 @@
|
||||
> [!NOTE]
|
||||
> In diesem Repository befinden sich die Implementierung des Management und der Agenten-Plattform. Sowie Skripte zur Erstellung der Docker-Images.
|
||||
|
||||
> [!WARNING]
|
||||
> Um die Plattform zu benutzen, bitte das [Agent-Template](https://git.chai.uni-hamburg.de/UMS-Agenten/Agent-Template) benutzen!
|
||||
|
||||
# Agenten-Plattform
|
||||
|
||||
## Management
|
||||
|
||||
- `./docker-mgmt/`
|
||||
- `./ums/management/`
|
||||
- `./web/`
|
||||
- `./build-mgmt.sh`
|
||||
Verzeichnisse insb.:
|
||||
- `./utils/mgmt/` Docker container configs
|
||||
- `./ums/management/` Python source
|
||||
- `./web/` Jinja templates and web root
|
||||
- `./build-mgmt.sh` Container build script
|
||||
|
||||
|
||||
## Basic Agent
|
||||
|
||||
- `./docker-agent/`
|
||||
- `./ums/agent/`
|
||||
- `./build-agent.sh`
|
||||
|
||||
Verzeichnisse insb.:
|
||||
- `./utils/agent/` Docker container configs
|
||||
- `./ums/agent/` Python source
|
||||
- `./build-agent.sh` Container build script
|
||||
|
||||
## Development
|
||||
|
||||
### Run via Docker
|
||||
- `docker compose up`
|
||||
|
||||
### VS Code Autocomplete ...
|
||||
### VS Code Autocomplete
|
||||
(In VS Code)
|
||||
|
||||
- `python3 -m venv .` (only once)
|
||||
- `source ./bin/activate`
|
||||
- `pip install requests fastapi pdoc` (only once)
|
||||
|
@ -35,7 +35,7 @@ for platform in $PLATFORMS; do
|
||||
docker build \
|
||||
--pull \
|
||||
--platform "linux/$platform" \
|
||||
--file "$SCRIPTPATH/docker-agent/Dockerfile" \
|
||||
--file "$SCRIPTPATH/utils/agent/Dockerfile" \
|
||||
--build-arg FROM_IMAGE="$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_AGENT_BASE:$tag" \
|
||||
--build-arg PIP_REQ_FILE="$requirements" \
|
||||
--tag "$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_NAME_AGENT:$tag" \
|
||||
@ -45,6 +45,6 @@ done;
|
||||
if [ "$requirements" == "requirements.txt" ]; then
|
||||
# extract requirements-frozen.txt
|
||||
cid=$(docker create "$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_NAME_AGENT:cpu-arm64")
|
||||
docker cp "$cid:/ums-agenten/requirements-frozen.txt" "$SCRIPTPATH/docker-agent/requirements-frozen.txt"
|
||||
docker cp "$cid:/ums-agenten/requirements-frozen.txt" "$SCRIPTPATH/utils/agent/requirements-frozen.txt"
|
||||
docker rm "$cid"
|
||||
fi;
|
||||
|
@ -29,7 +29,7 @@ for platform in $PLATFORMS; do
|
||||
docker build \
|
||||
--pull \
|
||||
--platform "linux/$platform" \
|
||||
--file "$SCRIPTPATH/docker-mgmt/Dockerfile" \
|
||||
--file "$SCRIPTPATH/utils/mgmt/Dockerfile" \
|
||||
--build-arg H_UID=1050 \
|
||||
--build-arg PIP_REQ_FILE="$requirements" \
|
||||
--build-arg H_GID=1050 \
|
||||
@ -41,6 +41,6 @@ done;
|
||||
if [ "$requirements" == "requirements.txt" ]; then
|
||||
# extract requirements-frozen.txt
|
||||
cid=$(docker create "$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_NAME_MGMT:arm64")
|
||||
docker cp "$cid:/ums-agenten/requirements.txt" "$SCRIPTPATH/docker-mgmt/requirements-frozen.txt"
|
||||
docker cp "$cid:/ums-agenten/requirements.txt" "$SCRIPTPATH/utils/mgmt/requirements-frozen.txt"
|
||||
docker rm "$cid"
|
||||
fi;
|
||||
|
@ -16,12 +16,12 @@ ARG PIP_REQ_FILE
|
||||
USER root
|
||||
RUN mkdir -p /ums-agenten/plattform/ && mkdir -p /ums-agenten/persist/
|
||||
|
||||
COPY ./docker-agent/$PIP_REQ_FILE /ums-agenten/requirements.txt
|
||||
COPY ./utils/agent/$PIP_REQ_FILE /ums-agenten/requirements.txt
|
||||
RUN pip3 install --break-system-packages --no-cache-dir -r /ums-agenten/requirements.txt \
|
||||
&& pip3 freeze -q -r /ums-agenten/requirements.txt > /ums-agenten/requirements-frozen.txt
|
||||
|
||||
# install the code of the repo
|
||||
COPY ./docker-mgmt/setup.py /ums-agenten/plattform/
|
||||
COPY ./utils/setup.py /ums-agenten/plattform/
|
||||
RUN pip3 install --break-system-packages -e /ums-agenten/plattform/
|
||||
|
||||
COPY --chown=user:user ./ums/ /ums-agenten/plattform/ums/
|
@ -38,17 +38,17 @@ RUN ln -s /usr/bin/python3 /usr/local/bin/python \
|
||||
|
||||
RUN mkdir -p /ums-agenten/plattform/ && mkdir -p /ums-agenten/persist/
|
||||
|
||||
COPY ./docker-mgmt/$PIP_REQ_FILE /ums-agenten/requirements.txt
|
||||
COPY ./utils/mgmt/$PIP_REQ_FILE /ums-agenten/requirements.txt
|
||||
RUN pip3 install --break-system-packages --no-cache-dir -r /ums-agenten/requirements.txt \
|
||||
&& pip3 freeze > /ums-agenten/requirements.txt
|
||||
|
||||
# nginx settings and startup
|
||||
COPY ./docker-mgmt/supervisor.conf /etc/supervisor/supervisord.conf
|
||||
COPY ./docker-mgmt/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./docker-mgmt/app.conf /etc/nginx/sites-enabled/default
|
||||
COPY ./utils/mgmt/supervisor.conf /etc/supervisor/supervisord.conf
|
||||
COPY ./utils/mgmt/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./utils/mgmt/app.conf /etc/nginx/sites-enabled/default
|
||||
|
||||
# install the code of the repo
|
||||
COPY ./docker-mgmt/setup.py /ums-agenten/plattform/
|
||||
COPY ./utils/setup.py /ums-agenten/plattform/
|
||||
RUN pip3 install --break-system-packages -e /ums-agenten/plattform/
|
||||
|
||||
WORKDIR /ums-agenten/plattform/ums/
|
Loading…
x
Reference in New Issue
Block a user