From 409df99a2c86858e0896b67df262b97d8010e586 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Date: Mon, 9 Oct 2023 07:39:23 -0300 Subject: [PATCH] Add frontend container & run instructions --- README.md | 25 +++++++++++++++++++++++++ build_docker.sh | 8 ++++++++ docker/Dockerfile.runtime | 14 ++++++++++++-- docker/Dockerfile.runtime+frontend | 25 +++++++++++++++++++++++++ push_docker.sh | 5 +++++ 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 docker/Dockerfile.runtime+frontend create mode 100755 push_docker.sh diff --git a/README.md b/README.md index 68538e3..bbdf5c0 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,31 @@ skynet run dgpu ### dockerized install +## frontend + +system dependencies: +- `docker` + +``` +# create and edit config from template +cp skynet.toml.example skynet.toml + +# pull runtime container +docker pull guilledk/skynet:runtime-frontend + +# run telegram bot +docker run \ + -it \ + --rm \ + --network host \ + --name skynet-telegram \ + --mount type=bind,source="$(pwd)",target=/root/target \ + guilledk/skynet:runtime-frontend \ + skynet run telegram --db-pass PASSWORD --db-user USER --db-host HOST +``` + +## worker + system dependencies: - `docker` with gpu enabled diff --git a/build_docker.sh b/build_docker.sh index 8ca9905..66f7b5f 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -9,3 +9,11 @@ docker build \ docker build \ -t guilledk/skynet:runtime-cuda \ -f docker/Dockerfile.runtime+cuda-py311 . + +docker build \ + -t guilledk/skynet:runtime-frontend \ + -f docker/Dockerfile.runtime+frontend . + +docker build \ + -t guilledk/skynet:runtime \ + -f docker/Dockerfile.runtime . diff --git a/docker/Dockerfile.runtime b/docker/Dockerfile.runtime index 6f2f141..64a571c 100644 --- a/docker/Dockerfile.runtime +++ b/docker/Dockerfile.runtime @@ -2,7 +2,8 @@ from python:3.11 env DEBIAN_FRONTEND=noninteractive -run apt-get update && apt-get install -y git +run apt-get update && apt-get install -y \ + git run curl -sSL https://install.python-poetry.org | python3 - @@ -12,4 +13,13 @@ copy . /skynet workdir /skynet -run poetry install -v +env POETRY_VIRTUALENVS_PATH /skynet/.venv + +run poetry install + +workdir /root/target + +copy docker/entrypoint.sh /entrypoint.sh +entrypoint ["/entrypoint.sh"] + +cmd ["skynet", "--help"] diff --git a/docker/Dockerfile.runtime+frontend b/docker/Dockerfile.runtime+frontend new file mode 100644 index 0000000..2b92dd6 --- /dev/null +++ b/docker/Dockerfile.runtime+frontend @@ -0,0 +1,25 @@ +from python:3.11 + +env DEBIAN_FRONTEND=noninteractive + +run apt-get update && apt-get install -y \ + git + +run curl -sSL https://install.python-poetry.org | python3 - + +env PATH "/root/.local/bin:$PATH" + +copy . /skynet + +workdir /skynet + +env POETRY_VIRTUALENVS_PATH /skynet/.venv + +run poetry install --with=frontend -v + +workdir /root/target + +copy docker/entrypoint.sh /entrypoint.sh +entrypoint ["/entrypoint.sh"] + +cmd ["skynet", "--help"] diff --git a/push_docker.sh b/push_docker.sh new file mode 100755 index 0000000..8d1e30d --- /dev/null +++ b/push_docker.sh @@ -0,0 +1,5 @@ +docker push guilledk/skynet:runtime +docker push guilledk/skynet:runtime-frontend +docker push guilledk/skynet:runtime-cuda-py310 +docker push guilledk/skynet:runtime-cuda-py311 +docker push guilledk/skynet:runtime-cuda