Skip to content

Commit

Permalink
Split requirements to install per service
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Apr 15, 2024
1 parent 1d72466 commit 8b54505
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chat_client/blueprints/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from starlette.requests import Request

from chat_client.client_config import client_config
from chat_client.client_utils.template_utils import callback_template
from utils.http_utils import respond
from utils.template_utils import callback_template

router = APIRouter(
prefix="/components",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ RUN apt-get update \
&& apt install build-essential -y \
&& pip install --upgrade pip \
&& pip install wheel \
&& pip install --no-cache-dir -r ./requirements.txt
&& pip install --no-cache-dir -r ./base.txt
2 changes: 2 additions & 0 deletions dockerfiles/Dockerfile.client
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ ENV KLAT_ENV PROD
ENV CHATCLIENT_CONFIG /app/config/config.json
ENV PYTHONPATH="/app:/app/chat_client/"

RUN pip install --no-cache-dir -r ./services/client.txt

CMD python -m chat_client
1 change: 1 addition & 0 deletions dockerfiles/Dockerfile.observer
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ ENV KLAT_ENV PROD
ENV KLATCHAT_OBSERVER_CONFIG /app/config/config.json
ENV PYTHONPATH="/app:/app/klatchat_observer/"

RUN pip install --no-cache-dir -r ./services/observer.txt

CMD python -m klatchat_observer
2 changes: 2 additions & 0 deletions dockerfiles/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ ENV CHATSERVER_CONFIG /app/config/config.json
ENV DATABASE_CONFIG /app/config/config.json
ENV PYTHONPATH="/app:/app/chat_server/"

RUN pip install --no-cache-dir -r ./services/server.txt

CMD python -m chat_server
8 changes: 8 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cachetools==5.3.1
ovos_config==0.0.10
ovos_utils==0.0.35
pre-commit==3.4.0
pydantic==2.4.2
python-socketio==5.9.0
requests==2.31.0
starlette==0.27.0
6 changes: 6 additions & 0 deletions requirements/services/client.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fastapi==0.103.2
httpx==0.25.0 # required by FastAPI
Jinja2==3.1.2
ovos_config==0.0.10
ovos_utils==0.0.35
uvicorn==0.23.2
1 change: 1 addition & 0 deletions requirements/services/observer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neon-mq-connector~=0.7
13 changes: 13 additions & 0 deletions requirements/services/server.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
aiofiles==23.2.1
bidict==0.22.1
fastapi==0.103.2
fastapi-socketio==0.0.10
httpx==0.25.0 # required by FastAPI
kubernetes==28.1.0
neon-sftp~=0.1
PyJWT==2.8.0
pymongo==4.5.0
python-multipart==0.0.6
uvicorn==0.23.2
websocket-client==1.6.3
websockets==11.0.3
9 changes: 6 additions & 3 deletions scripts/build_pyklatchat_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ cp config.py services/klatchat_observer
cp config.json services/klatchat_observer
cp version.py services/klatchat_observer
cp -R utils services/klatchat_observer
cp requirements/requirements.txt services/klatchat_observer
cp requirements/base.txt services/klatchat_observer
cp requirements/services/observer.txt services/klatchat_observer
cd services/klatchat_observer

# replacing base image version
Expand All @@ -54,7 +55,8 @@ sed -i "1 s|.*|FROM ghcr.io/neongeckocom/pyklatchat_base:${VERSION}|" ../../dock
docker build -f ../../dockerfiles/Dockerfile.observer -t ghcr.io/neongeckocom/klatchat_observer:$VERSION .
cd ../../
echo "Building Chat Client"
cp requirements/requirements.txt chat_client
cp requirements/base.txt chat_client
cp requirements/services/client.txt chat_client
cp -R utils chat_client
cp config.py chat_client
cp version.py chat_client
Expand All @@ -67,7 +69,8 @@ sed -i "1 s|.*|FROM ghcr.io/neongeckocom/pyklatchat_base:${VERSION}|" ../dockerf
docker build -f ../dockerfiles/Dockerfile.client -t ghcr.io/neongeckocom/chat_client:$VERSION .
cd ..
echo "Building Chat Server"
cp requirements/requirements.txt chat_server
cp requirements/base.txt chat_server
cp requirements/services/server.txt chat_server
cp config.py chat_server
cp version.py chat_server
cp -R utils chat_server
Expand Down

0 comments on commit 8b54505

Please sign in to comment.