From d78c50593f097f3198a38da163f38d1ff0d34602 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:08:47 +0800 Subject: [PATCH 1/9] build: allinone --- Dockerfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31ea12d9..29a0f031 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,8 +45,52 @@ COPY g2-ssr/charts/* /app/charts/ RUN npm install +FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS python-builder # Runtime stage -FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest +# FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest +FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 + +# python environment +COPY --from=python-builder /usr/local /usr/local + +RUN ln -sf python3.11 /usr/local/bin/python && \ + ln -sf pip /usr/local/bin/pip3 + +ENV PYTHONPATH=/usr/local/lib/python3.11:$PYTHONPATH +ENV PATH=/usr/local/bin:$PATH + +RUN python --version && pip --version + +# Install uv tool +COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/ + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + gnupg \ + gcc \ + g++ \ + libcairo2-dev \ + libpango1.0-dev \ + libjpeg-dev \ + libgif-dev \ + librsvg2-dev \ + && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ + && apt-get install -y nodejs \ + && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \ + && rm -rf /var/lib/apt/lists/* \ + chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* && \ + chmod g+xr /usr/bin/ld.so && \ + chmod g+x /usr/local/bin/python* && \ + +ARG DEPENDENCIES=" \ + vim \ + postgresql-17-pgvector" + +# ENV PGDATA=/var/lib/postgresql/data \ +# POSTGRES_USER=root \ +# POSTGRES_PASSWORD=Password123@pg \ +# POSTGRES_DB=sqlbot # Set runtime environment variables ENV PYTHONUNBUFFERED=1 @@ -65,10 +109,11 @@ WORKDIR ${SQLBOT_HOME}/app RUN mkdir -p /opt/sqlbot/images /opt/sqlbot/g2-ssr -EXPOSE 3000 8000 8001 +EXPOSE 3000 8000 8001 5432 # Add health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:8000 || exit 1 +CMD ["/usr/local/bin/docker-entrypoint.sh"] ENTRYPOINT ["sh", "start.sh"] From a4614850cc0f1f0eab063fe22152140e13944c5a Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:19:05 +0800 Subject: [PATCH 2/9] build: allinone --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29a0f031..4644f499 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,9 +56,6 @@ COPY --from=python-builder /usr/local /usr/local RUN ln -sf python3.11 /usr/local/bin/python && \ ln -sf pip /usr/local/bin/pip3 -ENV PYTHONPATH=/usr/local/lib/python3.11:$PYTHONPATH -ENV PATH=/usr/local/bin:$PATH - RUN python --version && pip --version # Install uv tool From 00568091a86fb84f6ab97a5cd37a470eb856e408 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:24:08 +0800 Subject: [PATCH 3/9] build: allinone --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4644f499..e8db79c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,9 +53,6 @@ FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 # python environment COPY --from=python-builder /usr/local /usr/local -RUN ln -sf python3.11 /usr/local/bin/python && \ - ln -sf pip /usr/local/bin/pip3 - RUN python --version && pip --version # Install uv tool From 4f31d57b20a5bdb475c2b92f385945dcd3a04000 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 2 Sep 2025 14:30:56 +0800 Subject: [PATCH 4/9] feat: change kimi's default config value --- frontend/src/entity/supplier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/entity/supplier.ts b/frontend/src/entity/supplier.ts index 02c8ab34..cd9ba5d6 100644 --- a/frontend/src/entity/supplier.ts +++ b/frontend/src/entity/supplier.ts @@ -217,11 +217,11 @@ export const supplierList: Array<{ model_options: [ { name: 'kimi-k2-0711-preview', - args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }], + args: [{ key: 'temperature', val: 0.3, type: 'number', range: '[0, 1]' }], }, { name: 'kimi-k2-turbo-preview', - args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }], + args: [{ key: 'temperature', val: 0.3, type: 'number', range: '[0, 1]' }], }, { name: 'moonshot-v1-8k' }, { name: 'moonshot-v1-32k' }, From 6de26a39c1100dd5ea924f339edd5084b04f5ac2 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:33:32 +0800 Subject: [PATCH 5/9] build: allinone --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e8db79c8..9c69427e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* && \ chmod g+xr /usr/bin/ld.so && \ - chmod g+x /usr/local/bin/python* && \ + chmod g+x /usr/local/bin/python* ARG DEPENDENCIES=" \ vim \ From 2b5e922a1f895f8eea69f2c0ce3a36fdaae54b00 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Sep 2025 14:34:35 +0800 Subject: [PATCH 6/9] perf: Assistant basic applications use the default private data source mechanism --- backend/apps/system/crud/assistant.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/apps/system/crud/assistant.py b/backend/apps/system/crud/assistant.py index 1a49f28a..1a2a8dd2 100644 --- a/backend/apps/system/crud/assistant.py +++ b/backend/apps/system/crud/assistant.py @@ -40,9 +40,14 @@ def get_assistant_ds(session: Session, llm_service) -> list[dict]: stmt = select(CoreDatasource.id, CoreDatasource.name, CoreDatasource.description).where( CoreDatasource.oid == oid) if not assistant.online: - private_list: list[int] = config.get('private_list') or None + public_list: list[int] = config.get('public_list') or None + if public_list: + stmt = stmt.where(CoreDatasource.id.in_(public_list)) + else: + raise RuntimeError('no public datasource valid') + """ private_list: list[int] = config.get('private_list') or None if private_list: - stmt = stmt.where(~CoreDatasource.id.in_(private_list)) + stmt = stmt.where(~CoreDatasource.id.in_(private_list)) """ db_ds_list = session.exec(stmt) result_list = [ From 599fd7659a8fe003e6858e17e2c985db2d32f11a Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:39:43 +0800 Subject: [PATCH 7/9] build: allinone --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c69427e..dabad19b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,7 +71,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ librsvg2-dev \ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs \ - && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \ && rm -rf /var/lib/apt/lists/* \ chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* && \ chmod g+xr /usr/bin/ld.so && \ From c335773f4e827c740785acba1ab6c6b7b3fa16c1 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 2 Sep 2025 14:47:11 +0800 Subject: [PATCH 8/9] build: allinone --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index dabad19b..3c7c0d99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,9 +72,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* \ - chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* && \ - chmod g+xr /usr/bin/ld.so && \ - chmod g+x /usr/local/bin/python* + && chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \ + && chmod g+xr /usr/bin/ld.so \ + && chmod g+x /usr/local/bin/python* ARG DEPENDENCIES=" \ vim \ From b0271e10d4dddbdb5f643b7000d3960d665ad1a1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Sep 2025 14:57:25 +0800 Subject: [PATCH 9/9] perf: Assistant full-screen embedding code optimization --- frontend/src/views/system/embedded/iframe.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/system/embedded/iframe.vue b/frontend/src/views/system/embedded/iframe.vue index 1534c1ec..e558a2d7 100644 --- a/frontend/src/views/system/embedded/iframe.vue +++ b/frontend/src/views/system/embedded/iframe.vue @@ -407,11 +407,13 @@ const handleEmbedded = (row: any) => { script.src = "${origin + pathname}xpack_static/sqlbot-embedded-dynamic.umd.js"; document.head.appendChild(script); })() - - sqlbot_embedded_handler.mounted('.copilot', { - "embeddedId": "${row.id}", - "online": true -})` + let sqlbot_embedded_timer = setInterval(() => { + if (sqlbot_embedded_handler?.mounted) { + sqlbot_embedded_handler.mounted('.copilot', { "embeddedId": "${row.id}" }) + clearInterval(sqlbot_embedded_timer) + } + }, 1000) + ` } const copyJsCode = () => { copy(jsCodeElement.value)