diff --git a/.github/workflows/build_and_push_docker.yml b/.github/workflows/build_and_push_docker.yml deleted file mode 100644 index 049cb7c731..0000000000 --- a/.github/workflows/build_and_push_docker.yml +++ /dev/null @@ -1,51 +0,0 @@ -# -name: Create and publish single container image - -on: - release: - types: [published] - workflow_dispatch: - inputs: - tags: - description: "tags to attach to image" - required: false - type: string - -env: - REGISTRY: ghcr.io - IMAGE_NAME: cohere-toolkit - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/cohere-ai/${{ env.IMAGE_NAME }} - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - file: ./standalone.Dockerfile - - name: Test the Docker image - run: | - docker run -d -p 8000:8000 ${{ env.REGISTRY }}/cohere-ai/${{ env.IMAGE_NAME }} - sleep 20 - curl --fail-with-body -s http://localhost:8000/health diff --git a/.github/workflows/build_and_push_docker_proxy.yml b/.github/workflows/build_and_push_docker_proxy.yml deleted file mode 100644 index d75f60d304..0000000000 --- a/.github/workflows/build_and_push_docker_proxy.yml +++ /dev/null @@ -1,57 +0,0 @@ -# -name: Create and publish single container image with nginx proxy - -on: - release: - types: [published] - workflow_dispatch: - inputs: - tags: - description: "tags to attach to image" - required: false - type: string - -env: - REGISTRY: ghcr.io - IMAGE_NAME: cohere-toolkit-proxy - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/cohere-ai/${{ env.IMAGE_NAME }} - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - file: ./Dockerfile - - name: Test the Docker image - run: | - docker run -d -p 8000:8000 $REGISTRY/cohere-ai/$IMAGE_NAME - sleep 30 - status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/health) - if [ $status_code -eq 200 ]; then - echo "Backend started successfully" - else - echo "Backend failed to start" - exit 1 - fi diff --git a/README.md b/README.md index 06b79b7dc8..eb5b525042 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Toolkit is a deployable all-in-one RAG application that enables users to quickly There are two main ways of running Toolkit: -1. **(Recommended) Docker Compose setup** +**Docker Compose setup** Note: to include community tools when building locally, set the `INSTALL_COMMUNITY_DEPS` build arg in the `docker-compose.yml` to `true`. @@ -38,16 +38,6 @@ cd cohere-toolkit make first-run ``` -2. **Docker Image setup** - -We offer pre-built Docker images as well that you can run, but note that they might contain out-of-date code, so the local compose setup is preferred. - -```bash -docker run -e COHERE_API_KEY='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest -``` - -Go to [localhost:4000](http://localhost:4000/) in your browser and start chatting with Cohere's Command model! - ## GitHub Codespaces To run this project using GitHub Codespaces, please refer to our [Codespaces Setup Guide](/docs/github_codespaces.md). diff --git a/docs/deployment_guides/aws_ecs_single_container.md b/docs/deployment_guides/aws_ecs_single_container.md deleted file mode 100644 index 9360cde0a7..0000000000 --- a/docs/deployment_guides/aws_ecs_single_container.md +++ /dev/null @@ -1,127 +0,0 @@ -## Amazon Elastic Container Service (ECS) Deployment - -### Requirements: -- AWS account -- Docker installed -- Docker image of the Toolkit from the public registry -- Cohere API key -- AWS CLI installed and configured -- VPC -- Subnets -- Security groups -- Load balancer -- ECS Cluster -- ECS Task definition -- ECS Service - -### Optional requirements: -- Route 53 domain name (for a custom domain name) -- ECR registry (to deploy the image to) - -### Deployment Steps: - -1. **Docker Image** - The Toolkit Docker image is available on the public registry at `ghcr.io/cohere-ai/cohere-toolkit`. - Optionally, you can push the image to your own ECR registry. To do this: - - Build the image and tag it with the ECR registry URL: - ```bash - docker build -t cohere-ai/toolkit . -f standalone.Dockerfile - docker tag cohere-ai/toolkit :latest - ``` - If your PC is ARM processor-based, use this command to avoid architecture mismatch errors: - ```bash - docker buildx build --platform linux/amd64 -t cohere-ai/toolkit . -f standalone.Dockerfile - docker tag cohere-ai/toolkit :latest - ``` - - Push the image to the ECR registry: - ```bash - aws ecr get-login-password --region | docker login --username AWS --password-stdin - docker push :latest - ``` - -2. **Create Security Groups for Load Balancer** - Go to the EC2 dashboard, select Security Groups, and create a new security group with the following inbound rules: - - Type: Custom TCP Rule, Port Range: 8000, Source: Anywhere IPv4 - - Type: Custom TCP Rule, Port Range: 4000, Source: Anywhere IPv4 - Note the security group IDs for later use. - -3. **Create Security Groups for ECS Instances** - Create a new security group with the following inbound rules: - - Type: Custom TCP Rule, Port Range: 8000, Source: Security Group ID of the load balancer security group - - Type: Custom TCP Rule, Port Range: 4000, Source: Security Group ID of the load balancer security group - Note the security group IDs for later use. - -4. **Create Load Balancer** - Create a new load balancer with the following settings: - - Type: Application Load Balancer - - Listeners: HTTP:8000, HTTP:4000 - - Security Groups: Security Group ID of the load balancer security group created in step 2 - - Target Groups: Create a new target group with the following settings: - - **API:** - - Protocol: HTTP - - Port: 8000 - - Health Check Path: /health - - Health Check Port: traffic-port - - Health Check Protocol: HTTP - - Health Check Interval: 30 seconds - - Health Check Timeout: 5 seconds - - Healthy Threshold Count: 5 - - Unhealthy Threshold Count: 2 - - Target Type: IP addresses - - Protocol Version: HTTP1 - - VPC: Default VPC - - **Frontend:** - - Protocol: HTTP - - Port: 4000 - - Health Check Path: / - - Health Check Port: traffic-port - - Health Check Protocol: HTTP - - Health Check Interval: 30 seconds - - Health Check Timeout: 5 seconds - - Healthy Threshold Count: 5 - - Unhealthy Threshold Count: 2 - - Target Type: IP addresses - - Protocol Version: HTTP1 - - VPC: Default VPC - Note the target group ARNs, load balancer ARN, and load balancer DNS name for later use. - -5. **Create ECS Cluster (Fargate)** - Create a new ECS cluster with the following settings: - - Cluster name: ToolkitCluster - Note the cluster name for later use. - -6. **Create ECS Task Definition** - Create a new ECS Task definition with the following settings: - - Task Definition Name: ToolkitTask - - Launch Type: Fargate - - Operating System: Linux/X86_64 - - Task Memory: 8GB - - Task CPU: 4 vCPU - - Task Role: ecsTaskExecutionRole - - Network Mode: awsvpc - - Container Definitions: Add a new container with the following settings: - - Name: ToolkitContainer - - Image: \/toolkit:latest or ghcr.io/cohere-ai/cohere-toolkit - - Port Mappings: 8000:8000, 4000:4000 - - Environment Variables: COHERE_API_KEY=\ - - Environment Variables: NEXT_PUBLIC_API_HOSTNAME='http://\:8000' from step 4 - Note the task definition ARN and container name for later use. - -7. **Create ECS Service Using AWS CLI** - Since the ECS console does not support creating a service with multiple target groups, follow these steps: - - Modify the `ecs-service.json` file to include the correct values for your setup: - - Service name - - Cluster name from step 5 - - Target group ARNs from step 4 - - Container name from step 6 - - Task definition ARN from step 6 - - Subnet IDs from the default subnets in your VPC - - Security group IDs from the security groups created in step 3 - - Run the following command to create the service: - ```bash - aws ecs create-service --service-name ToolkitService --region --cli-input-json file://ecs_service.json - ``` - -After the service is created, you can access the Toolkit frontend at `http://:4000` and the API at `http://:8000/docs`. - -You can follow these instructions to deploy the frontend and API separately by creating two separate services and load balancers. \ No newline at end of file diff --git a/docs/deployment_guides/aws_ecs_single_container_ec2.md b/docs/deployment_guides/aws_ecs_single_container_ec2.md deleted file mode 100644 index 983f59ebc5..0000000000 --- a/docs/deployment_guides/aws_ecs_single_container_ec2.md +++ /dev/null @@ -1,86 +0,0 @@ -## Amazon Elastic Container Service (ECS) Deployment Guide - -### Requirements -- **AWS Account** -- **Docker Installed** -- **Cohere API Key** -- **AWS CLI Installed and Configured** -- **VPC, Subnets, Security Groups** -- **EC2 Instance** -- **ECS Cluster** -- **ECS Task Definition** -- **ECS Service** - -**Optional:** -- Route 53 Domain Name (for custom domain) -- ECR Registry (for deploying the image) - -### Deployment Steps - -#### 1. Prepare Docker Image -You can use the public Docker image or push it to your own Amazon ECR registry. - -- **To use the public image:** - ```bash - docker run -e COHERE_API_KEY='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest - ``` - -- **To build and push to ECR:** - ```bash - docker build -t cohere-ai/toolkit . -f standalone.Dockerfile - docker tag cohere-ai/toolkit :latest - - # If using ARM processor - docker buildx build --platform linux/amd64 -t cohere-ai/toolkit . -f standalone.Dockerfile - docker tag cohere-ai/toolkit :latest - - # Push the image to ECR - aws ecr get-login-password --region | docker login --username AWS --password-stdin - docker push :latest - ``` - -#### 2. Create ECS Cluster -- Go to the ECS dashboard and create a new cluster: - - **Cluster Name:** ToolkitCluster - - **Infrastructure:** Amazon EC2 instances - - **Auto Scaling Group:** Create new ASG - - **Provisioning:** Choose On-Demand or Spot Instance - - **EC2 Instance Type:** t3.xlarge - - **Desired Capacity:** Minimum/Maximum: 1 - - **Network Settings:** Select your VPC, subnets, and create a security group with the following inbound rules: - - Custom TCP Rule, Port Range: 8000 (Source: Anywhere IPv4) - - Custom TCP Rule, Port Range: 4000 (Source: Anywhere IPv4) - - **Auto-assign Public IP:** On - -#### 3. Create ECS Task Definition -- Define a new task with the following settings: - - **Task Definition Family:** ToolkitTask - - **Launch Type:** Amazon EC2 - - **Network Mode:** Host - - **Task CPU:** 3 vCPU - - **Task Memory:** 12 GB - - **Container Definitions:** Add a new container: - - **Name:** ToolkitContainer - - **Image:** `/toolkit:latest` or `ghcr.io/cohere-ai/cohere-toolkit:latest` - - **Port Mappings:** TCP 8000:8000, 4000:4000 - - **Environment Variables:** - - `COHERE_API_KEY=` - - `NEXT_PUBLIC_API_HOSTNAME='http://:8000'` - -#### 4. Create ECS Service -- Create a new service: - - **Existing Cluster:** ToolkitCluster - - **Task Definition:** ToolkitTask - - **Service Name:** ToolkitService - - **Desired Tasks:** 1 - - **Deployment Configuration:** Rolling update - - Click **Create** to set up the service. - -### Accessing the Toolkit -Once the service is running, access the Toolkit frontend at: -- **Frontend:** `http://:4000` -- **API Documentation:** `http://:8000/docs` - -### Notes -- This guide provides a sample deployment for demonstration purposes; it is not recommended for production use. -- You can deploy the frontend and API as separate services if needed. diff --git a/docs/deployment_guides/gcp_one_click_deployment.md b/docs/deployment_guides/gcp_one_click_deployment.md deleted file mode 100644 index 711755a90e..0000000000 --- a/docs/deployment_guides/gcp_one_click_deployment.md +++ /dev/null @@ -1,71 +0,0 @@ -# Google Cloud Platform One-Click Deployment Guide - -Before deploying to Google Cloud Run, you'll need a PostgreSQL database accessible to your Google Cloud Project, authenticated by a username and password. You'll be prompted for a `DATABASE_URL` before the container builds. - -[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?dir=/) - -## Deployment Steps - -After clicking the button above, you'll be taken to the Google Cloud Console. Follow these steps to deploy the Toolkit: - -1. **Select a Project**: Choose the Google Cloud Project you want to deploy the Toolkit to. If you don't have a project, you need to create [one](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - -2. **Set the Region**: Choose the region you want to deploy the Toolkit to. - -3. **Set the `DATABASE_URL` Environment Variable**: Enter the connection string in the format: - - ``` - postgresql+psycopg2://USERNAME:PASSWORD@HOST:PORT/DB_NAME - ``` - - The `HOST` value here is the public IP address of your provisioned PostgreSQL database, and the default `PORT` is 5432. Use the username and password pair you set when creating your SQL instance. For example: - - ``` - postgresql+psycopg2://myuser:mypassword@:5432/toolkit - ``` - -4. **Set the Cohere API Key**: Enter your Cohere API key, which you can create on the [Cohere Dashboard](https://dashboard.cohere.com). - -5. **Allow Access to the Git Registries**: Click 'Yes' to allow access to the Git registries. - -## Post-Deployment Steps - -Once the deployment process is complete, you can access the Toolkit by navigating to the URL provided in the Google Cloud Shell. - -To retrieve this URL using the GCP console, follow these steps: - -1. Click on the "Cloud Run" button on the left side of the screen. -2. Click on the `toolkit-deploy` service. -3. Click on the "URL" link to open the Toolkit in a new tab. - -## Possible Deployment Errors - -If the deployment is stuck on pushing the image to the Container Registry, close the shell and try to redeploy the service. - -If the deployment is stuck in a pending state or you lose connection to your Google Cloud Shell (as shown below): - -![Cloud Shell Stuck](path/to/your/image.png) - -or you receive an nginx 502 error when trying to access the Toolkit URL, it indicates that the deployment process was not completed successfully. In this case, you'll need to create a new revision for your deployment with the correct settings. - -### To Create a New Revision: - -1. Navigate to the Google Cloud Console. -2. Click on the "Cloud Run" button on the left side of the screen. -3. Click on the `toolkit-deploy` service. -4. Click on the "Edit & Deploy New Revision" button. -5. Scroll down to the "Health checks" section. -6. Delete the existing health check. -7. Click on the "Add health check" button: - - **Select health check type**: Startup check - - **Select probe type**: HTTP - - **Path (e.g., /ready)**: `/api/health` - - **Port**: `4000` - - **Initial delay**: `0` - - **Period**: `1` - - **Failure threshold**: `120` - - **Timeout**: `1` - - Click the "Add" button. -8. Click the "Deploy" button. - -By following these steps, you should be able to resolve any deployment issues and successfully run the Toolkit on Google Cloud. \ No newline at end of file diff --git a/docs/deployment_guides/single_container.md b/docs/deployment_guides/single_container.md deleted file mode 100644 index cf9dbc113d..0000000000 --- a/docs/deployment_guides/single_container.md +++ /dev/null @@ -1,102 +0,0 @@ -# Single Container Setup Guide - -This guide will show you how to build and start Cohere's Toolkit using a single container setup. This container can also be deployed to your cloud platform if needed. - -**Note:** Azure Container Instances and Cloud Run are stateless; thus, you will lose all your PostgreSQL data with each restart. - -## Cloud Deployment - -You can deploy the Toolkit with one click on the Microsoft Azure Platform: - -[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcohere-ai%2Fcohere-toolkit%2Fmain%2Fazuredeploy.json) - -This deployment type uses **Azure Container Instances** to host the Toolkit. - -### After Deployment: -1. **Check the Logs:** - - Click on the "Containers" button on the left side of the screen. - - Click on the container name. - - Click on the "Logs" tab to see the logs and verify if the container is running successfully. - -2. **Navigate to the Overview:** - - Go to the "Overview" tab to find the Fully Qualified Domain Name (FQDN) of your container instance. - -3. **Access the Toolkit:** - - Open `:4000` in your browser to access the Toolkit. - -### AWS ECS Deployment Guides -- [AWS ECS Fargate Deployment](aws_ecs_single_container.md): Deploy the Toolkit single container to AWS ECS (Fargate). -- [AWS ECS EC2 Deployment](docs/deployment_guides/aws_ecs_single_container_ec2.md): Deploy the Toolkit single container to AWS ECS (EC2). - -## Build and Start - -### Option 1 - Build from Source - -To build the Toolkit locally in a single container, run the following command: -```bash -docker build -t cohere-ai/toolkit . -f standalone.Dockerfile -``` - -Then, run the container with: -```bash -docker run --name=cohere-toolkit -itd -e COHERE_API_KEY='Your Cohere API key here' -p 8000:8000 -p 4000:4000 cohere-ai/cohere-toolkit -``` - -**For Community Features:** -If you need to use community features, run the container with: -```bash -docker run --name=cohere-toolkit -itd -e INSTALL_COMMUNITY_DEPS='true' -e COHERE_API_KEY='Your Cohere API key here' -p 8000:8000 -p 4000:4000 cohere-ai/cohere-toolkit -``` - -**Using a `.env` File:** -To pass parameters using a `.env` file, mount it to the container: -```bash -docker run --name=cohere-toolkit -itd --env-file .env -p 8000:8000 -p 4000:4000 cohere-ai/cohere-toolkit -``` -> Ensure that `INSTALL_COMMUNITY_DEPS=true` is set in your `.env` file if you need community features. - -### Option 2 - Pull from Registry - -You can also pull a prebuilt image from the `cohere-ai` registry: -```bash -docker pull ghcr.io/cohere-ai/cohere-toolkit:latest -``` - -Then, run the container with: -```bash -docker run --name=cohere-toolkit -itd -e COHERE_API_KEY='Your Cohere API key here' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit -``` - -**Using a `.env` File:** -To use a `.env` file for configuration: -```bash -docker run --name=cohere-toolkit -itd --env-file .env -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit -``` - -### Important Notes - -- After running the container, wait a bit for all services to start up. You can check the logs with: -```bash -docker logs cohere-toolkit -``` -- Alternatively, check the status of the container using Docker Desktop. - -### Accessing the Toolkit - -After either build option, access the APIs at: -- **API Documentation**: `http://localhost:8000/docs` -- **Frontend Toolkit App**: `http://localhost:4000` - -### Managing the Container - -- **To Stop the Container:** -```bash -docker stop cohere-toolkit -``` - -- **To Start the Container Again:** -```bash -docker start cohere-toolkit -``` - -This completes the single container setup guide for Cohere's Toolkit. \ No newline at end of file diff --git a/docs/service_deployments.md b/docs/service_deployments.md index 65fe16a919..3b376fde1e 100644 --- a/docs/service_deployments.md +++ b/docs/service_deployments.md @@ -4,45 +4,7 @@ Looking to serve your application in production? Deploy the Toolkit to your pref ## Services Deployment Options -1. **[Single Container Setup](deployment_guides/single_container.md)** - Useful as a quickstart to run the Toolkit or deploy to AWS on an EC2 instance. - -2. **[AWS ECS Fargate Deployment](deployment_guides/aws_ecs_single_container.md)** - Deploy the Toolkit single container to AWS ECS (Fargate). - -3. **[AWS ECS EC2 Deployment](deployment_guides/aws_ecs_single_container_ec2.md)** - Deploy the Toolkit single container to AWS ECS (EC2). - -4. **[Google Cloud Platform](deployment_guides/gcp_deployment.md)** +1. **[Google Cloud Platform](deployment_guides/gcp_deployment.md)** Help setup your Cloud SQL instance, then build, push, and deploy backend + frontend containers to Cloud Run. -5. **[One Click Deploy to GCP](deployment_guides/gcp_one_click_deployment.md)** - [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?dir=/) - - After clicking the above, continue the steps in the linked guide. - -6. **Deploying to Azure Container Instance** - You can deploy the Toolkit with one click to Microsoft Azure Platform: - [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcohere-ai%2Fcohere-toolkit%2Fmain%2Fazuredeploy.json) - - After your deployment is complete, click the "Go to resource" button. - - Check the logs to see if the container is running successfully: - - Click on the "Containers" button on the left side of the screen. - - Click on the container name. - - Click on the "Logs" tab to see the logs. - - Navigate to the "Overview" tab to see the FQDN of the container instance. - - Open the `:4000` in your browser to access the Toolkit. - -7. **Deploying to Azure Cloud App** - You can deploy the Toolkit with one click to Microsoft Azure Platform: - [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcohere-ai%2Fcohere-toolkit%2Fmain%2Fazuredeploy.hpa.json) - - Select your subscription and resource group. If you don't have a resource group, create a new one. - - Enter the connection string in the format: - `postgresql+psycopg2://USERNAME:PASSWORD@HOST:PORT/DB_NAME` - Ensure `HOST` is the Public IP or DNS name of your PostgreSQL database. - - Enter your Cohere API key. - - Click "Review + create" and then "Create" to deploy the Toolkit. - - After the deployment, click on the "Go to resource group" button. - - Click on the Toolkit container app. - - Click on the "Overview" tab to see the "Application URL" of the container app. - - Navigate to the "Application URL" to access the Toolkit. - - To scale the Toolkit, you can enable Automatic Horizontal Scaling by following this [tutorial](https://learn.microsoft.com/en-us/azure/container-apps/tutorial-scaling). +Note: Currently AWS and Azure deployments with Docker Compose are being worked on. diff --git a/docs/setup.md b/docs/setup.md index 03f8ab2add..e627262c95 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -18,22 +18,6 @@ - Create a `configuration.yaml` file based on `configuration.template.yaml`. - Replace the placeholders with your actual values. -### Running Docker Image Locally - -1. **Run the Docker Image**: - For the default toolkit: - ```bash - docker run -e COHERE_API_KEY='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest - ``` - For community features: - ```bash - docker run -e INSTALL_COMMUNITY_DEPS='true' -e COHERE_API='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest - ``` - -2. **Access the Toolkit**: - Navigate to [http://localhost:4000](http://localhost:4000) in your browser. - - ### Environment Setup for Windows/MacOS - **Windows**: Follow the detailed setup provided for PowerShell and conda environment. diff --git a/docs/walkthrough/walkthrough.md b/docs/walkthrough/walkthrough.md index 6affa6536e..107f8be4b8 100644 --- a/docs/walkthrough/walkthrough.md +++ b/docs/walkthrough/walkthrough.md @@ -124,7 +124,7 @@ We have a [detailed guide for auth here](../auth_guide.md). Note authentication

