Skip to content

Commit

Permalink
Deployment guide updates
Browse files Browse the repository at this point in the history
  • Loading branch information
itaismith committed Oct 7, 2024
1 parent 52ab61b commit 47c494c
Show file tree
Hide file tree
Showing 9 changed files with 889 additions and 180 deletions.
248 changes: 248 additions & 0 deletions deployments/aws/chroma.cf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create a stack that runs Chroma hosted on a single instance",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "String",
"ConstraintDescription": "If present, must be the name of an existing EC2 KeyPair.",
"Default": ""
},
"InstanceType": {
"Description": "EC2 instance type",
"Type": "String",
"Default": "t3.small"
},
"ChromaVersion": {
"Description": "Chroma version to install",
"Type": "String",
"Default": "0.5.11"
},
"ChromaServerAuthCredentials": {
"Description": "Chroma authentication credentials",
"Type": "String",
"Default": "\"\""
},
"ChromaServerAuthProvider" : {
"Description": "Chroma authentication provider",
"Type": "String",
"Default": "\"\"",
"AllowedValues": [
"",
"\"\"",
"chromadb.auth.token_authn.TokenAuthenticationServerProvider",
"chromadb.auth.basic_authn.BasicAuthenticationServerProvider"
]
},
"ChromaAuthTokenTransportHeader": {
"Description": "Chroma authentication custom token header",
"Type": "String",
"Default": "\"\""
}
},
"Conditions": {
"HasKeyName": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "KeyName"
},
""
]
}
]
}
},
"Resources": {
"ChromaInstance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": {
"Fn::FindInMap": [
"Region2AMI",
{
"Ref": "AWS::Region"
},
"AMI"
]
},
"InstanceType": {
"Ref": "InstanceType"
},
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash\n",
"amazon-linux-extras install docker -y\n",
"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",
"chmod +x /usr/local/bin/docker-compose\n",
"ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose\n",
"systemctl enable docker\n",
"systemctl start docker\n",
"\n",
"mkdir -p /home/ec2-user/config\n",
"curl -o /home/ec2-user/docker-compose.yml https://s3.amazonaws.com/public.trychroma.com/cloudformation/assets/docker-compose.yml\n",
{
"Fn::Sub": "sed -i 's/CHROMA_VERSION/${ChromaVersion}/g' /home/ec2-user/docker-compose.yml\n"
},
"chown ec2-user:ec2-user /home/ec2-user/docker-compose.yml\n",
"# Create .env file\n",
{
"Fn::Sub": "echo 'CHROMA_SERVER_AUTHN_CREDENTIALS=${ChromaServerAuthCredentials}' >> /home/ec2-user/.env\n"
},
{
"Fn::Sub": "echo 'CHROMA_SERVER_AUTHN_PROVIDER=${ChromaServerAuthProvider}' >> /home/ec2-user/.env\n"
},
{
"Fn::Sub": "echo 'CHROMA_AUTH_TOKEN_TRANSPORT_HEADER=${ChromaAuthTokenTransportHeader}' >> /home/ec2-user/.env\n"
},
"chown ec2-user:ec2-user /home/ec2-user/.env\n",
"cd /home/ec2-user\n",
"sudo -u ec2-user docker-compose up -d\n"
]
]
}
},
"SecurityGroupIds": [
{
"Ref": "ChromaInstanceSecurityGroup"
}
],
"KeyName": {
"Fn::If": [
"HasKeyName",
{
"Ref": "KeyName"
},
{
"Ref": "AWS::NoValue"
}
]
},
"BlockDeviceMappings": [
{
"DeviceName": {
"Fn::FindInMap": [
"Region2AMI",
{
"Ref": "AWS::Region"
},
"RootDeviceName"
]
},
"Ebs": {
"VolumeSize": 24
}
}
]
}
},
"ChromaInstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Chroma Instance Security Group",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "8000",
"ToPort": "8000",
"CidrIp": "0.0.0.0/0"
}
]
}
}
},
"Outputs": {
"ServerIp": {
"Description": "IP address of the Chroma server",
"Value": {
"Fn::GetAtt": [
"ChromaInstance",
"PublicIp"
]
}
}
},
"Mappings": {
"Region2AMI": {
"ap-south-1": {
"AMI": "ami-0700df939e7249d03",
"RootDeviceName": "/dev/xvda"
},
"eu-north-1": {
"AMI": "ami-040bf52c6d056e2e8",
"RootDeviceName": "/dev/xvda"
},
"eu-west-3": {
"AMI": "ami-04e3030019c3f0f44",
"RootDeviceName": "/dev/xvda"
},
"eu-west-2": {
"AMI": "ami-0d729d2846a86a9e7",
"RootDeviceName": "/dev/xvda"
},
"eu-west-1": {
"AMI": "ami-0ea0f26a6d50850c5",
"RootDeviceName": "/dev/xvda"
},
"ap-northeast-3": {
"AMI": "ami-0f8a30a8b49a72ed4",
"RootDeviceName": "/dev/xvda"
},
"ap-northeast-2": {
"AMI": "ami-00a5b84c0873f8c3f",
"RootDeviceName": "/dev/xvda"
},
"ap-northeast-1": {
"AMI": "ami-072bfb8ae2c884cc4",
"RootDeviceName": "/dev/xvda"
},
"ca-central-1": {
"AMI": "ami-0843f7c45354d48b5",
"RootDeviceName": "/dev/xvda"
},
"sa-east-1": {
"AMI": "ami-0555c5c3b52744258",
"RootDeviceName": "/dev/xvda"
},
"ap-southeast-1": {
"AMI": "ami-05bf0125f616dc488",
"RootDeviceName": "/dev/xvda"
},
"ap-southeast-2": {
"AMI": "ami-06fdec94cc3067ad1",
"RootDeviceName": "/dev/xvda"
},
"eu-central-1": {
"AMI": "ami-0e2031728ef69a466",
"RootDeviceName": "/dev/xvda"
},
"us-east-1": {
"AMI": "ami-026b57f3c383c2eec",
"RootDeviceName": "/dev/xvda"
},
"us-east-2": {
"AMI": "ami-089a545a9ed9893b6",
"RootDeviceName": "/dev/xvda"
},
"us-west-1": {
"AMI": "ami-0e0ece251c1638797",
"RootDeviceName": "/dev/xvda"
},
"us-west-2": {
"AMI": "ami-0b71e9be6a79aec29",
"RootDeviceName": "/dev/xvda"
}
}
}
}
23 changes: 23 additions & 0 deletions deployments/aws/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.9'

