Skip to content

Latest commit

 

History

History
86 lines (76 loc) · 2.3 KB

README_DEV.md

File metadata and controls

86 lines (76 loc) · 2.3 KB
  1. Info https://docs.epam-rail.com/Cookbook/dial-cookbook/examples/how_to_call_text_to_text_applications

  2. Dev environment a) Setup

curl -sSL https://install.python-poetry.org | python3 - --version 1.7.0
poetry init
poetry config virtualenvs.in-project true
poetry env use 3.11
source .venv/bin/activate
poetry config virtualenvs.prompt 'ai-dial'
poetry config --list

b) Install

poetry install --no-root 

c) Add pip requirements to poetry

poetry add $(cat dial-sdk/examples/langchain_rag/requirements.txt)
  1. App in docker desktop a) Run app
cd dial-docker-compose/application && docker-compose up -d --build --force-recreate

-d : Detached mode, runs containers in the background.
--build : Builds images before starting containers.
--force-recreate : Recreates containers even if their configuration and image haven't changed.
b) Restart app Change cfg config.json

cd dial-docker-compose/application && docker-compose restart core

c) Get ip for docker and dial-docker-compose/application/core/config.json

# host.docker.internal:5001 is same 172.17.0.1
IP_ADDRESS=$(ip addr show | grep "\binet\b.*\bdocker0\b" | awk '{print $2}' | cut -d '/' -f 1)
echo $IP_ADDRESS
  1. Submodule a) Add submodule
git submodule init
git submodule update

Submodule 'dial-sdk' (https://github.com/epam/ai-dial-sdk) registered for path '../../dial-sdk' Cloning into '/home/he/Projects/Prod/EPAM/ai-dial/dial-sdk'... Submodule path '../../dial-sdk': checked out 'a17a4cf7c1493b7f0a7fe45e780764d088222891'

b) Delete submodule (Use carefully)

git submodule deinit -f dial-sdk
rm -rf dial-sdk
git rm -f dial-sdk
git add .gitmodules
git commit -m "Remove submodule"
  1. Subtree (preferable in case of fork changes, to do not push to remote branch, but use core ai-dial project commits) a) Add Subtree
git subtree add --prefix=dial-sdk https://github.com/epam/ai-dial-sdk development
ls dial-sdk

b) Push to subtree

git subtree push --prefix=path/to/subtree https://github.com/epam/ai-dial-sdk development

c) Pull from subtree

git subtree pull --prefix=path/to/subtree https://github.com/epam/ai-dial-sdk development
  1. Clean git cached files
git rm --cached -r .idea/
git rm --cached -r .vscode/