mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-05-02 17:07:13 +00:00
Update AWS deployment
This commit is contained in:
parent
9242578263
commit
c3fa67bc86
2 changed files with 25 additions and 53 deletions
cloud-deployments/aws/cloudformation
|
@ -3,53 +3,39 @@
|
|||
With an AWS account you can easily deploy a private AnythingLLM instance on AWS. This will create a url that you can access from any browser over HTTP (HTTPS not supported). This single instance will run on your own keys and they will not be exposed - however if you want your instance to be protected it is highly recommend that you set the `AUTH_TOKEN` and `JWT_SECRET` variables in the `docker/` ENV.
|
||||
|
||||
**Quick Launch (EASY)**
|
||||
2. Log in to your AWS account
|
||||
3. Open [CloudFormation](https://us-west-1.console.aws.amazon.com/cloudformation/home)
|
||||
4. Ensure you are deploying in a geographic zone that is nearest to your physical location to reduce latency.
|
||||
5. Click `Create Stack`
|
||||
6. Use the file `create_anythinng_llm_instance.json` as your JSON template.
|
||||
7. Launch. On first boot fill out your ENV keys and you are fully live. Time to boot is approximately 60 seconds.
|
||||
Done.
|
||||
1. Log in to your AWS account
|
||||
2. Open [CloudFormation](https://us-west-1.console.aws.amazon.com/cloudformation/home)
|
||||
3. Ensure you are deploying in a geographic zone that is nearest to your physical location to reduce latency.
|
||||
4. Click `Create Stack`
|
||||
|
||||
**Custom Launch and Build From Source**
|
||||
[Refer to .env.example](../../../docker/HOW_TO_USE_DOCKER.md) for data format.
|
||||

|
||||
|
||||
5. Use the file `cloudformation_create_anythingllm.json` as your JSON template.
|
||||
|
||||

|
||||
|
||||
6. Click Deploy.
|
||||
7. Wait for stack events to finish and be marked as `Completed`
|
||||
8. View `Outputs` tab.
|
||||
|
||||

|
||||
|
||||
9. Wait for all resources to be built. Now wait until instance is available on `[InstanceIP]:3001`.
|
||||
This process may take up to 10 minutes. See **Note** below on how to visualize this process.
|
||||
|
||||
The output of this cloudformation stack will be:
|
||||
- 1 EC2 Instance
|
||||
- 1 Security Group with 0.0.0.0/0 access on Ports 22 & 3001
|
||||
- 1 EC2 Instance Volume `gb2` of 10Gib minimum
|
||||
- 1 Security Group with 0.0.0.0/0 access on port 3001
|
||||
- 1 EC2 Instance Volume `gb2` of 10Gib minimum - customizable pre-deploy.
|
||||
|
||||
**Requirements**
|
||||
- An AWS account with billing information.
|
||||
- AnythingLLM (GUI + document processor) must use a t2.small minimum and 10Gib SSD hard disk volume
|
||||
- `.env` file that is filled out with your settings and set up in the `docker/` folder
|
||||
|
||||
## How to deploy on AWS
|
||||
|
||||
1. Generate your specific cloudformation document by running `yarn generate:cloudformation` from the project root directory.
|
||||
2. Log in to your AWS account
|
||||
3. Open [CloudFormation](https://us-west-1.console.aws.amazon.com/cloudformation/home)
|
||||
4. Ensure you are deploying in a geographic zone that is nearest to your physical location to reduce latency.
|
||||
5. Click `Create Stack`
|
||||
|
||||

|
||||
|
||||
6. Upload your `aws_cf_deploy_anything_llm.json` to the stack
|
||||
|
||||

|
||||
|
||||
7. Click `Next` and give your stack a name. This is superficial.
|
||||
8. No other changes are needed, just proceed though each step
|
||||
9. Click `Submit`
|
||||
10. Wait for stack events to finish and be marked as `Completed`
|
||||
11. View `Outputs` tab.
|
||||
|
||||

|
||||
|
||||
## Please read this notice before submitting issues about your deployment
|
||||
|
||||
**Note:**
|
||||
Your instance will not be available instantly. Depending on the instance size you launched with it can take anywhere from 10-20 minutes to fully boot up.
|
||||
Your instance will not be available instantly. Depending on the instance size you launched with it can take varying amounts of time to fully boot up.
|
||||
|
||||
If you want to check the instance's progress, navigate to [your deployed EC2 instances](https://us-west-1.console.aws.amazon.com/ec2/home) and connect to your instance via SSH in browser.
|
||||
|
||||
|
|
|
@ -83,39 +83,25 @@
|
|||
"#!/bin/bash\n",
|
||||
"# check output of userdata script with sudo tail -f /var/log/cloud-init-output.log\n",
|
||||
"sudo yum install docker -y\n",
|
||||
"sudo usermod -a -G docker ec2-user\n",
|
||||
"curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose\n",
|
||||
"sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose\n",
|
||||
"sudo chmod +x /usr/local/bin/docker-compose\n",
|
||||
"sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose\n",
|
||||
"sudo systemctl enable docker\n",
|
||||
"sudo systemctl start docker\n",
|
||||
"sudo yum install git -y\n",
|
||||
"git clone https://github.com/Mintplex-Labs/anything-llm.git /home/ec2-user/anything-llm\n",
|
||||
"sudo touch /home/ec2-user/anything-llm/server/storage/anythingllm.db\n",
|
||||
"touch /home/ec2-user/anything-llm/server/storage/anythingllm.db\n",
|
||||
"cd /home/ec2-user/anything-llm/docker\n",
|
||||
"cat >> .env << \"END\"\n",
|
||||
"SERVER_PORT=3001\n",
|
||||
"OPEN_AI_KEY=\n",
|
||||
"OPEN_MODEL_PREF='gpt-3.5-turbo'\n",
|
||||
"CACHE_VECTORS=\"true\"\n",
|
||||
"VECTOR_DB=\"lancedb\"\n",
|
||||
"STORAGE_DIR=\"/app/server/storage\"\n",
|
||||
"GOOGLE_APIS_KEY=\n",
|
||||
"UID=\"1000\"\n",
|
||||
"GID=\"1000\"\n",
|
||||
"END\n",
|
||||
"cp .env.example .env\n",
|
||||
"cd ../frontend\n",
|
||||
"rm -rf .env.production\n",
|
||||
"cat >> .env.production << \"END\"\n",
|
||||
"GENERATE_SOURCEMAP=true\n",
|
||||
"VITE_API_BASE=\"/api\"\n",
|
||||
"END\n",
|
||||
"sudo chown ec2-user:ec2-user -R /home/ec2-user/anything-llm\n",
|
||||
"sudo docker-compose -f /home/ec2-user/anything-llm/docker/docker-compose.yml up -d\n",
|
||||
"echo \"Container ID: $(sudo docker ps --latest --quiet)\"\n",
|
||||
"sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) mkdir -p /app/server/storage /app/server/storage/documents /app/server/storage/vector-cache /app/server/storage/lancedb\n",
|
||||
"echo \"Placeholder folders in storage created.\"\n",
|
||||
"sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) chown -R anythingllm:anythingllm /app/collector /app/server\n",
|
||||
"echo \"File permissions corrected.\"\n",
|
||||
"export ONLINE=$(curl -Is http://localhost:3001/api/ping | head -n 1|cut -d$' ' -f2)\n",
|
||||
"echo \"Health check: $ONLINE\"\n",
|
||||
"if [ \"$ONLINE\" = 200 ] ; then echo \"Running migrations...\" && curl -Is http://localhost:3001/api/migrate | head -n 1|cut -d$' ' -f2; fi\n",
|
Loading…
Add table
Add a link
Reference in a new issue