networks:
net:
driver: bridge

services:
server:
image: ghcr.io/chroma-core/chroma:CHROMA_VERSION
volumes:
- index_data:/index_data
ports:
- "8000:8000"
networks:
- net
env_file:
- .env

volumes:
index_data:
driver: local
backups:
driver: local
8 changes: 4 additions & 4 deletions docs/docs.trychroma.com/components/markdoc/Note.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export function Note({ type, title, children }: NoteProps) {
>
<div className={`flex flex-row ${iconFlex}`}>

{(type === 'tip')? <Icons.info className={`mr-2 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'default')? <Icons.info className={`mr-2 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'warning')? <Icons.warning className={`mr-2 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'caution')? <Icons.warning className={`mr-2 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'tip')? <Icons.info className={`mr-2 flex-shrink-0 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'default')? <Icons.info className={`mr-2 flex-shrink-0 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'warning')? <Icons.warning className={`mr-2 flex-shrink-0 ${(title !== undefined)? 'mt-1': null}`} /> : null}
{(type === 'caution')? <Icons.warning className={`mr-2 flex-shrink-0 ${(title !== undefined)? 'mt-1': null}`} /> : null}

<div>
{title ? (
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.trychroma.com/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
6 changes: 6 additions & 0 deletions docs/docs.trychroma.com/pages/deployment/_sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export const items = [
// { href: '/deployment/kubernetes', children: 'Kubernetes' },
// ]
// },
{
title: 'Local Development',
links: [
{ href: '/deployment/docker', children: 'Docker' },
]
},
{
title: 'Cloud Providers',
links: [
Expand Down
Loading

0 comments on commit 47c494c

Please sign in to comment.