diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 979bdd3e..028bba0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,9 @@ jobs: - name: Install dependencies run: | cd bot/ + export $(grep -v '^#' .env | xargs) pip install --upgrade pip - pip install flake8 pytest rasa==3.6.12 + pip install flake8 pytest rasa==$RASA_VERSION if [ -f requirements.txt ]; then make install; fi - name: Lint with flake8 run: | diff --git a/.gitignore b/.gitignore index 33bc3bac..c4e812eb 100644 --- a/.gitignore +++ b/.gitignore @@ -162,7 +162,6 @@ celerybeat-schedule.* *.sage.py # Environments -.env .venv venv/ ENV/ diff --git a/Makefile b/Makefile index bb683fc6..7432f30b 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +include bot/.env +export $(shell sed 's/=.*//' bot/.env) + current_dir := $(shell pwd) user := $(shell whoami) @@ -23,6 +26,7 @@ logs: -f build: + export $(grep -v '^#' env/bot.env | xargs) docker compose build \ --no-cache bot diff --git a/env/bot.env b/bot/.env similarity index 61% rename from env/bot.env rename to bot/.env index 9443a3d0..551d78e3 100644 --- a/env/bot.env +++ b/bot/.env @@ -2,3 +2,5 @@ MONGO_HOST=mongo MONGO_PORT=27017 MONGO_USERNAME= MONGO_PASSWORD= +RASA_VERSION=3.6.13 +RASA_SDK_VERSION=3.6.2 \ No newline at end of file diff --git a/bot/Makefile b/bot/Makefile index 900894ae..d62738be 100644 --- a/bot/Makefile +++ b/bot/Makefile @@ -1,5 +1,8 @@ .PHONY: all clean actions +include .env +export $(shell sed 's/=.*//' .env) + ## FLAGS: LOG_LEVEL = -vv RASA_ENDPOINTS = --endpoints diff --git a/bot/requirements.txt b/bot/requirements.txt index b5bc3bf2..d7056fb1 100644 --- a/bot/requirements.txt +++ b/bot/requirements.txt @@ -1 +1,2 @@ -rasa==3.6.12 +rasa==${RASA_VERSION} +rasa-model-report==1.5.0 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e8cfd3ba..6b8c7810 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,11 @@ services: build: context: . dockerfile: ./docker/bot.Dockerfile + args: + RASA_VERSION: ${RASA_VERSION} container_name: bot env_file: - - ./env/bot.env + - ./bot/.env volumes: - ./bot/:/bot/ ports: @@ -26,7 +28,7 @@ services: image: mongo:6.0 restart: unless-stopped env_file: - - env/bot.env + - ./bot/.env ports: - 27017:27017 networks: @@ -40,9 +42,11 @@ services: build: context: . dockerfile: ./docker/actions.Dockerfile + args: + RASA_SDK_VERSION: ${RASA_SDK_VERSION} container_name: actions env_file: - - ./env/bot.env + - ./bot/.env ports: - 5055:5055 volumes: diff --git a/docker/actions.Dockerfile b/docker/actions.Dockerfile index c44c48f7..0b6bca42 100644 --- a/docker/actions.Dockerfile +++ b/docker/actions.Dockerfile @@ -1,4 +1,5 @@ -FROM rasa/rasa-sdk:3.6.2 +ARG RASA_SDK_VERSION +FROM rasa/rasa-sdk:${RASA_SDK_VERSION} WORKDIR /bot COPY ./bot /bot diff --git a/docker/bot.Dockerfile b/docker/bot.Dockerfile index 63516440..3af3f07c 100644 --- a/docker/bot.Dockerfile +++ b/docker/bot.Dockerfile @@ -1,4 +1,5 @@ -FROM rasa/rasa:3.6.12-full +ARG RASA_VERSION +FROM rasa/rasa:${RASA_VERSION}-full WORKDIR /bot COPY ./bot /bot