Skip to content

Commit 3dd5bf8

Browse files
committed
squash commits
1 parent 4b34180 commit 3dd5bf8

12 files changed

+641
-1
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
.DS_STORE
77

88
.debug/
9+
10+
.env.llamacloud
11+
.env.llamaparse
12+
.env.secrets
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# llamacloud configs
2+
IS_DEPLOYED=true
3+
DEPLOYMENT_MODE=prod
4+
LOG_LEVEL=info
5+
ALLOWED_INDEX=true
6+
PARSE_PREMIUM=true
7+
8+
# service urls
9+
TRACKING_SERVICE_URL=http://usage:8005
10+
JOB_SERVICE_URL=http://jobs-service:8002
11+
S3_ENDPOINT_URL=http://s3proxy:8092
12+
13+
# s3 buckets
14+
S3_DOCUMENT_BUCKET_NAME=llama-platform-parsed-documents
15+
S3_ETL_BUCKET_NAME=llama-platform-etl
16+
S3_EXTERNAL_COMPONENTS_BUCKET_NAME=llama-platform-external-components
17+
S3_FILE_PARSING_BUCKET_NAME=llama-platform-file-parsing
18+
S3_RAW_FILE_BUCKET_NAME=llama-platform-raw-files
19+
S3_LLAMA_CLOUD_PARSE_OUTPUT_BUCKET_NAME=llama-cloud-parse-output
20+
S3_FILE_SCREENSHOT_BUCKET_NAME=llama-platform-file-screenshots
21+
S3_LLAMA_EXTRACT_OUTPUT_BUCKET_NAME=llama-platform-extract-output
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DEBUG_MODE=false
2+
MAX_PDF_PAGES=1200
3+
JOB_SERVICE_URL=http://jobs-service:8002
4+
OCR_SERVER_URL=http://llamaparse-ocr:8080/ocr
5+
TRACKING_SERVICE_URL=http://usage:8005
6+
S3_ENDPOINT_URL=http://s3proxy:8092
7+
S3_UPLOAD_BUCKET=llama-platform-upload
8+
S3_OUTPUT_BUCKET=llama-platform-output
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# LlamaCloud Secrets
2+
OIDC_DISCOVERY_URL=http://keycloak:8093/realms/llamacloud/.well-known/openid-configuration
3+
OIDC_CLIENT_ID=llamacloud
4+
OIDC_CLIENT_SECRET=llamacloud_secret
5+
SESSION_SECRET_KEY=session_secret
6+
OIDC_VERIFY_SSL=false
7+
8+
LC_OPENAI_API_KEY="<llamacloud openai api key>"
9+
10+
# LlamaParse Secrets
11+
OPENAI_API_KEY="<llamaparse openai api key>"
12+
ANTHROPIC_API_KEY="<your-anthropic-api-key>"
13+
14+
# Managed Services Secrets
15+
DATABASE_HOST=postgresql
16+
DATABASE_PORT=5432
17+
DATABASE_NAME=llamacloud
18+
DATABASE_USER=llamacloud
19+
DATABASE_PASSWORD=llamacloud
20+
21+
MONGODB_HOST=mongodb
22+
MONGODB_PORT=27017
23+
MONGODB_USER=root
24+
MONGODB_PASSWORD=mongodb
25+
26+
JOB_QUEUE_ENDPOINT=amqp://rabbitmq:5672
27+
JOB_QUEUE_USERNAME=guest
28+
JOB_QUEUE_PASSWORD=guest
29+
30+
REDIS_HOST=redis
31+
REDIS_PORT=6379

