danswer/deployment
Chris Weaver f1fc8ac19b
Connector checkpointing (#3876)
* wip checkpointing/continue on failure

more stuff for checkpointing

Basic implementation

FE stuff

More checkpointing/failure handling

rebase

rebase

initial scaffolding for IT

IT to test checkpointing

Cleanup

cleanup

Fix it

Rebase

Add todo

Fix actions IT

Test more

Pagination + fixes + cleanup

Fix IT networking

fix it

* rebase

* Address misc comments

* Address comments

* Remove unused router

* rebase

* Fix mypy

* Fixes

* fix it

* Fix tests

* Add drop index

* Add retries

* reset lock timeout

* Try hard drop of schema

* Add timeout/retries to downgrade

* rebase

* test

* test

* test

* Close all connections

* test closing idle only

* Fix it

* fix

* try using null pool

* Test

* fix

* rebase

* log

* Fix

* apply null pool

* Fix other test

* Fix quality checks

* Test not using the fixture

* Fix ordering

* fix test

* Change pooling behavior
2025-02-16 02:34:39 +00:00
..
2024-12-13 09:56:10 -08:00
2025-02-06 10:41:09 -08:00
2024-12-17 22:02:37 +00:00
2023-06-14 00:11:25 -07:00
2024-12-13 09:56:10 -08:00

Deploying Onyx

The two options provided here are the easiest ways to get Onyx up and running.

  • Docker Compose is simpler and default values are already preset to run right out of the box with a single command. As everything is running on a single machine, this may not be as scalable depending on your hardware, traffic and needs.

  • Kubernetes deployment is also provided. Depending on your existing infrastructure, this may be more suitable for production deployment but there are a few caveats.

    • User auth is turned on by default for Kubernetes (with the assumption this is for production use) so you must either update the deployments to turn off user auth or provide the values shown in the example secrets.yaml file.
    • The example provided assumes a blank slate for existing Kubernetes deployments/services. You may need to adjust the deployments or services according to your setup. This may require existing Kubernetes knowledge or additional setup time.

All the features of Onyx are fully available regardless of the deployment option.

For information on setting up connectors, check out https://docs.onyx.app/connectors/overview

Docker Compose:

Docker Compose provides the easiest way to get Onyx up and running.

Requirements: Docker and docker compose

This section is for getting started quickly without setting up GPUs. For deployments to leverage GPU, please refer to this documentation.

  1. To run Onyx, navigate to docker_compose directory and run the following:

    • docker compose -f docker-compose.dev.yml -p onyx-stack up -d --pull always --force-recreate - or run: docker compose -f docker-compose.dev.yml -p onyx-stack up -d --build --force-recreate to build from source
    • Downloading images or packages/requirements may take 15+ minutes depending on your internet connection.
  2. To shut down the deployment, run:

    • To stop the containers: docker compose -f docker-compose.dev.yml -p onyx-stack stop
    • To delete the containers: docker compose -f docker-compose.dev.yml -p onyx-stack down
  3. To completely remove Onyx run:

    • WARNING, this will also erase your indexed data and users
    • docker compose -f docker-compose.dev.yml -p onyx-stack down -v

Additional steps for user auth and https if you do want to use Docker Compose for production:

  1. Set up a .env file in this directory with relevant environment variables.

  2. Set up https:

    • Set up a .env.nginx file in this directory based on env.nginx.template.
    • chmod +x init-letsencrypt.sh + ./init-letsencrypt.sh to set up https certificate.
  3. Follow the above steps but replacing dev with prod.

Kubernetes:

Depending on your deployment needs Kubernetes may be more suitable. The yamls provided will work out of the box but the intent is for you to customize the deployment to fit your own needs. There is no data replication or auto-scaling built in for the provided example.

Requirements: a Kubernetes cluster and kubectl

NOTE: This setup does not explicitly enable https, the assumption is you would have this already set up for your prod cluster

  1. To run Onyx, navigate to kubernetes directory and run the following:

    • kubectl apply -f .
  2. To remove Onyx, run:

    • WARNING, this will also erase your indexed data and users
    • kubectl delete -f .
    • To not delete the persistent volumes (Document indexes and Users), specify the specific .yaml files instead of . without specifying delete on persistent-volumes.yaml.