Skip to content

Commit

Permalink
More detailed hosting docs (#76)
Browse files Browse the repository at this point in the history
* initial

* initial cloud formation script

* added render hosting instructions
  • Loading branch information
ofermend committed Oct 24, 2023
1 parent 1159cdc commit d8381ae
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
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".
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

0 comments on commit d8381ae

Please sign in to comment.