Skip to content

Commit 9a87d79

Browse files
Update Workers docs
1 parent 45e9fb4 commit 9a87d79

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

docs/AristoteAPI_Workers_guide.md

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quiz generation worker
22

3-
First, make sure that you have an **llm-model** container :
3+
First, make sure that you have an **llm-model** container (not needed for quiz generation using Aristote Dispatcher):
44

55
```
66
docker ps -a
@@ -12,26 +12,26 @@ If not, run this command
1212
docker run --runtime nvidia --gpus all —name llm-model -v ~/.cache/huggingface:/root/.cache/huggingface -p 8000:8000 --ipc=host vllm/vllm-openai:v0.2.4 --model teknium/OpenHermes-2.5-Mistral-7B --dtype float16 --tensor-parallel-size 1
1313
```
1414

15-
After a new Quiz Generation build with tag, these are the steps to follow on the Worker machine (**Note** : quiz-gen folder contains .env file necessary for running the docker container, you can make necessary changes if needed):
15+
After a new Quiz Generation build with tag, these are the steps to follow on the Worker machine for prod environment for example (**Note** : quiz-gen folder contains .env.prod file necessary for running the docker container, you can make necessary changes if needed):
1616

1717
```
1818
cd quiz-gen
19-
docker stop quiz-generator
20-
docker rm quiz-generator
21-
docker pull jq422pa7.gra7.container-registry.ovh.net/aristote/quizz-generation/quizgenerator:{tag}
22-
docker run --env-file .env --network="host" -p 3000:3000 --name quiz-generator jq422pa7.gra7.container-registry.ovh.net/aristote/quizz-generation/quizgenerator:{tag}
19+
docker stop quiz-generator-prod
20+
docker rm quiz-generator-prod
21+
docker pull jq422pa7.gra7.container-registry.ovh.net/aristote/opensource-quiz-generator:{tag}
22+
docker run --env-file .env --add-host host.docker.internal:host-gateway -p 3000:3000 -p 3000:3000 --name quiz-generator-prod jq422pa7.gra7.container-registry.ovh.net/aristote/opensource-quiz-generator:{tag}
2323
```
2424

2525
or simply (inside quiz-gen folder):
2626

2727
```
28-
./update.sh {tag}
28+
./update-prod.sh {tag}
2929
```
3030

3131
To start process of getting a job from AristoteAPI and generating the quiz (assuming quiz-generator container and the llm-model container are running):
3232

3333
```
34-
docker exec quiz-generator python server/generate_quizz.py
34+
docker exec quiz-generator-prod python server/generate_quizz.py
3535
```
3636

3737
This script can be used to handle switching on the llm-model container, waiting till it's responsive, then start the previous command, while taking into account a maximum number of parallel jobs :
@@ -51,15 +51,15 @@ docker save -o whisper.tar whisperapi-whisper
5151
scp whisper.tar ubuntu@ip_adress:/home/ubuntu/transcription
5252
```
5353

54-
These are the steps to follow on the Worker machine (**Note** : transcription folder contains .env file necessary for running the docker container, you can make necessary changes if needed):
54+
These are the steps to follow on the Worker machine (**Note** : transcription folder contains .env file necessary for running the docker container and the .env.preprod/.env.prod for the appropriate Aristote URL and credentials to be used, you can make necessary changes if needed):
5555

5656
```
5757
cd transcription
5858
docker stop whisper
5959
docker rm whisper
6060
docker image rm whisperapi-whisper
6161
docker load -i whisper.tar
62-
docker run --runtime nvidia --gpus all --env-file .env -p 3001:3000 --name whisper whisperapi-whisper
62+
docker run --runtime nvidia --gpus all --env-file .env -p 3001:3000 -v {MODEL_FOLDER_PATH}:/server_app/custom_model -v ./.env.prod:/server_app/.env.prod -v ./.env.preprod:/server_app/.env.preprod --name whisper whisperapi-whisper
6363
```
6464

6565
or simply (inside transcription folder):
@@ -71,7 +71,13 @@ or simply (inside transcription folder):
7171
To start the process of getting a job from AristoteAPI and transcribing the media (assuming whisper container and the whisper container are running):
7272

7373
```
74-
docker exec whisper python transcribe_aristote.py
74+
docker exec whisper python transcribe_aristote.py --env .env.prod
75+
```
76+
77+
or
78+
79+
```
80+
docker exec whisper python transcribe_aristote.py --env .env.preprod
7581
```
7682

7783
This script can be used to handle switching on the whisper container, waiting till it's responsive, then start the previous command, while taking into account a maximum number of parallel jobs :
@@ -90,7 +96,6 @@ To start the process of getting a job from AristoteAPI and evaluating a quiz
9096
docker exec quiz-generator python server/evaluate_quizz.py
9197
```
9298

93-
9499
# Cron jobs
95100

96101
To access cronjob list :
@@ -102,4 +107,9 @@ crontab -e
102107
There is **schedule.sh** that is run as a cron job and it handles the scheduling of quiz generation/transcription workers using **transcription-cron-job.sh** and
103108
**quiz-generation-cron-job.sh** because there is not enough VRAM from them to run simultaneously.
104109

110+
111+
**evaluation-cron-job.sh** that is run as a separate cron job since it doesn't interfere with the other workers.
112+
113+
**quiz-generation-dispatcher-cron-job.sh** handles the quiz generation using Aristote Dispatcher, so no local LLM is needed.
114+
105115
There is also **evaluation-cron-job.sh** that is run as a separate cron job since it doesn't interfere with the other workers.

0 commit comments

Comments
 (0)