From 1cd144667342185e3c98e3c45ac00063f6b9f4e8 Mon Sep 17 00:00:00 2001 From: Jiaqi <50042179+Jiaqi0602@users.noreply.github.com> Date: Tue, 26 Nov 2024 23:29:28 +0800 Subject: [PATCH] [Docker] Added `compose.cpu.yaml` for Apple silicon (#29) - Added `compose.cpu.yaml` for Apple silicon - Updated CHANGELOG --------- Co-authored-by: Jiaqi Co-authored-by: Jia Huei Tan --- CHANGELOG.md | 10 +++ docker/compose.mac.yml | 182 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 docker/compose.mac.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 1326f7e..0657313 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docker/compose.mac.yml b/docker/compose.mac.yml new file mode 100644 index 0000000..6eaa8eb --- /dev/null +++ b/docker/compose.mac.yml @@ -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: