move cloud deployment scripts and readmes into subfolder

This commit is contained in:
timothycarambat 2023-07-20 12:13:40 -07:00
parent c1deca4928
commit ab9304b6dd
13 changed files with 71 additions and 71 deletions

View File

@ -12,7 +12,7 @@ With an AWS account you can easily deploy a private AnythingLLM instance on AWS.
Done.
**Custom Launch**
[Refer to .env.example](../../docker/HOW_TO_USE_DOCKER.md) for data format.
[Refer to .env.example](../../../docker/HOW_TO_USE_DOCKER.md) for data format.
The output of this cloudformation stack will be:
- 1 EC2 Instance
@ -32,11 +32,11 @@ The output of this cloudformation stack will be:
4. Ensure you are deploying in a geographic zone that is nearest to your physical location to reduce latency.
5. Click `Create Stack`
![Create Stack](/images/screenshots/create_stack.png)
![Create Stack](../../../images/screenshots/create_stack.png)
6. Upload your `aws_cf_deploy_anything_llm.json` to the stack
![Upload Stack](/images/screenshots/upload.png)
![Upload Stack](../../../images/screenshots/upload.png)
7. Click `Next` and give your stack a name. This is superficial.
8. No other changes are needed, just proceed though each step
@ -44,7 +44,7 @@ The output of this cloudformation stack will be:
10. Wait for stack events to finish and be marked as `Completed`
11. View `Outputs` tab.
![Stack Output](/images/screenshots/cf_outputs.png)
![Stack Output](../../../images/screenshots/cf_outputs.png)
## Please read this notice before submitting issues about your deployment

View File

