Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More detailed hosting docs #76

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions HOSTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Hosting vectara-answer

This guide provides specific instructions to help you host your `vectara-answer` application on one of the popular hosting providers.
We keep adding new hosting providers regularly - please let us know if you need instructions for a hosting provider that is not yet included.

### Overview

To run a hosted version of `vectara-answer` you would need to have two files: `.env` and `queries.json`.

To prepare the `.env` file, which combines the information from `config.yaml` and `secrets.toml`, run the following command:

`python3 prepare_config.py /path/to/<YOUR-CONFIG.yaml> <profile>`

At the end of this process you should have two files ready to go:
1. `.env` generated by the above python3 command
2. `queries.json` that specifies the queries for your application.

### Deploy vectara-answer on Render

To deploy on Render, please follow these steps:

1. Sign Up/Log In: If you don't have a Render account, you'll need to create one. If you already have one, just log in.
2. Create New Service: Once you're logged in, click on the "New" button usually found on the dashboard and select "Web Service".
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Render has some ability to do this via a configuration file, but it looks limited. It would be preferable to have this basically just do a one click method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes certainly would be better if there is a way to do this programatically but this should be a good start, as the instructions are pretty clear and simple.

3. Choose "Deploy an existing image from a registry" and click "Next"
4. Specify Docker Image: In the "Image URL" fill in "vectara/vectara-answer" and click "Next"
5. Choose a name for your deployment (e.g. "vectara-answer"), and if you need to pick a region or leave the default. Then pick you instance type.
6. Click "Create Web Service"
7. Click "Environment", then "Add Secret File": name the file `.env`, and copy the contents of your local `.env` file
8. Now click "Add Secret File" again and this time name the file `queries.json`, and copy the contents of your local `queries.json` file
9. Click "Settings" and go to "Docker Command" and click "Edit", the put in the following command:

`/bin/bash -c cp /etc/secrets/queries.json ./build/ && cp /etc/secrets/.env ./ && node server/index.js`

Then click "Save Changes", and your application should now be deployed.

### Deploy vectara-answer on Heroku

To be added soon

### Deploy vectara-answer on AWS with CloudFormation

To be added soon

### Deploy vectara-answer on GCP

To be added soon



11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,8 @@ The container generated is called `vanswer`, and after it is started, you can:

### Cloud deployment

You can deploy `vectara-answer` on cloud platforms such as AWS, Azure, or GCP.

1. Create your configuration file for the project under the `config/` directory.
2. Run `python3 prepare_config.py <config_file_name>` to generate the `.env` file
3. Push the docker to the cloud specific docker container registry:
- [AWS instructions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html).
- [Azure instructions](https://learn.microsoft.com/en-us/azure/container-apps/get-started-existing-container-image-portal?pivots=container-apps-private-registry).
- [GCP instructions](https://cloud.google.com/run/docs/quickstarts/build-and-deploy).
4. Launch the container on a VM instance based on the Docker image now hosted in your cloud environment. Make sure to load the `.env` and the `config/` directory as volumes that the Docker recognizes as shown in `run.sh`.
You can deploy `vectara-answer` on cloud platforms such as AWS, Azure, or GCP as well as on specialized cloud services like Render or Heroku.
See [detailed instructions](HOSTING.MD)

## FAQs

Expand Down