From 05c3ad490fd1a7e973a22d9315fa9c8285faf99d Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 17 Sep 2023 15:46:49 -0400 Subject: [PATCH 01/12] Initial changes to support wheels --- Dockerfile | 3 ++- Dockerfile.dev | 3 ++- LICENSE-MIT | 4 ++-- scripts/deploy.sh | 23 ++++++++++++++++++++++- scripts/dev.sh | 23 ++++++++++++++++++++++- serge.env | 1 + 6 files changed, 51 insertions(+), 6 deletions(-) mode change 100644 => 100755 scripts/deploy.sh mode change 100644 => 100755 scripts/dev.sh create mode 100644 serge.env diff --git a/Dockerfile b/Dockerfile index 1dbe79ecffd..b58d9d6c62e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,10 +29,11 @@ COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli COPY --from=frontend /usr/src/app/web/build /usr/src/app/api/static/ COPY ./api /usr/src/app/api COPY scripts/deploy.sh /usr/src/app/deploy.sh +COPY serge.env /usr/src/app/serge.env # Install api dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends cmake build-essential dumb-init curl \ + && apt-get install -y --no-install-recommends dumb-init curl \ && pip install --no-cache-dir ./api \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ && chmod 755 /usr/src/app/deploy.sh \ diff --git a/Dockerfile.dev b/Dockerfile.dev index 8379e3c5990..606d1be2306 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -17,13 +17,14 @@ ENV NODE_ENV='development' # Install dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends cmake build-essential dumb-init curl + && apt-get install -y --no-install-recommends dumb-init curl # Copy database, source code, and scripts COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli COPY --from=node_base /usr/local /usr/local COPY scripts/dev.sh /usr/src/app/dev.sh +COPY serge.env /usr/src/app/serge.env COPY ./web/package.json ./web/package-lock.json ./ RUN npm ci \ diff --git a/LICENSE-MIT b/LICENSE-MIT index e6c61674d7c..e3ca3ab3da6 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Nathan Sarrazin and contributors +Copyright (c) 2023-present Nathan Sarrazin and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/scripts/deploy.sh b/scripts/deploy.sh old mode 100644 new mode 100755 index 1011360e391..db41814ee70 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,6 +1,27 @@ #!/bin/bash set -x +source serge.env + +# Function to detect CPU features +detect_cpu_features() { + cpu_info=$(lscpu) + if echo "$cpu_info" | grep -q "avx512"; then + echo "AVX512" + elif echo "$cpu_info" | grep -q "avx2"; then + echo "AVX2" + elif echo "$cpu_info" | grep -q "avx"; then + echo "AVX" + else + echo "basic" + fi +} + +# Detect CPU features and generate install command +cpu_feature=$(detect_cpu_features) +pip_command="python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --prefer-binary --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu" +echo "Recommended install command for llama-cpp-python:" +echo "$pip_command" # Handle termination signals _term() { @@ -10,7 +31,7 @@ _term() { } # Install python bindings -UNAME_M=$(dpkg --print-architecture) pip install llama-cpp-python==0.2.19 || { +eval "$pip_command" || { echo 'Failed to install llama-cpp-python' exit 1 } diff --git a/scripts/dev.sh b/scripts/dev.sh old mode 100644 new mode 100755 index 30e55065125..be32cebd926 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,27 @@ #!/bin/bash set -x +source serge.env + +# Function to detect CPU features +detect_cpu_features() { + cpu_info=$(lscpu) + if echo "$cpu_info" | grep -q "avx512"; then + echo "AVX512" + elif echo "$cpu_info" | grep -q "avx2"; then + echo "AVX2" + elif echo "$cpu_info" | grep -q "avx"; then + echo "AVX" + else + echo "basic" + fi +} + +# Detect CPU features and generate install command +cpu_feature=$(detect_cpu_features) +pip_command="python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --prefer-binary --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu" +echo "Recommended install command for llama-cpp-python:" +echo "$pip_command" # Install python dependencies pip install -e ./api || { @@ -9,7 +30,7 @@ pip install -e ./api || { } # Install python bindings -UNAME_M=$(dpkg --print-architecture) pip install llama-cpp-python==0.2.19 || { +eval "$pip_command" || { echo 'Failed to install llama-cpp-python' exit 1 } diff --git a/serge.env b/serge.env new file mode 100644 index 00000000000..61e7d8df2a6 --- /dev/null +++ b/serge.env @@ -0,0 +1 @@ +LLAMA_PYTHON_VERSION=0.2.19 From 7d2148bdc712fed8a3ecfc0d421d7c30e1ce1f53 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 15:45:54 -0500 Subject: [PATCH 02/12] Format shell files --- scripts/deploy.sh | 20 ++++++++++---------- scripts/dev.sh | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index db41814ee70..a6a46468ab3 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -5,16 +5,16 @@ source serge.env # Function to detect CPU features detect_cpu_features() { - cpu_info=$(lscpu) - if echo "$cpu_info" | grep -q "avx512"; then - echo "AVX512" - elif echo "$cpu_info" | grep -q "avx2"; then - echo "AVX2" - elif echo "$cpu_info" | grep -q "avx"; then - echo "AVX" - else - echo "basic" - fi + cpu_info=$(lscpu) + if echo "$cpu_info" | grep -q "avx512"; then + echo "AVX512" + elif echo "$cpu_info" | grep -q "avx2"; then + echo "AVX2" + elif echo "$cpu_info" | grep -q "avx"; then + echo "AVX" + else + echo "basic" + fi } # Detect CPU features and generate install command diff --git a/scripts/dev.sh b/scripts/dev.sh index be32cebd926..63b0fc69533 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -5,16 +5,16 @@ source serge.env # Function to detect CPU features detect_cpu_features() { - cpu_info=$(lscpu) - if echo "$cpu_info" | grep -q "avx512"; then - echo "AVX512" - elif echo "$cpu_info" | grep -q "avx2"; then - echo "AVX2" - elif echo "$cpu_info" | grep -q "avx"; then - echo "AVX" - else - echo "basic" - fi + cpu_info=$(lscpu) + if echo "$cpu_info" | grep -q "avx512"; then + echo "AVX512" + elif echo "$cpu_info" | grep -q "avx2"; then + echo "AVX2" + elif echo "$cpu_info" | grep -q "avx"; then + echo "AVX" + else + echo "basic" + fi } # Detect CPU features and generate install command From 9bf7cf5444832c95bfc7044015d3df9e40aeecf0 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 15:52:26 -0500 Subject: [PATCH 03/12] Remove curl, move location of .ENV file --- Dockerfile | 2 +- Dockerfile.dev | 2 +- serge.env => scripts/serge.env | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename serge.env => scripts/serge.env (100%) diff --git a/Dockerfile b/Dockerfile index b58d9d6c62e..f3163b06075 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ COPY serge.env /usr/src/app/serge.env # Install api dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends dumb-init curl \ + && apt-get install -y --no-install-recommends dumb-init \ && pip install --no-cache-dir ./api \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ && chmod 755 /usr/src/app/deploy.sh \ diff --git a/Dockerfile.dev b/Dockerfile.dev index 606d1be2306..7e1d37f1668 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -17,7 +17,7 @@ ENV NODE_ENV='development' # Install dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends dumb-init curl + && apt-get install -y --no-install-recommends dumb-init # Copy database, source code, and scripts COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server diff --git a/serge.env b/scripts/serge.env similarity index 100% rename from serge.env rename to scripts/serge.env From c2c6f0d9291f0eb3bbc74ed6b29fc1ec76e21ecb Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 15:56:58 -0500 Subject: [PATCH 04/12] Fix path to shfmt --- .github/workflows/ci.yml | 4 ++-- .github/workflows/docker.yml | 2 +- .github/workflows/helm-test.yml | 2 +- .github/workflows/model-check.yml | 2 +- Dockerfile | 2 +- Dockerfile.dev | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d5ec67de32..35167faf8ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI/CD Process +name: CI Checks on: push: @@ -67,7 +67,7 @@ jobs: - uses: actions/checkout@v4 - uses: luizm/action-sh-checker@v0.8.0 env: - SHFMT_OPTS: "-s" + SHFMT_OPTS: "-s -P scripts/" with: sh_checker_only_diff: false sh_checker_comment: false diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 35492d76b79..b8ad5648a85 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: CI/CD Docker Build/Publish +name: Docker on: push: diff --git a/.github/workflows/helm-test.yml b/.github/workflows/helm-test.yml index 5ad89b5707f..0a2949b16c3 100644 --- a/.github/workflows/helm-test.yml +++ b/.github/workflows/helm-test.yml @@ -1,4 +1,4 @@ -name: Lint and Test Helm Chart +name: Helm on: push: diff --git a/.github/workflows/model-check.yml b/.github/workflows/model-check.yml index 52f7238c209..df838488f23 100644 --- a/.github/workflows/model-check.yml +++ b/.github/workflows/model-check.yml @@ -1,4 +1,4 @@ -name: LLM Models Healthcheck +name: LLM Healthcheck on: push: diff --git a/Dockerfile b/Dockerfile index f3163b06075..cf8dc4206a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli COPY --from=frontend /usr/src/app/web/build /usr/src/app/api/static/ COPY ./api /usr/src/app/api COPY scripts/deploy.sh /usr/src/app/deploy.sh -COPY serge.env /usr/src/app/serge.env +COPY scripts/serge.env /usr/src/app/serge.env # Install api dependencies RUN apt-get update \ diff --git a/Dockerfile.dev b/Dockerfile.dev index 7e1d37f1668..70222458d35 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -24,7 +24,7 @@ COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli COPY --from=node_base /usr/local /usr/local COPY scripts/dev.sh /usr/src/app/dev.sh -COPY serge.env /usr/src/app/serge.env +COPY scripts/serge.env /usr/src/app/serge.env COPY ./web/package.json ./web/package-lock.json ./ RUN npm ci \ From 5697fb3dcecc92b6020353ebe12ced773df7ed0b Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 16:00:18 -0500 Subject: [PATCH 05/12] Add OPT for ShellCheck --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35167faf8ef..5d6deb52a28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,8 @@ jobs: - uses: actions/checkout@v4 - uses: luizm/action-sh-checker@v0.8.0 env: - SHFMT_OPTS: "-s -P scripts/" + SHFMT_OPTS: "-s" + SHELLCHECK_OPTS: "-P scripts/" with: sh_checker_only_diff: false sh_checker_comment: false From 4f069da9c7bbec081fd9911d690868c02ec42840 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 16:02:13 -0500 Subject: [PATCH 06/12] Fix for SC1091 --- scripts/deploy.sh | 2 ++ scripts/dev.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index a6a46468ab3..5fd5b4bf335 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,6 +1,8 @@ #!/bin/bash set -x + +# shellcheck source=serge.env source serge.env # Function to detect CPU features diff --git a/scripts/dev.sh b/scripts/dev.sh index 63b0fc69533..c6e5be8cfa1 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,8 @@ #!/bin/bash set -x + +# shellcheck source=serge.env source serge.env # Function to detect CPU features From 8359570dbf571535dbed3d0f1a8ce1b535ae106b Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 16:03:35 -0500 Subject: [PATCH 07/12] Disable SC1091 --- .github/workflows/ci.yml | 2 +- scripts/deploy.sh | 2 -- scripts/dev.sh | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d6deb52a28..e809509596e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: - uses: luizm/action-sh-checker@v0.8.0 env: SHFMT_OPTS: "-s" - SHELLCHECK_OPTS: "-P scripts/" + SHELLCHECK_OPTS: "-P scripts/ -e SC1091" with: sh_checker_only_diff: false sh_checker_comment: false diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 5fd5b4bf335..a6a46468ab3 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,8 +1,6 @@ #!/bin/bash set -x - -# shellcheck source=serge.env source serge.env # Function to detect CPU features diff --git a/scripts/dev.sh b/scripts/dev.sh index c6e5be8cfa1..63b0fc69533 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,8 +1,6 @@ #!/bin/bash set -x - -# shellcheck source=serge.env source serge.env # Function to detect CPU features From 39369b0e659e60eb4f96bac4304c8b63ebf5514d Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 16:34:33 -0500 Subject: [PATCH 08/12] Fix delete prompt call when prompt in progress --- Dockerfile | 5 +---- api/src/serge/routers/chat.py | 4 ++-- web/src/routes/chat/[id]/+page.svelte | 25 +++++++++++++++++++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf8dc4206a7..7df13ce3072 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,10 +32,7 @@ COPY scripts/deploy.sh /usr/src/app/deploy.sh COPY scripts/serge.env /usr/src/app/serge.env # Install api dependencies -RUN apt-get update \ - && apt-get install -y --no-install-recommends dumb-init \ - && pip install --no-cache-dir ./api \ - && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ +RUN pip install --no-cache-dir ./api dumb-init \ && chmod 755 /usr/src/app/deploy.sh \ && chmod 755 /usr/local/bin/redis-server \ && chmod 755 /usr/local/bin/redis-cli \ diff --git a/api/src/serge/routers/chat.py b/api/src/serge/routers/chat.py index e3995b7a9f2..7cd0bd289d1 100644 --- a/api/src/serge/routers/chat.py +++ b/api/src/serge/routers/chat.py @@ -1,5 +1,5 @@ from typing import Optional -from fastapi import APIRouter +from fastapi import APIRouter, HTTPException from langchain.memory import RedisChatMessageHistory from langchain.schema import SystemMessage, messages_to_dict, AIMessage, HumanMessage from llama_cpp import Llama @@ -137,7 +137,7 @@ async def delete_prompt(chat_id: str, idx: int): if idx >= len(history.messages): logger.error("Unable to delete message, chat in progress") - return False + raise HTTPException(status_code=202, detail="Unable to delete message, chat in progress") messages = history.messages.copy()[:idx] history.clear() diff --git a/web/src/routes/chat/[id]/+page.svelte b/web/src/routes/chat/[id]/+page.svelte index b399a7a19ae..fb70fbfa17c 100644 --- a/web/src/routes/chat/[id]/+page.svelte +++ b/web/src/routes/chat/[id]/+page.svelte @@ -102,10 +102,7 @@ }); eventSource.onerror = async (error) => { - console.log("error", error); eventSource.close(); - //history[history.length - 1].data.content = "A server error occurred."; - //await invalidate("/api/chat/" + $page.params.id); }; } @@ -143,11 +140,28 @@ if (response.status === 200) { await invalidate("/api/chat/" + $page.params.id); + } else if (response.status === 202) { + showToast("Chat in progress!"); } else { - console.error("Error " + response.status + ": " + response.statusText); + showToast("An error occurred: " + response.statusText); } } + function showToast(message: string) { + // Create the toast element + const toast = document.createElement("div"); + toast.className = `alert alert-info`; + toast.textContent = message; + + // Append the toast to the toast container + document.getElementById("toast-container").appendChild(toast); + + // Automatically remove the toast after a delay + setTimeout(() => { + toast.remove(); + }, 3000); + } + const md: MarkdownIt = new MarkdownIt({ html: true, linkify: true, @@ -527,4 +541,7 @@ +
+ +
From 42c2de508993ac528dda8368455e5edcdd5fc075 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 16:37:29 -0500 Subject: [PATCH 09/12] Add null check --- web/src/routes/chat/[id]/+page.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/src/routes/chat/[id]/+page.svelte b/web/src/routes/chat/[id]/+page.svelte index fb70fbfa17c..b63071d7edd 100644 --- a/web/src/routes/chat/[id]/+page.svelte +++ b/web/src/routes/chat/[id]/+page.svelte @@ -152,9 +152,15 @@ const toast = document.createElement("div"); toast.className = `alert alert-info`; toast.textContent = message; + const toastContainer = document.getElementById("toast-container"); - // Append the toast to the toast container - document.getElementById("toast-container").appendChild(toast); + // Append the toast to the toast container if it exists + if (toastContainer) { + toastContainer.appendChild(toast); + } else { + console.error("Toast container not found?"); + return; + } // Automatically remove the toast after a delay setTimeout(() => { From f8de8761c5e67d61dd7747fcb5e00758346b842a Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 17:16:35 -0500 Subject: [PATCH 10/12] Revert changes to Dockerfile --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7df13ce3072..a116ba9c183 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,11 @@ COPY scripts/deploy.sh /usr/src/app/deploy.sh COPY scripts/serge.env /usr/src/app/serge.env # Install api dependencies -RUN pip install --no-cache-dir ./api dumb-init \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends cmake build-essential dumb-init curl \ + && pip install --no-cache-dir ./api \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ + && install --no-cache-dir ./api \ && chmod 755 /usr/src/app/deploy.sh \ && chmod 755 /usr/local/bin/redis-server \ && chmod 755 /usr/local/bin/redis-cli \ From efd271f37c39405b46ae18fafef26c3c6d82da65 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 17:17:18 -0500 Subject: [PATCH 11/12] Fix syntax issue --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a116ba9c183..69d0ccebc16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends cmake build-essential dumb-init curl \ && pip install --no-cache-dir ./api \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ - && install --no-cache-dir ./api \ + && pip install --no-cache-dir ./api \ && chmod 755 /usr/src/app/deploy.sh \ && chmod 755 /usr/local/bin/redis-server \ && chmod 755 /usr/local/bin/redis-cli \ From 63a367c287e2c2df02376dd844e327d927092fc7 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 26 Nov 2023 17:17:46 -0500 Subject: [PATCH 12/12] Remove duplicated command --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 69d0ccebc16..9313a11f70c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,6 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends cmake build-essential dumb-init curl \ && pip install --no-cache-dir ./api \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \ - && pip install --no-cache-dir ./api \ && chmod 755 /usr/src/app/deploy.sh \ && chmod 755 /usr/local/bin/redis-server \ && chmod 755 /usr/local/bin/redis-cli \