From cccc8d27469a661e8b74d49466ace4d9ce99c393 Mon Sep 17 00:00:00 2001 From: Fenark <48255893+FenarkSEC@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:59:39 +0200 Subject: [PATCH] Initial support for Kubernetes (#71) * Initial Kubernetes support * Adding manifest.yaml * removed custom config & added placeholder variables * Adding K8S deployment steps on README.md * adding --host parameter to uvicorn deploy.sh * changed web/vite.config.ts placeholder variable to service name * migrated manifest.yaml to the wiki and edited README.md --- README.md | 4 ++++ deploy.sh | 2 +- web/vite.config.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92a3344..6a90e0e 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ docker compose exec serge python3 /usr/src/app/api/utils/download.py tokenizer 7 Make sure you have docker desktop installed, WSL2 configured and enough free RAM to run models. (see below) +#### Kubernetes + +Setting up Serge on Kubernetes can be found in the wiki: https://github.com/nsarrazin/serge/wiki/Integrating-Serge-in-your-orchestration#kubernetes-example + ### Using serge (You can pass `7B 13B 30B` as an argument to the `download.py` script to download multiple models.) diff --git a/deploy.sh b/deploy.sh index 23862a8..eb71ddc 100644 --- a/deploy.sh +++ b/deploy.sh @@ -6,7 +6,7 @@ mongod & cd web && npm run dev -- --host 0.0.0.0 --port 8008 & # Start the API -cd api && uvicorn main:app --port 9124 --root-path /api/ & +cd api && uvicorn main:app --host 0.0.0.0 --port 9124 --root-path /api/ & # Wait for any process to exit wait -n diff --git a/web/vite.config.ts b/web/vite.config.ts index 20ef402..2dd8bb6 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: "http://localhost:9124/", + target: "http://serge:9124/", changeOrigin: true, secure: false, rewrite: (path) => path.replace(/^\/api/u, ""),