charts/llamacloud/docker/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# LlamaCloud Docker Compose
2+
3+
## Prerequisites
4+
5+
- Docker
6+
- Docker Compose
7+
- Git
8+
9+
## Setup
10+
11+
1. Clone this git repository
12+
- `git clone https://github.com/llamacloud/llamacloud.git`
13+
2. Navigate to the `charts/llamacloud/docker` folder
14+
3. Run `./setup.sh` to validate that the prerequisites have been met and to create the `.env.secrets`, `.env.llamacloud`, `.env.llamaparse` files.
15+
- **Modify these files with your desired values.**
16+
4. Run `CHART_VERSION=<helm-chart-version> ./run.sh` to start the services. This will perform the following steps:
17+
- Start the services in detached mode and wait for all services to be healthy
18+
- Setup Keycloak resources (realm, client, etc.)
19+
- Setup Filestore (buckets in s3proxy)
20+
- You can find the available versions in the [releases page](https://github.com/llamacloud/llamacloud/releases).
21+
5. Navigate to http://localhost:3000 to access the LlamaCloud UI
22+
- Login with the default credentials: `local / local_password`. You can find these and other credentials in the `setup-keycloak.sh` script.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
services:
2+
frontend:
3+
image: llamaindex/llamacloud-frontend:${CHART_VERSION}
4+
ports:
5+
- "3000:3000"
6+
container_name: frontend
7+
environment:
8+
HOSTNAME: 0.0.0.0
9+
BACKEND_URL: http://backend:8000
10+
healthcheck:
11+
test: ["CMD-SHELL", "wget -q --spider http://0.0.0.0:3000/api/healthz || exit 1"]
12+
interval: 10s
13+
timeout: 2s
14+
retries: 10
15+
start_period: 15s
16+
depends_on:
17+
- backend
18+
networks:
19+
- llamacloud_network
20+
21+
backend:
22+
image: llamaindex/llamacloud-backend:${CHART_VERSION}
23+
ports:
24+
- "8000:8000"
25+
container_name: backend
26+
command: ["python", "-m", "app.main"]
27+
environment:
28+
- PORT=8000
29+
env_file:
30+
- .env.llamacloud
31+
- .env.secrets
32+
healthcheck:
33+
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
34+
interval: 10s
35+
timeout: 2s
36+
retries: 10
37+
start_period: 15s
38+
extra_hosts:
39+
- "backend:127.0.0.1"
40+
depends_on:
41+
- rabbitmq
42+
- postgresql
43+
- mongodb
44+
- redis
45+
- s3proxy
46+
- keycloak
47+
- usage
48+
- jobs-service
49+
networks:
50+
- llamacloud_network
51+
52+
jobs-service:
53+
image: llamaindex/llamacloud-jobs-service:${CHART_VERSION}
54+
ports:
55+
- "8002:8002"
56+
container_name: jobs-service
57+
command: ["python", "-m", "jobs.service_main"]
58+
environment:
59+
JOB_API_SERVICE_PORT: 8002
60+
env_file:
61+
- .env.llamacloud
62+
- .env.secrets
63+
healthcheck:
64+
test: ["CMD", "curl", "-f", "http://localhost:8002/api/health"]
65+
interval: 10s
66+
timeout: 2s
67+
retries: 10
68+
start_period: 15s
69+
depends_on:
70+
- postgresql
71+
- rabbitmq
72+
networks:
73+
- llamacloud_network
74+
75+
jobs-worker:
76+
image: llamaindex/llamacloud-jobs-worker:${CHART_VERSION}
77+
ports:
78+
- "8001:8001"
79+
container_name: jobs-worker
80+
command: ["python", "-m", "jobs.consumer_main"]
81+
environment:
82+
JOB_CONSUMER_PORT: 8001
83+
env_file:
84+
- .env.llamacloud
85+
- .env.secrets
86+
healthcheck:
87+
test: ["CMD", "curl", "-f", "http://localhost:8001/api/health"]
88+
interval: 10s
89+
timeout: 2s
90+
retries: 10
91+
start_period: 15s
92+
depends_on:
93+
- postgresql
94+
- rabbitmq
95+
networks:
96+
- llamacloud_network
97+
98+
llamaparse:
99+
image: llamaindex/llamacloud-llamaparse:${CHART_VERSION}
100+
container_name: llamaparse
101+
ports:
102+
- "8004:8004"
103+
env_file:
104+
- .env.llamaparse
105+
- .env.secrets
106+
healthcheck:
107+
test: ["CMD", "curl", "-f", "http://localhost:8004/livez"]
108+
interval: 15s
109+
timeout: 60s
110+
retries: 30
111+
start_period: 20s
112+
networks:
113+
- llamacloud_network
114+
115+
llamaparse-ocr:
116+
image: llamaindex/llamacloud-llamaparse-ocr:${CHART_VERSION}
117+
ports:
118+
- "8080:8080"
119+
command: serve
120+
healthcheck:
121+
test: ["CMD", "curl", "-f", "http://localhost:8080/health_check"]
122+
interval: 30s
123+
timeout: 5s
124+
retries: 30
125+
start_period: 20s
126+
env_file:
127+
- .env.llamaparse
128+
- .env.secrets
129+
networks:
130+
- llamacloud_network
131+
132+
usage:
133+
image: llamaindex/llamacloud-usage:${CHART_VERSION}
134+
container_name: usage
135+
ports:
136+
- "8005:8005"
137+
env_file:
138+
- .env.secrets
139+
healthcheck:
140+
test: ["CMD", "curl", "-f", "http://localhost:8005/health_check"]
141+
interval: 10s
142+
timeout: 5s
143+
retries: 10
144+
start_period: 5s
145+
command:
146+
- "uvicorn"
147+
- "usage.main:app"
148+
- "--host"
149+
- "0.0.0.0"
150+
- "--port"
151+
- "8005"
152+
- "--workers"
153+
- "1"
154+
networks:
155+
- llamacloud_network
156+
157+
postgresql:
158+
image: bitnami/postgresql:15.5.0
159+
ports:
160+
- "5432:5432"
161+
container_name: postgresql
162+
environment:
163+
POSTGRESQL_DATABASE: llamacloud
164+
POSTGRESQL_USERNAME: llamacloud
165+
POSTGRESQL_PASSWORD: llamacloud
166+
volumes:
167+
- postgresql_data:/bitnami/postgresql
168+
networks:
169+
- llamacloud_network
170+
171+
mongodb:
172+
image: mongo:5.0
173+
restart: always
174+
ports:
175+
- "127.0.0.1:27017:27017"
176+
environment:
177+
MONGO_INITDB_ROOT_USERNAME: root
178+
MONGO_INITDB_ROOT_PASSWORD: mongodb
179+
networks:
180+
- llamacloud_network
181+
volumes:
182+
- mongodb_data:/data/db
183+
container_name: mongo
184+
healthcheck:
185+
test: mongosh
186+
-u $${MONGO_INITDB_ROOT_USERNAME}
187+
-p $${MONGO_INITDB_ROOT_PASSWORD}
188+
--eval "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27017',priority:1}]}) }" | mongosh --port 27017 --quiet
189+
interval: 10s
190+
start_period: 30s
191+
entrypoint: /bin/bash -c '
192+
openssl rand -base64 756 > /data/keyfile.key &&
193+
chmod 400 /data/keyfile.key &&
194+
chown mongodb:mongodb /data/keyfile.key &&
195+
/usr/local/bin/docker-entrypoint.sh mongod --replSet rs0 --keyFile /data/keyfile.key --bind_ip_all'
196+
197+
rabbitmq:
198+
image: rabbitmq:4.0-management-alpine
199+
ports:
200+
# management UI is at http://localhost:15672/ (username & password is both "guest")
201+
- "5672:5672"
202+
- "15672:15672"
203+
container_name: rabbitmq
204+
healthcheck:
205+
test: rabbitmq-diagnostics -q ping
206+
interval: 5s
207+
timeout: 2s
208+
retries: 3
209+
start_period: 3s
210+
volumes:
211+
- rabbitmq_data:/var/lib/rabbitmq
212+
networks:
213+
- llamacloud_network
214+
215+
redis:
216+
image: bitnami/redis:7.2.4
217+
ports:
218+
- "6379:6379"
219+
container_name: redis
220+
healthcheck:
221+
test: ["CMD", "redis-cli", "ping"]
222+
interval: 10s
223+
timeout: 5s
224+
retries: 3
225+
start_period: 10s
226+
environment:
227+
- ALLOW_EMPTY_PASSWORD=yes
228+
volumes:
229+
- redis_data:/bitnami/redis
230+
networks:
231+
- llamacloud_network
232+
233+
s3proxy:
234+
image: andrewgaul/s3proxy:sha-0effb4b
235+
ports:
236+
- "8092:8092"
237+
container_name: s3proxy
238+
healthcheck:
239+
test: ["CMD", "curl", "-f", "http://localhost:8092/"]
240+
interval: 5s
241+
timeout: 2s
242+
retries: 3
243+
start_period: 3s
244+
environment:
245+
S3PROXY_AUTHORIZATION: none
246+
S3PROXY_ENDPOINT: http://0.0.0.0:8092
247+
S3PROXY_CORS_ALLOW_ALL: true
248+
S3PROXY_LOG_LEVEL: debug
249+
S3PROXY_IGNORE_UNKNOWN_HEADERS: true
250+
JCLOUDS_FILESYSTEM_PROVIDER: file
251+
JCLOUDS_FILESYSTEM_BASEDIR: tmp/data
252+
networks:
253+
- llamacloud_network
254+
255+
keycloak:
256+
image: quay.io/keycloak/keycloak:latest
257+
environment:
258+
- KC_BOOTSTRAP_ADMIN_USERNAME=admin
259+
- KC_BOOTSTRAP_ADMIN_PASSWORD=admin_password
260+
ports:
261+
- "8093:8093"
262+
- "9000:9000"
263+
container_name: keycloak
264+
command:
265+
- start-dev
266+
- --http-port=8093
267+
- --health-enabled=true
268+
healthcheck:
269+
test: ["CMD", "curl", "--head", "-fsS", "http://localhost:8093/health/ready"]
270+
interval: 10s
271+
timeout: 5s
272+
retries: 3
273+
start_period: 10s
274+
extra_hosts:
275+
- "keycloak:127.0.0.1"
276+
networks:
277+
llamacloud_network:
278+
aliases:
279+
- keycloak
280+
281+
networks:
282+
llamacloud_network:
283+
name: llamacloud_network
284+
external: true
285+
driver: bridge
286+
287+
volumes:
288+
postgresql_data:
289+
mongodb_data:
290+
rabbitmq_data:
291+
redis_data:

0 commit comments

Comments
 (0)