Skip to content

Commit a283d7f

Browse files
chore: update readme (#217)
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com> Co-authored-by: Marcel Klehr <mklehr@gmx.net>
1 parent 4740190 commit a283d7f

1 file changed

Lines changed: 13 additions & 19 deletions

File tree

README.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
>
1212
> The HTTP request timeout is 50 minutes for all requests and can be changed with the `request_timeout` app config for the php app `context_chat` using the occ command (`occ config:app:set context_chat request_timeout --value=3000`, value is in seconds). The same also needs to be done for docker socket proxy. See [Slow responding ExApps](https://github.com/cloud-py-api/docker-socket-proxy?tab=readme-ov-file#slow-responding-exapps)
1313
>
14-
> An end-to-end example on how to build and register the backend manually (with CUDA) is at the end of this readme
14+
> An end-to-end example for dev setups on how to build and register the backend manually (with CUDA) is at the end of this readme
1515
>
1616
> See the [NC Admin docs](https://docs.nextcloud.com/server/latest/admin_manual/ai/app_context_chat.html) for requirements and known limitations.
1717
18-
## Simple Install
18+
## Install
1919

2020
Install the given apps for Context Chat to work as desired **in the given order**:
2121
- [AppAPI from the Apps page](https://apps.nextcloud.com/apps/app_api)
@@ -32,25 +32,26 @@ Install the given apps for Context Chat to work as desired **in the given order*
3232
> [!IMPORTANT]
3333
> To avoid task processing execution delay, setup at 4 background job workers in the main server (where Nextcloud is installed). The setup process is documented here: https://docs.nextcloud.com/server/latest/admin_manual/ai/overview.html#improve-ai-task-pickup-speed
3434
35-
## Complex Install (without docker)
35+
## Dev Install (without docker)
3636

37-
0. Install the required apps from [Simple Install](#simple-install) other than Context Chat Backend and setup background job workers
37+
0. Install the required apps from [Install](#install) other than Context Chat Backend and setup background job workers
3838
1. `python -m venv .venv`
3939
2. `. .venv/bin/activate`
4040
3. `pip install --upgrade pip setuptools wheel`
4141
4. Install requirements `pip install -r requirements.txt`
4242
5. Copy example.env to .env and fill in the variables
43-
6. Ensure the config file at `persistent_storage/config.yaml` points to the correct config file (cpu vs gpu). If you're unsure, delete it. It will be recreated upon launching the application. The default is to point to the gpu config.
44-
7. Configure `persistent_storage/config.yaml` for the model name, model type and its parameters (which also includes model file's path and model id as per requirements, see example config)
43+
6. Ensure the config file at `persistent_storage/config.yaml` points to the correct config file (cpu vs gpu). If you're unsure, delete it. It will be recreated upon launching the application.
44+
7. Configure `persistent_storage/config.yaml`
4545
8. Setup postgresql externally or use `dockerfile_scripts/pgsql/install.sh` to install it on a Debian-family system.
4646
9. Set the env var `EXTERNAL_DB` or the `connection` key in the `pgvector` config to the postgresql connection string if you're using an external database.
4747
10. Start the database (see `dockerfile_scripts/pgsql/setup.sh` for an example)
48-
11. `./main.py`
49-
12. [Follow the below steps to register the app in the app ecosystem](#register-as-an-ex-app)
48+
11. `./main_em.py` in one terminal/tmux pane
49+
12. `./main.py` in another
50+
13. [Follow the below steps to register the app in the app ecosystem](#register-as-an-ex-app)
5051

51-
## Complex Install (with docker)
52+
## Dev Install (with docker)
5253

53-
0. Install the required apps from [Simple Install](#simple-install) other than Context Chat Backend and setup background job workers
54+
0. Install the required apps from [Install](#install) other than Context Chat Backend and setup background job workers
5455
1. Build the image
5556
*(this is a good place to edit the example.env file before building the container)*
5657
`docker build -t context_chat_backend . -f Dockerfile`
@@ -67,7 +68,7 @@ occ app_api:daemon:register --net host manual_install "Manual Install" manual-in
6768
```
6869
`host` will be `localhost` if nextcloud can access localhost or `host.docker.internal` if nextcloud is inside a docker container and the backend app is on localhost.
6970

70-
If nextcloud is inside a container, `--add-host` option would be required by your nextcloud container. [See example above, pt. 2](#complex-install-with-docker)
71+
If nextcloud is inside a container, `--add-host` option would be required by your nextcloud container. [See example above, pt. 2](#dev-install-with-docker)
7172

7273
**2. Register the app using the deploy daemon (be mindful of the port number and the app's version):**
7374
```
@@ -167,7 +168,6 @@ Adjust the example.env to your needs so that it fits your environment
167168
docker run \
168169
-v ./config.yaml:/app/config.yaml \
169170
-v ./context_chat_backend:/app/context_chat_backend \
170-
-v /var/run/docker.sock:/var/run/docker.sock \
171171
--env-file example.env \
172172
-p 10034:10034 \
173173
-e CUDA_VISIBLE_DEVICES=0 \
@@ -186,10 +186,6 @@ docker run \
186186

187187
Mounts the context_chat_backend into the docker image
188188

189-
`-v /var/run/docker.sock:/var/run/docker.sock`
190-
191-
Mounts the Docker socket file from the host into the container. This is done to allow the Docker client running inside the container to communicate with the Docker daemon on the host, essentially controlling Docker and GPU from within the container.
192-
193189
`-v persistent_storage:/app/persistent_storage`
194190

195191
Mounts the persistent storage into the docker instance to keep downloaded models stored for the future.
@@ -231,9 +227,7 @@ sudo -u www-data php occ app_api:app:register \
231227
\"daemon_config_name\":\"manual_install\",\
232228
\"version\":\"4.5.0\",\
233229
\"secret\":\"12345\",\
234-
\"port\":10034,\
235-
\"scopes\":[],\
236-
\"system_app\":0}" \
230+
\"port\":10034}" \
237231
--force-scopes \
238232
--wait-finish
239233
```

0 commit comments

Comments
 (0)