@ -15,7 +15,7 @@ import { exit } from 'process';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
const envPath = path.resolve(__dirname, `../../docker/.env`)
const envPath = path.resolve(__dirname, `../../../docker/.env`)
const envFileExists = fs.existsSync(envPath);
const chalk = {

View File

@ -2,7 +2,7 @@
With a DigitalOcean account, you can easily deploy a private AnythingLLM instance using Terraform. 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 recommended that you set the `AUTH_TOKEN` and `JWT_SECRET` variables in the `docker/` ENV.
[Refer to .env.example](../../docker/HOW_TO_USE_DOCKER.md) for data format.
[Refer to .env.example](../../../docker/HOW_TO_USE_DOCKER.md) for data format.
The output of this Terraform configuration will be:
- 1 DigitalOcean Droplet

View File

@ -27,7 +27,7 @@ resource "digitalocean_droplet" "anything_llm_instance" {
}
locals {
env_content = file("../../docker/.env")
env_content = file("../../../docker/.env")
formatted_env_content = join("\n", [
for line in split("\n", local.env_content) :
line

View File

@ -2,7 +2,7 @@
With a GCP account you can easily deploy a private AnythingLLM instance on GCP. 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.
[Refer to .env.example](../../docker/HOW_TO_USE_DOCKER.md) for data format.
[Refer to .env.example](../../../docker/HOW_TO_USE_DOCKER.md) for data format.
The output of this cloudformation stack will be:
- 1 GCP VM

View File

@ -0,0 +1,61 @@
import fs from 'fs';
import { fileURLToPath } from 'url';
import path, { dirname } from 'path';
import { exit } from 'process';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
const envPath = path.resolve(__dirname, `../../../docker/.env`)
const envFileExists = fs.existsSync(envPath);
const chalk = {
redBright: function (text) {
return `\x1b[31m${text}\x1b[0m`
},
cyan: function (text) {
return `\x1b[36m${text}\x1b[0m`
},
greenBright: function (text) {
return `\x1b[32m${text}\x1b[0m`
},
blueBright: function (text) {
return `\x1b[34m${text}\x1b[0m`
}
}
if (!envFileExists) {
console.log(chalk.redBright('[ABORT]'), 'You do not have an .env file in your ./docker/ folder. You need to create it first.');
console.log('You can start by running', chalk.cyan('cp -n ./docker/.env.example ./docker/.env'))
exit(1);
}
// Remove comments
// Remove UID,GID,etc
// Remove empty strings
// Split into array
const settings = fs.readFileSync(envPath, "utf8")
.replace(/^#.*\n?/gm, '')
.replace(/^UID.*\n?/gm, '')
.replace(/^GID.*\n?/gm, '')
.replace(/^CLOUD_BUILD.*\n?/gm, '')
.replace(/^\s*\n/gm, "")
.split('\n')
.filter((i) => !!i);
const formattedSettings = settings.map((i, index) => index === 0 ? i + '\n' : ' ' + i).join('\n');
// Read the existing GCP Deployment Manager template
const templatePath = path.resolve(__dirname, `gcp_deploy_anything_llm.yaml`);
const templateString = fs.readFileSync(templatePath, "utf8");
// Update the metadata section with the UserData content
const updatedTemplateString = templateString.replace(REPLACEMENT_KEY, formattedSettings);
// Save the updated GCP Deployment Manager template
const output = path.resolve(__dirname, `gcp_deploy_anything_llm_with_env.yaml`);
fs.writeFileSync(output, updatedTemplateString, "utf8");
console.log(chalk.greenBright('[SUCCESS]'), 'Deploy AnythingLLM on GCP Deployment Manager using your template document.');
console.log(chalk.greenBright('File Created:'), 'gcp_deploy_anything_llm_with_env.yaml in the output directory.');
console.log(chalk.blueBright('[INFO]'), 'Refer to the GCP Deployment Manager documentation for how to use this file.');
exit();

View File

@ -1,61 +0,0 @@
import fs from 'fs';
import { fileURLToPath } from 'url';
import path, { dirname } from 'path';
import { exit } from 'process';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
const envPath = path.resolve(__dirname, `../../docker/.env`)
const envFileExists = fs.existsSync(envPath);
const chalk = {
redBright: function (text) {
return `\x1b[31m${text}\x1b[0m`
},
cyan: function (text) {
return `\x1b[36m${text}\x1b[0m`
},
greenBright: function (text) {
return `\x1b[32m${text}\x1b[0m`
},
blueBright: function (text) {
return `\x1b[34m${text}\x1b[0m`
}
}
if (!envFileExists) {
console.log(chalk.redBright('[ABORT]'), 'You do not have an .env file in your ./docker/ folder. You need to create it first.');
console.log('You can start by running', chalk.cyan('cp -n ./docker/.env.example ./docker/.env'))
exit(1);
}
// Remove comments
// Remove UID,GID,etc
// Remove empty strings
// Split into array
const settings = fs.readFileSync(envPath, "utf8")
.replace(/^#.*\n?/gm, '')
.replace(/^UID.*\n?/gm, '')
.replace(/^GID.*\n?/gm, '')
.replace(/^CLOUD_BUILD.*\n?/gm, '')
.replace(/^\s*\n/gm, "")
.split('\n')
.filter((i) => !!i);
const formattedSettings = settings.map((i, index) => index === 0 ? i + '\n' : ' ' + i).join('\n');
// Read the existing GCP Deployment Manager template
const templatePath = path.resolve(__dirname, `gcp_deploy_anything_llm.yaml`);
const templateString = fs.readFileSync(templatePath, "utf8");
// Update the metadata section with the UserData content
const updatedTemplateString = templateString.replace(REPLACEMENT_KEY, formattedSettings);
// Save the updated GCP Deployment Manager template
const output = path.resolve(__dirname, `gcp_deploy_anything_llm_with_env.yaml`);
fs.writeFileSync(output, updatedTemplateString, "utf8");
console.log(chalk.greenBright('[SUCCESS]'), 'Deploy AnythingLLM on GCP Deployment Manager using your template document.');
console.log(chalk.greenBright('File Created:'), 'gcp_deploy_anything_llm_with_env.yaml in the output directory.');
console.log(chalk.blueBright('[INFO]'), 'Refer to the GCP Deployment Manager documentation for how to use this file.');
exit();

View File

@ -16,8 +16,8 @@
"dev:frontend": "cd frontend && yarn start",
"prod:server": "cd server && yarn start",
"prod:frontend": "cd frontend && yarn build",
"generate:cloudformation": "node aws/cloudformation/generate.mjs",
"generate::gcp_deployment": "node gcp/deployment/generate.mjs"
"generate:cloudformation": "node cloud-deployments/aws/cloudformation/generate.mjs",
"generate::gcp_deployment": "node cloud-deployments/gcp/deployment/generate.mjs"
},
"private": false
}