Cloud Deployment

-Cloud Deployment's are options for you to deploy your application to a cloud. We have detailed instructions and one click deployment options for cloud providers. +Cloud Deployment's are options for you to deploy your application to a cloud. Pre-built cloud deployments which your can customize to your needs include: - Google Cloud Provider (GCP) diff --git a/standalone.Dockerfile b/standalone.Dockerfile deleted file mode 100644 index 2f584e1c62..0000000000 --- a/standalone.Dockerfile +++ /dev/null @@ -1,117 +0,0 @@ -FROM ghcr.io/cohere-ai/terrarium:latest as terrarium - -FROM python:3.11-buster -LABEL authors="Cohere" -## set ENV for python -ENV PYTHON_VERSION=3.11.8 -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 -ENV PYTHONIOENCODING=utf-8 -ENV LANG C.UTF-8 -ENV PYTHONPATH=/workspace/src/ -# "Activate" the venv manually for the context of the container -ENV VIRTUAL_ENV=/workspace/.venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -# Keep the poetry venv name and location predictable -ENV POETRY_VIRTUALENVS_IN_PROJECT=true - -#install Sqlite3 > 3.35 for Chroma DB -RUN cd /usr/src \ - && wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz \ - && tar zxvf sqlite-autoconf-3450300.tar.gz \ - && cd sqlite-autoconf-3450300 \ - && ./configure \ - && make \ - && make install \ - && rm -rf /usr/src/sqlite-autoconf-3450300.tar.gz /usr/src/sqlite-autoconf-3450300 - -# Install poetry -RUN pip3 install --no-cache-dir poetry==1.6.1 - -WORKDIR /workspace - -# Copy dependency files to avoid cache invalidations -COPY pyproject.toml poetry.lock README.md ./ - -# Install dependencies -RUN poetry install - -# Copy the rest of the code -COPY src/backend src/backend - -# Install PostgreSQL -ENV PG_APP_HOME="/etc/docker-postgresql" \ - PG_VERSION=14 \ - PG_USER=postgres \ - PG_HOME=/var/lib/postgresql \ - PG_RUNDIR=/run/postgresql \ - PG_LOGDIR=/var/log/postgresql \ - PG_CERTDIR=/etc/postgresql/certs \ - PG_TRUST_LOCALNET=true \ - DB_USER=postgre \ - DB_PASS=postgre \ - DB_NAME=toolkit - -ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \ - PG_DATADIR=${PG_HOME}/${PG_VERSION}/main - -RUN set -ex \ - && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ - && apt-get update -y \ - && apt-get install -f -y acl sudo locales \ - postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} \ - && update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \ - && locale-gen en_US.UTF-8 \ - && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales \ - && ln -sf ${PG_DATADIR}/postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf \ - && ln -sf ${PG_DATADIR}/pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf \ - && ln -sf ${PG_DATADIR}/pg_ident.conf /etc/postgresql/${PG_VERSION}/main/pg_ident.conf \ - && rm -rf ${PG_HOME} \ - && rm -rf /var/lib/apt/lists/* - -COPY docker_scripts/ ${PG_APP_HOME}/ -COPY docker_scripts/entrypoint.sh /sbin/entrypoint.sh -RUN chmod 755 /sbin/entrypoint.sh \ -# Install nodejs - && curl -sL https://deb.nodesource.com/setup_18.x | bash - \ - && apt-get install -y nodejs \ - && npm install -g pnpm \ -# pm2 to start frontend - && npm install -g pm2 - -# ENV for frontend - - -# Install frontend dependencies -WORKDIR /workspace/src/interfaces/assistants_web -COPY src/interfaces/assistants_web/src ./src -COPY src/interfaces/assistants_web/public ./public -COPY src/interfaces/assistants_web/next.config.mjs . -COPY src/interfaces/assistants_web/tsconfig.json . -COPY src/interfaces/assistants_web/tailwind.config.js . -COPY src/interfaces/assistants_web/postcss.config.js . -COPY src/interfaces/assistants_web/package.json src/interfaces/assistants_web/yarn.lock* src/interfaces/assistants_web/package-lock.json* src/interfaces/assistants_web/pnpm-lock.yaml* ./ -COPY src/interfaces/assistants_web/.env.development . -COPY src/interfaces/assistants_web/.env.production . - -RUN npm install - -# Terrarium -WORKDIR /usr/src/app -RUN npm install -g ts-node -COPY --from=terrarium /usr/src/app/package*.json ./ -RUN npm install \ - && npm prune --production -COPY --from=terrarium /usr/src/app/. . -ENV ENV_RUN_AS "docker" - -# Ports to expose -EXPOSE 5432/tcp -EXPOSE 8000/tcp -EXPOSE 4000/tcp -EXPOSE 8080/tcp -WORKDIR ${PG_HOME} - -CMD ["/sbin/entrypoint.sh"]