Skip to content

Commit 9b4bbdf

Browse files
committed
fix: fix db config as env vars
1 parent 5917237 commit 9b4bbdf

File tree

4 files changed

+51
-56
lines changed

4 files changed

+51
-56
lines changed

.github/workflows/build_kotaemon_service.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ jobs:
4848
- name: Build and push Docker image
4949
run: |
5050
cd rag_system
51+
cat Dockerfile
5152
docker buildx build \
52-
-platform=linux/amd64,linux/arm64,linux/armhf \
53+
--platform=linux/amd64 \
5354
--push \
5455
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
55-
-f Dockerfile ./ --target prod-runtime
56+
-f Dockerfile ./
5657
- name: Also create tagged image if tag exists on main branch
5758
if: startsWith(github.ref, 'refs/tags/')
5859
run: |

rag_system/Dockerfile

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ RUN --mount=type=ssh \
6060
uv pip install -e "pipeline_scripts" && \
6161
uv pip install -e "taxonomy" && \
6262
uv pip install boto3 && \
63-
uv pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git"
6463

6564

6665
# ===============================
@@ -73,50 +72,49 @@ RUN --mount=type=ssh \
7372
uv pip install "libs/kotaemon[adv]" && \
7473
uv pip install "libs/ktem" && \
7574
uv pip install "libs/pipelineblocks" && \
76-
uv pip install boto3
77-
78-
75+
uv pip install boto3 && \
76+
uv pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements"
7977

8078
# ===============================
8179
# Shared minimal runtime base
8280
# ===============================
83-
FROM ubuntu:22.04 AS runtime-base
84-
85-
RUN apt-get update -qqy && \
86-
apt-get install -y --no-install-recommends \
87-
ssh \
88-
git \
89-
poppler-utils \
90-
curl \
91-
ca-certificates \
92-
&& rm -rf /var/lib/apt/lists/*
93-
94-
# Install uv
95-
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
96-
97-
ENV PYTHONDONTWRITEBYTECODE=1 \
98-
PYTHONUNBUFFERED=1 \
99-
PYTHONIOENCODING=UTF-8 \
100-
PATH="/root/.local/bin:/app/.venv/bin:$PATH"
101-
102-
WORKDIR /app
103-
104-
105-
# ===============================
106-
# Final: dev-runtime
107-
# ===============================
108-
FROM runtime-base AS dev-runtime
109-
110-
COPY --from=dev /app /app
111-
112-
ENTRYPOINT ["/bin/sh", "-c", "tail -f /dev/null"]
113-
114-
115-
# ===============================
116-
# Final: prod-runtime
117-
# ===============================
118-
FROM runtime-base AS prod-runtime
119-
120-
COPY --from=prod /app /app
121-
122-
ENTRYPOINT ["sh", "/app/launch.sh"]
81+
# FROM ubuntu:22.04 AS runtime-base
82+
#
83+
# RUN apt-get update -qqy && \
84+
# apt-get install -y --no-install-recommends \
85+
# ssh \
86+
# git \
87+
# poppler-utils \
88+
# curl \
89+
# ca-certificates \
90+
# && rm -rf /var/lib/apt/lists/*
91+
#
92+
# # Install uv
93+
# RUN curl -LsSf https://astral.sh/uv/install.sh | sh
94+
#
95+
# ENV PYTHONDONTWRITEBYTECODE=1 \
96+
# PYTHONUNBUFFERED=1 \
97+
# PYTHONIOENCODING=UTF-8 \
98+
# PATH="/root/.local/bin:/app/.venv/bin:$PATH"
99+
#
100+
# WORKDIR /app
101+
#
102+
#
103+
# # ===============================
104+
# # Final: dev-runtime
105+
# # ===============================
106+
# FROM runtime-base AS dev-runtime
107+
#
108+
# COPY --from=dev /app /app
109+
#
110+
# ENTRYPOINT ["/bin/sh", "-c", "tail -f /dev/null"]
111+
#
112+
#
113+
# # ===============================
114+
# # Final: prod-runtime
115+
# # ===============================
116+
# FROM runtime-base AS prod-runtime
117+
#
118+
# COPY --from=prod /app /app
119+
#
120+
# ENTRYPOINT ["sh", "/app/launch.sh"]

rag_system/flowsettings.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
config("KH_FEATURE_USER_MANAGEMENT_PASSWORD", default="admin")
8383
)
8484
KH_ENABLE_ALEMBIC = False
85-
KH_DATABASE = f"sqlite:///{KH_USER_DATA_DIR / 'sql.db'}"
86-
# KH_DATABASE = "postgresql://postgres:my_pass@postgres-db:5432/my_db"
85+
# KH_DATABASE = f"sqlite:///{KH_USER_DATA_DIR / 'sql.db'}"
86+
KH_DATABASE = os.getenv("PG_DATABASE_URL", None)
8787

8888
KH_FILESTORAGE_PATH = str(KH_USER_DATA_DIR / "files")
8989

@@ -103,13 +103,9 @@
103103
# "path": "s3://test-ecoskills/docstore/"
104104
}
105105
KH_VECTORSTORE = {
106-
# "__type__": "kotaemon.storages.LanceDBVectorStore",
107-
# "__type__": "kotaemon.storages.ChromaVectorStore",
108-
# "__type__": "kotaemon.storages.MilvusVectorStore",
109106
"__type__": "kotaemon.storages.QdrantVectorStore",
110-
"url": "116919ed-8e07-47f6-8f24-a22527d5d520.europe-west3-0.gcp.cloud.qdrant.io",
111-
"api_key": "None"
112-
# "path": str(KH_USER_DATA_DIR / "vectorstore"),
107+
"url": os.getenv("VECTORSTORE_URL", ""),
108+
"api_key": os.getenv("VECTOR_STORE_API_KEY", "")
113109
}
114110
KH_LLMS = {}
115111
KH_EMBEDDINGS = {}

rag_system/kotaemon/flowsettings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
}
104104
KH_VECTORSTORE = {
105105
"__type__": "kotaemon.storages.QdrantVectorStore",
106-
"url": os.getenv("VECTOSTORE_URL", ""),
107-
"api_key": os.getenv("API_KEY", "")
106+
"url": os.getenv("VECTORSTORE_URL", ""),
107+
"api_key": os.getenv("VECTOR_STORE_API_KEY", "")
108108
}
109109
KH_LLMS = {}
110110
KH_EMBEDDINGS = {}

0 commit comments

Comments
 (0)