Skip to content

Commit

Permalink
[Docker] Added compose.cpu.yaml for Apple silicon (#29)
Browse files Browse the repository at this point in the history
- Added `compose.cpu.yaml` for Apple silicon
- Updated CHANGELOG

---------

Co-authored-by: Jiaqi <ellm@Jiaqis-MacBook-Pro.local>
Co-authored-by: Jia Huei Tan <tanjiahuei@gmail.com>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent 15c0bed commit 1cd1446
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- The version number mentioned here refers to the cloud version. For each release, all SDKs will have the same major and minor version, but their patch version may differ. For example, latest Python SDK might be `v0.2.0` whereas TS SDK might be `v0.2.1`, but both will be compatible with release `v0.2`.

## [v0.3.1] (2024-11-26)

This is a bug fix release for frontend code. SDKs are not affected.

### CHANGES / FIXED

Frontend

- Enable Projects for OSS

## [v0.3] (2024-11-20)

### ADDED
Expand Down
182 changes: 182 additions & 0 deletions docker/compose.mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
services:
infinity:
image: michaelf34/infinity:0.0.70
container_name: jamai_infinity
command: ["v2", "--engine", "torch", "--port", "6909", "--model-warmup", "--model-id", "${EMBEDDING_MODEL}", "--model-id", "${RERANKER_MODEL}"]
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:6909/health"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
restart: unless-stopped
env_file:
- ../.env
volumes:
- ${PWD}/infinity_cache:/app/.cache
networks:
- jamai

unstructuredio:
image: downloads.unstructured.io/unstructured-io/unstructured-api:latest
platform: linux/amd64
entrypoint: ["/usr/bin/env", "bash", "-c", "uvicorn prepline_general.api.app:app --log-config logger_config.yaml --port 6989 --host 0.0.0.0"]
healthcheck:
test: ["CMD-SHELL", "wget http://localhost:6989/healthcheck -O /dev/null || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
restart: unless-stopped
networks:
- jamai

docio:
build:
context: ..
dockerfile: docker/Dockerfile.docio
image: jamai/docio
pull_policy: build
command: ["python", "-m", "docio.entrypoints.api"]
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:6979/health || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
restart: unless-stopped
env_file:
- ../.env
networks:
- jamai

dragonfly:
image: "docker.dragonflydb.io/dragonflydb/dragonfly"
ulimits:
memlock: -1
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 6379 || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
# For better performance, consider `host` mode instead `port` to avoid docker NAT.
# `host` mode is NOT currently supported in Swarm Mode.
# https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
# network_mode: "host"
# volumes:
# - ${PWD}/dragonflydata:/data
networks:
- jamai

owl:
build:
context: ..
dockerfile: docker/Dockerfile.owl
image: jamai/owl
pull_policy: build
command: ["python", "-m", "owl.entrypoints.api"]
depends_on:
infinity:
condition: service_healthy
unstructuredio:
condition: service_healthy
docio:
condition: service_healthy
dragonfly:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --fail localhost:6969/api/health || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
restart: unless-stopped
env_file:
- ../.env
volumes:
- ${PWD}/db:/app/api/db
- ${PWD}/logs:/app/api/logs
- ${PWD}/file:/app/api/file
ports:
- "${API_PORT:-6969}:6969"
networks:
- jamai

starling:
extends:
service: owl
entrypoint:
- /bin/bash
- -c
- |
celery -A owl.entrypoints.starling worker --loglevel=info --max-memory-per-child 65536 --autoscale=2,4 & \
celery -A owl.entrypoints.starling beat --loglevel=info & \
FLOWER_UNAUTHENTICATED_API=1 celery -A owl.entrypoints.starling flower --loglevel=info
command: !reset []
depends_on:
owl:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:5555/api/workers || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
ports: !override
- "${STARLING_PORT:-5555}:5555"

frontend:
build:
context: ..
dockerfile: docker/Dockerfile.frontend
args:
JAMAI_URL: ${JAMAI_URL}
PUBLIC_JAMAI_URL: ${PUBLIC_JAMAI_URL}
PUBLIC_IS_SPA: ${PUBLIC_IS_SPA}
CHECK_ORIGIN: ${CHECK_ORIGIN}
image: jamai/frontend
pull_policy: build
command: ["node", "server"]
depends_on:
owl:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --fail localhost:4000 || exit 1"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
restart: unless-stopped
environment:
- NODE_ENV=production
- BODY_SIZE_LIMIT=Infinity
env_file:
- ../.env
ports:
- "${FRONTEND_PORT:-4000}:4000"
networks:
- jamai

# By default, minio service is not enabled, and only used for testing. use --profile minio along docker compose up if minio is needed.
minio:
profiles: ["minio"]
image: minio/minio
entrypoint: /bin/sh -c " minio server /data --console-address ':9001' & until (mc config host add myminio http://localhost:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done; mc mb myminio/file; wait "
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 2s
retries: 20
start_period: 10s
ports:
- "9000:9000"
- "9001:9001"
networks:
- jamai

networks:
jamai:

0 comments on commit 1cd1446

Please sign in to comment.