feat(deepdata): 引入修改密码、文件预览组件与清洗算子增强,deepflow 改名为 deep-flow
本次同步 09-12 至 09-28 的代码变更,主要内容: 新增功能 - 修改密码:后端新增 ChangePasswordRequest DTO 与UserController/UserService 对应接口,前端新增 ChangePasswordDialog 并在 Header 接入入口 - 文件预览组件重构:file-preview 目录拆分出 VideoPreview(支持 blobUrl 直传)、 ImagePreview、AudioPreview,index.tsx 统一调度各类型预览器 - 新增 my_ops 算子模块:markitdown_parser、mineru_pdf_parser、text_quality_evaluator - 新增 tools/minio-file-server MinIO 文件服务 功能增强 - 数据清洗:cleaning_task_service/scheduler/routes 重构, data_juicer_executor 与 wrapper 增强,OperatorTable/LogsTable/TaskDetail 同步调整 - 数据标注:annotation sync.py、project.py 接口与schema 更新 - 数据采集、算子市场、首页与菜单路由相关页面调整 - DataJuicer 算子接入(useOperatorOperations、dj_ops_schema) 结构调整 - deepflow/ 更名为 deep-flow/(419 个文件重命名) - 新增 helm 部署编排、GitHub Actions 之外的自建镜像构建脚本 未纳入本次提交 - scripts-backup/、runtime/python-executor-backup/、components_backup/(备份目录) - *.backup*、__pycache__ 产物 - zh_core_web_sm-3.8.0-py3-none-any.whl(46MB 构建产物) - DataX/(内嵌独立仓库,远程亦未收录其源码)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM maven:3-eclipse-temurin-8 AS datax-builder
|
||||
FROM maven:3-eclipse-temurin-8-alpine AS datax-builder
|
||||
|
||||
# 仅安装必要的 git
|
||||
RUN apt-get update && \
|
||||
apt-get install -y git && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||
RUN apk update && apk add --no-cache git
|
||||
|
||||
# 🟢 修改 1:恢复 git clone 下载完整源码,本地先git clone DataX
|
||||
# RUN git clone https://github.com/alibaba/DataX.git
|
||||
@@ -58,9 +57,8 @@ RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
|
||||
# 注意:使用 [default] 确保包含 job submission client
|
||||
RUN pip install "ray[default]>=2.9.0"
|
||||
|
||||
# 下载 NLTK 数据(离线:使用仓库内 vendor 的数据包,服务器无法访问 GitHub)
|
||||
COPY scripts/images/common/nltk-data/ /tmp/nltk-data/
|
||||
RUN python -c "import zipfile, os; os.makedirs('/usr/local/nltk_data/packages/tokenizers', exist_ok=True); os.makedirs('/usr/local/nltk_data/packages/taggers', exist_ok=True); zipfile.ZipFile('/tmp/nltk-data/punkt_tab.zip').extractall('/usr/local/nltk_data/packages/tokenizers'); zipfile.ZipFile('/tmp/nltk-data/averaged_perceptron_tagger_eng.zip').extractall('/usr/local/nltk_data/packages/taggers')"
|
||||
# 下载 NLTK 数据
|
||||
RUN python -c "import nltk; nltk.download(['punkt_tab','averaged_perceptron_tagger_eng'], download_dir='/usr/local/nltk_data')"
|
||||
ENV NLTK_DATA=/usr/local/nltk_data
|
||||
|
||||
# 复制应用代码
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
# 1. 字符集设置
|
||||
# 1. å—符集设ç½?
|
||||
client_encoding = 'UTF8'
|
||||
# server_encoding = 'UTF8' # å�ªèƒ½å�¯åŠ¨æ—¶è®¾ç½®ï¼Œæ— æ³•é€šè¿‡ä¿®æ”¹é…�置文件设置
|
||||
# 2. 排�规则
|
||||
|
||||
+35
-29
@@ -1,29 +1,35 @@
|
||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
|
||||
# Install uv.
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
||||
|
||||
# Install system dependencies including libpq
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpq-dev git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the application into the container.
|
||||
COPY deepflow /app/
|
||||
COPY runtime/deepflow/.env /app/.env
|
||||
COPY runtime/deepflow/conf.yaml /app/conf.yaml
|
||||
|
||||
# Pre-cache the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked --no-install-project
|
||||
|
||||
# Install the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the application.
|
||||
CMD ["uv", "run", "--no-sync", "python", "server.py", "--host", "0.0.0.0", "--port", "8000"]
|
||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
|
||||
# Install uv.
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
||||
|
||||
# Install system dependencies including libpq
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpq-dev git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 🚀 优化 1:先拷贝依赖清单,利用缓存
|
||||
# 🚀 修复:路径改为小写 deep-flow 以匹配实际文件名
|
||||
COPY deep-flow/pyproject.toml deep-flow/uv.lock ./
|
||||
|
||||
# Pre-cache the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked --no-install-project
|
||||
|
||||
# 🚀 优化 2:再拷贝完整源码
|
||||
COPY deep-flow/ ./
|
||||
|
||||
# 🚀 确保运行时配置覆盖源码配置
|
||||
COPY runtime/deep-flow/.env ./
|
||||
COPY runtime/deep-flow/conf.yaml ./
|
||||
|
||||
# Install the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the application.
|
||||
CMD ["uv", "run", "--no-sync", "python", "server.py", "--host", "0.0.0.0", "--port", "8000"]
|
||||
@@ -0,0 +1,57 @@
|
||||
##### DEPENDENCIES
|
||||
|
||||
FROM node:20-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat openssl
|
||||
WORKDIR /app
|
||||
|
||||
# 🚀 优化 1:先拷贝 package 文件
|
||||
COPY deep-flow/web/package*.json ./
|
||||
|
||||
# Install dependencies based on the preferred package manager
|
||||
#RUN if [ -f yarn.lock ]; then yarn install; \
|
||||
# elif [ -f package-lock.json ]; then npm ci; \
|
||||
# elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm #install; \
|
||||
# else npm install; fi
|
||||
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
|
||||
##### BUILDER
|
||||
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /app
|
||||
ARG NEXT_PUBLIC_API_URL="/deep-flow-backend"
|
||||
|
||||
# 🚀 优化 2:再拷贝完整源码并复用依赖层
|
||||
COPY deep-flow/web/ ./
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
#RUN if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
|
||||
# elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run #build; \
|
||||
# elif [ -f pnpm-lock.yaml ]; then SKIP_ENV_VALIDATION=1 pnpm run #build; \
|
||||
# else SKIP_ENV_VALIDATION=1 npm run build; fi
|
||||
RUN SKIP_ENV_VALIDATION=1 npm run build
|
||||
|
||||
##### RUNNER
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=builder /app/next.config.js ./
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["server.js"]
|
||||
@@ -1,68 +0,0 @@
|
||||
##### DEPENDENCIES
|
||||
|
||||
FROM node:20-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat openssl
|
||||
WORKDIR /app
|
||||
|
||||
# 原git拉取逻辑注释,改用本地COPY,本地上下文目录存在 deepflow 文件夹
|
||||
# && mv /deepflow/web/* /app \
|
||||
# && rm -rf /deepflow
|
||||
|
||||
# 将本地 deepflow/web 下全部内容复制到镜像 /app
|
||||
COPY deepflow/web/ ./
|
||||
|
||||
# Install dependencies based on the preferred package manager
|
||||
# pnpm 版本必须与 package.json 的 packageManager (pnpm@10.6.5) 一致,
|
||||
# 否则 pnpm >=10.13 的 engine identity 校验会报 ERR_PNPM_PNPM_ENGINE_IDENTITY_UNVERIFIABLE
|
||||
RUN if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm@10.6.5 && pnpm i --frozen-lockfile; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
##### BUILDER
|
||||
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /app
|
||||
ARG NEXT_PUBLIC_API_URL="/deepflow-backend"
|
||||
|
||||
# 原git拉取逻辑注释
|
||||
# RUN cd /deepflow \
|
||||
# && mv /deepflow/web/* /app \
|
||||
# && rm -rf /deepflow
|
||||
|
||||
# 本地复制web目录源码
|
||||
COPY deepflow/web/ ./
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
|
||||
elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run build; \
|
||||
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm@10.6.5 && SKIP_ENV_VALIDATION=1 pnpm run build; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
##### RUNNER
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=builder /app/next.config.js ./
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["server.js"]
|
||||
@@ -1,41 +1,45 @@
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY frontend ./
|
||||
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi && \
|
||||
npm run build
|
||||
|
||||
FROM nginx:1.29 AS runner
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
--mount=type=cache,target=/var/lib/apt \
|
||||
apt update \
|
||||
&& apt install -y dos2unix python3 python3-dev python3-venv libaugeas-dev gcc vim cron \
|
||||
&& python3 -m venv /opt/certbot/ \
|
||||
&& /opt/certbot/bin/pip install --upgrade pip \
|
||||
&& /opt/certbot/bin/pip install certbot certbot-nginx \
|
||||
&& ln -s /opt/certbot/bin/certbot /usr/local/bin/certbot
|
||||
|
||||
COPY --from=builder /app/dist /opt/frontend/statics
|
||||
COPY scripts/images/frontend/routes.inc /opt/frontend/routes.inc
|
||||
COPY scripts/images/frontend/http_backend.conf /opt/frontend/http_backend.conf
|
||||
COPY scripts/images/frontend/https_backend.conf /opt/frontend/https_backend.conf
|
||||
COPY scripts/images/frontend/nginx.conf /opt/frontend/nginx.conf
|
||||
COPY scripts/images/frontend/rotate-nginx-logs.sh /usr/local/bin/rotate-nginx-logs.sh
|
||||
|
||||
COPY scripts/images/frontend/start.sh /opt/frontend/start.sh
|
||||
|
||||
RUN dos2unix /opt/frontend/start.sh \
|
||||
&& dos2unix /usr/local/bin/rotate-nginx-logs.sh \
|
||||
&& chmod +x /opt/frontend/start.sh \
|
||||
&& chmod +x /usr/local/bin/rotate-nginx-logs.sh \
|
||||
&& mkdir -p /etc/nginx/cert \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& rm -f /etc/nginx/nginx.conf \
|
||||
&& rm -f /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/opt/frontend/start.sh"]
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 🚀 优化 1:先只拷贝 package 文件并安装依赖,利用 Docker 层缓存
|
||||
# 只要 package.json 没变,这层就缓存,无需每次重新 npm ci
|
||||
COPY frontend/package*.json ./
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
|
||||
# 🚀 优化 2:再拷贝剩余源码,构建
|
||||
COPY frontend ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.29 AS runner
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
--mount=type=cache,target=/var/lib/apt \
|
||||
apt update \
|
||||
&& apt install -y dos2unix python3 python3-dev python3-venv libaugeas-dev gcc vim cron \
|
||||
&& python3 -m venv /opt/certbot/ \
|
||||
&& /opt/certbot/bin/pip install --upgrade pip \
|
||||
&& /opt/certbot/bin/pip install certbot certbot-nginx \
|
||||
&& ln -s /opt/certbot/bin/certbot /usr/local/bin/certbot
|
||||
|
||||
COPY --from=builder /app/dist /opt/frontend/statics
|
||||
COPY scripts/images/frontend/routes.inc /opt/frontend/routes.inc
|
||||
COPY scripts/images/frontend/http_backend.conf /opt/frontend/http_backend.conf
|
||||
COPY scripts/images/frontend/https_backend.conf /opt/frontend/https_backend.conf
|
||||
COPY scripts/images/frontend/nginx.conf /opt/frontend/nginx.conf
|
||||
COPY scripts/images/frontend/rotate-nginx-logs.sh /usr/local/bin/rotate-nginx-logs.sh
|
||||
|
||||
COPY scripts/images/frontend/start.sh /opt/frontend/start.sh
|
||||
|
||||
RUN dos2unix /opt/frontend/start.sh \
|
||||
&& dos2unix /usr/local/bin/rotate-nginx-logs.sh \
|
||||
&& chmod +x /opt/frontend/start.sh \
|
||||
&& chmod +x /usr/local/bin/rotate-nginx-logs.sh \
|
||||
&& mkdir -p /etc/nginx/cert \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& rm -f /etc/nginx/nginx.conf \
|
||||
&& rm -f /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/opt/frontend/start.sh"]
|
||||
|
||||
@@ -1,48 +1,40 @@
|
||||
location /api/ {
|
||||
proxy_pass http://deepdata-gateway:8080/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /chat {
|
||||
proxy_pass http://deepdata-gateway:8080/chat;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_intercept_errors on;
|
||||
error_page 500 501 502 503 504 =200 @static_fallback;
|
||||
}
|
||||
|
||||
location /_next {
|
||||
proxy_pass http://deepdata-gateway:8080/_next;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /deepflow-backend {
|
||||
proxy_pass http://deepdata-gateway:8080/deepflow-backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
# Casdoor SSO 前端配置端点(无 /api 前缀,供登录弹窗探测 SSO 是否启用)
|
||||
location = /sso/casdoor/config {
|
||||
proxy_pass http://deepdata-gateway:8080/sso/casdoor/config;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location @static_fallback {
|
||||
root /opt/frontend/statics;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /opt/frontend/statics;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
location /api/ {
|
||||
proxy_pass http://deepdata-gateway:8080/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /chat {
|
||||
proxy_pass http://deepdata-gateway:8080/chat;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_intercept_errors on;
|
||||
error_page 500 501 502 503 504 =200 @static_fallback;
|
||||
}
|
||||
|
||||
location /_next {
|
||||
proxy_pass http://deepdata-gateway:8080/_next;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /deep-flow-backend {
|
||||
proxy_pass http://deepdata-gateway:8080/deep-flow-backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location @static_fallback {
|
||||
root /opt/frontend/statics;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /opt/frontend/statics;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
FROM maven:3-eclipse-temurin-21 AS builder
|
||||
|
||||
COPY backend/ /opt/gateway
|
||||
|
||||
RUN cd /opt/gateway/ && \
|
||||
mvn -U clean package -Dmaven.test.skip=true
|
||||
|
||||
|
||||
FROM eclipse-temurin:21-jdk
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y vim wget curl dos2unix && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /opt/gateway/api-gateway/target/gateway.jar /opt/gateway/gateway.jar
|
||||
|
||||
COPY scripts/images/gateway/start.sh /opt/gateway/start.sh
|
||||
|
||||
RUN dos2unix /opt/gateway/start.sh \
|
||||
&& chmod +x /opt/gateway/start.sh \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/opt/gateway/start.sh"]
|
||||
|
||||
CMD ["java", "-Duser.timezone=Asia/Shanghai", "-jar", "/opt/gateway/gateway.jar"]
|
||||
FROM maven:3-eclipse-temurin-21 AS builder
|
||||
|
||||
COPY backend/ /opt/gateway
|
||||
|
||||
# 🚀 优化:使用 BuildKit 缓存 Maven 依赖库 (/root/.m2)
|
||||
# 即使源码变更导致 RUN 命令重新执行,依赖包也会从缓存加载,避免重复下载
|
||||
RUN --mount=type=cache,target=/root/.m2 \
|
||||
cd /opt/gateway/ && \
|
||||
mvn clean package -Dmaven.test.skip=true
|
||||
|
||||
|
||||
FROM eclipse-temurin:21-jdk
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y vim wget curl dos2unix && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /opt/gateway/api-gateway/target/gateway.jar /opt/gateway/gateway.jar
|
||||
|
||||
COPY scripts/images/gateway/start.sh /opt/gateway/start.sh
|
||||
|
||||
RUN dos2unix /opt/gateway/start.sh \
|
||||
&& chmod +x /opt/gateway/start.sh \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/opt/gateway/start.sh"]
|
||||
|
||||
CMD ["java", "-Duser.timezone=Asia/Shanghai", "-jar", "/opt/gateway/gateway.jar"]
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
# ==============================================================================
|
||||
# Stage 1: DataX Builder
|
||||
# ==============================================================================
|
||||
FROM maven:3-eclipse-temurin-8 AS datax-builder
|
||||
FROM maven:3-eclipse-temurin-8-alpine AS datax-builder
|
||||
|
||||
# 安装 git
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
# 仅安装必要的 git
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||
RUN apk update && apk add --no-cache git
|
||||
|
||||
COPY DataX/ /DataX/
|
||||
COPY runtime/datax/ DataX/
|
||||
@@ -83,7 +85,8 @@ ENV PATH="$PATH:$JAVA_HOME/bin"
|
||||
WORKDIR /opt/runtime
|
||||
|
||||
COPY scripts/images/runtime-ray/zh_core_web_sm-3.8.0-py3-none-any.whl /tmp/
|
||||
COPY scripts/images/common/nltk-data/ /tmp/nltk-data/
|
||||
|
||||
COPY scripts/images/runtime-ray/nltk_data /root/nltk_data
|
||||
|
||||
ENV UV_LINK_MODE=copy
|
||||
|
||||
@@ -91,9 +94,24 @@ ENV UV_LINK_MODE=copy
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv pip install -e . --system \
|
||||
&& uv pip install -r /opt/runtime/deepdata/ops/pyproject.toml --system \
|
||||
&& uv pip install "ray[default]>=2.9.0" --system \
|
||||
&& uv pip install "py-data-juicer[generic,nlp]==1.4.4" --system \
|
||||
&& uv pip install "ray[default]==2.47.1" --system \
|
||||
&& uv pip install "pandas>=2.0.0" --system \
|
||||
&& uv pip install "pyarrow>=14.0.0" --system \
|
||||
&& uv pip install "sqlalchemy>=2.0.0" --system \
|
||||
&& uv pip install "loguru>=0.7.0" --system \
|
||||
&& uv pip install "jsonargparse>=4.27.0" --system \
|
||||
&& uv pip install "pyyaml>=6.0" --system \
|
||||
&& uv pip install "pypdf>=3.17.0" --system \
|
||||
&& uv pip install "python-docx>=1.1.0" --system \
|
||||
&& uv pip install "python-pptx>=0.6.23" --system \
|
||||
&& uv pip install "setuptools<75.0" --system \
|
||||
&& uv pip install \
|
||||
"opentelemetry-semantic-conventions>=0.48b0" \
|
||||
"opentelemetry-exporter-prometheus>=0.48b0" \
|
||||
--system \
|
||||
&& uv pip install pyarrow pandas spacy nltk --system \
|
||||
&& uv pip install /tmp/zh_core_web_sm-3.8.0-py3-none-any.whl --system \
|
||||
&& python -c "import zipfile, os; os.makedirs('/usr/local/nltk_data/packages/tokenizers', exist_ok=True); os.makedirs('/usr/local/nltk_data/packages/taggers', exist_ok=True); zipfile.ZipFile('/tmp/nltk-data/punkt_tab.zip').extractall('/usr/local/nltk_data/packages/tokenizers'); zipfile.ZipFile('/tmp/nltk-data/averaged_perceptron_tagger_eng.zip').extractall('/usr/local/nltk_data/packages/taggers')" \
|
||||
&& echo "/usr/local/lib/ops/site-packages" > /usr/local/lib/python3.11/site-packages/ops.pth
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# 1. 初始化环境 (原有的逻辑:注入用户自定义算子)
|
||||
# 1. 初始化环境
|
||||
if [ -d "/opt/runtime/user" ]; then
|
||||
cp -r /opt/runtime/user/* /opt/runtime/deepdata/ops/user 2>/dev/null || true
|
||||
fi
|
||||
@@ -9,27 +9,30 @@ fi
|
||||
# 2. 根据 RAY_MODE 环境变量决定启动模式
|
||||
if [ "${RAY_MODE}" = "head" ]; then
|
||||
echo "🚀 Starting Ray Head..."
|
||||
# ✅ 修复 Head 分支:
|
||||
# Ray 2.x 已废弃 CLI 参数 --redis-address,改为自动读取环境变量 RAY_REDIS_ADDRESS。
|
||||
# 只要确保 docker-compose.yml 中配置了 RAY_REDIS_ADDRESS 环境变量即可。
|
||||
TOTAL_MEM_MB=${TOTAL_MEM_MB:-4096}
|
||||
OBJECT_STORE_MEM_MB=$((TOTAL_MEM_MB / 2))
|
||||
exec ray start --head \
|
||||
--port=${RAY_HEAD_PORT:-6379} \
|
||||
--redis-password=${RAY_REDIS_PASSWORD} \
|
||||
--dashboard-host=0.0.0.0 \
|
||||
--num-cpus=${NUM_CPUS:-0} \
|
||||
--object-store-memory=${OBJECT_STORE_MEM_MB}000000 \
|
||||
--block
|
||||
|
||||
elif [ "${RAY_MODE}" = "worker" ]; then
|
||||
echo "🚀 Starting Ray Worker connecting to ${RAY_HEAD_ADDRESS}..."
|
||||
# ✅ 修复 Worker 分支:
|
||||
# Ray 2.x 移除了 --worker 参数。只要不传 --head,默认即为 Worker 模式。
|
||||
TOTAL_MEM_MB=${TOTAL_MEM_MB:-16384}
|
||||
OBJECT_STORE_MEM_MB=$((TOTAL_MEM_MB / 2))
|
||||
exec ray start \
|
||||
--address=${RAY_HEAD_ADDRESS} \
|
||||
--redis-password=${RAY_REDIS_PASSWORD} \
|
||||
--num-cpus=${NUM_CPUS:-4} \
|
||||
--memory=${TOTAL_MEM_MB}000000 \
|
||||
--object-store-memory=${OBJECT_STORE_MEM_MB}000000 \
|
||||
--block
|
||||
|
||||
else
|
||||
echo "🔧 Starting Runtime (Legacy Mode / Job Execution)..."
|
||||
# 默认行为:执行 docker-compose.yml command 传入的指令,或 Ray Job 的入口点
|
||||
# 默认行为:执行 docker-compose.yml command 传入的指令
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
@@ -15,9 +15,6 @@ COPY runtime/ops /opt/runtime/deepdata/ops
|
||||
COPY runtime/ops/user /opt/runtime/user
|
||||
COPY scripts/images/runtime/start.sh /opt/runtime/start.sh
|
||||
COPY scripts/images/common/log-rotate-copytruncate.sh /usr/local/bin/log-rotate-copytruncate.sh
|
||||
# 🟢 离线安装:spacy 中文模型(复用 runtime-ray 已 vendor 的 wheel)+ nltk 数据包
|
||||
COPY scripts/images/runtime-ray/zh_core_web_sm-3.8.0-py3-none-any.whl /tmp/
|
||||
COPY scripts/images/common/nltk-data/ /tmp/nltk-data/
|
||||
|
||||
ENV PYTHONPATH=/opt/runtime/deepdata/
|
||||
ENV UV_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
|
||||
@@ -25,11 +22,14 @@ ENV UV_INDEX_STRATEGY=unsafe-best-match
|
||||
|
||||
WORKDIR /opt/runtime
|
||||
|
||||
|
||||
COPY scripts/images/runtime-ray/zh_core_web_sm-3.8.0-py3-none-any.whl /tmp/
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv pip install -e . --system \
|
||||
&& uv pip install -r /opt/runtime/deepdata/ops/pyproject.toml --system \
|
||||
&& uv pip install /tmp/zh_core_web_sm-3.8.0-py3-none-any.whl --system \
|
||||
&& python -c "import zipfile, os; os.makedirs('/usr/local/nltk_data/packages/tokenizers', exist_ok=True); os.makedirs('/usr/local/nltk_data/packages/taggers', exist_ok=True); zipfile.ZipFile('/tmp/nltk-data/punkt_tab.zip').extractall('/usr/local/nltk_data/packages/tokenizers'); zipfile.ZipFile('/tmp/nltk-data/averaged_perceptron_tagger_eng.zip').extractall('/usr/local/nltk_data/packages/taggers')" \
|
||||
&& python -c "import nltk; nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger_eng')" \
|
||||
&& echo "/usr/local/lib/ops/site-packages" > /usr/local/lib/python3.11/site-packages/ops.pth
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
|
||||
Reference in New Issue
Block a user