From 40d138d41dcdc802ca59e14d66559fd04117a869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E8=BD=A9?= Date: Wed, 11 Sep 2024 13:30:58 +0800 Subject: [PATCH] fix: limit elastic search memory usage --- Dockerfile | 4 ++-- docker-compose.yml | 15 ++++----------- docs/installation.md | 2 +- docs/installation_zh.md | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2627e66c..68f4ab1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ # sudo docker build --network=host -t memoryscope . # To run docker image: -# sudo docker run -it --rm --net=host memoryscope +# sudo docker run -it --rm --memory=4G --net=host memoryscope # To run docker image with arguments (refer to memoryscope/core/config/arguments.py): -# sudo docker run -it --rm --net=host -e "OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "language=en" -e "human_name=superman" -e "generation_backend=openai_generation" -e "generation_model=gpt-4o" -e "embedding_backend=openai_embedding" -e "embedding_model=text-embedding-3-small" -e "enable_ranker=False" memoryscope +# sudo docker run -it --rm --memory=4G --net=host -e "OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "language=en" -e "human_name=superman" -e "generation_backend=openai_generation" -e "generation_model=gpt-4o" -e "embedding_backend=openai_embedding" -e "embedding_model=text-embedding-3-small" -e "enable_ranker=False" memoryscope FROM python:3.11 diff --git a/docker-compose.yml b/docker-compose.yml index deaa259e..0820bf3e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,14 +9,7 @@ services: # OPENAI_API_KEY: "sk-0000000000" volumes: - ./memoryscope/core/config:/memory_scope_project/memoryscope/memoryscope/core/config - depends_on: - - elasticsearch - - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:8.13.2 - ports: - - "9200:9200" - environment: - discovery.type: "single-node" - xpack.security.enabled: "false" - xpack.license.self_generated.type: "trial" + deploy: + resources: + limits: + memory: 4G diff --git a/docs/installation.md b/docs/installation.md index 413214a3..b4453172 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -38,7 +38,7 @@ OPENAI_API_KEY: "sk-0000000000" ``` -3. Run `docker-compose up` to build and launch the memory-scope cli interface. +3. Run `docker-compose run memory_scope_main` to build and launch the memory-scope cli interface. ## III. Install from PyPI diff --git a/docs/installation_zh.md b/docs/installation_zh.md index 41d29f46..0803299b 100644 --- a/docs/installation_zh.md +++ b/docs/installation_zh.md @@ -38,7 +38,7 @@ DASHSCOPE_API_KEY: "sk-0000000000" ``` -3. 运行 `docker-compose up` 命令来构建并启动 MemoryScope CLI 界面。 +3. 运行 `docker-compose run memory_scope_main` 命令来构建并启动 MemoryScope CLI 界面。 ## 三、通过 PYPI 安装