windows 环境下编译kestra并启动

kestra 是一个任务调度编写工具,支持100多个插件执行,

kestra-io/kestra: :zap: Universal Workflow Orchestration Platform --- Code in any language, run anywhere. 800+ plugins for data, infrastructure, and AI automation.代码下载后可直接支持docker compose up -d启动系统

以下为手工编译并启动系统,参考文档kestra.io/docs/config...

1 环境

java :java version "21.0.6" 2025-01-21 LTS

npm:10.2.0

Gradle 9.0.0

Docker version 28.1.1,

Os windows10

2 兼容性代码修改

原有系统代码在windows环境下直接编译会报错,需要对部分代码进行修改 ui/package.json

swift 复制代码
 "prepare": "cd .. && husky ui/.husky && rm -f .git/hooks/*",
 修改为
 "prepare": "cd .. && husky ui/.husky && del /f /q .git\\hooks\\*",

ui/plugins/filename.ts

javascript 复制代码
    const match = path.match(/.*\/src\/(.*)\.vue$/);
    return match ? match[1].toLowerCase() : path;
 修改为
     // 使用更通用的正则表达式来匹配路径
    const match = path.match(/.*[\/\\]src[\/\\](.*)\.vue$/);
    if (!match) return path;
    
    // 将路径分隔符转换为正斜杠,并确保路径在JavaScript字符串中正确转义
    const normalizedPath = match[1].replace(/\\/g, '/').toLowerCase();
    
    // 手动转义反斜杠和其他特殊字符
    return normalizedPath.replace(/\\/g, '\\\\').replace(/"/g, '\\"');

ui/src/components/executions/Executions.vue

javascript 复制代码
 import FlowExecutionFilterLanguage from "../../composables/monaco/languages/filters/impl/flowExecutionFilterLanguage.js";
 修改为
import FlowExecutionFilterLanguage from "../../composables/monaco/languages/filters/impl/flowExecutionFilterLanguage.ts";

ui/src/components/flows/FlowTriggers.vue

javascript 复制代码
 import {storageKeys} from "../../utils/constants.js";
 修改为
 import {storageKeys} from "../../utils/constants.ts";

ui/src/components/kv/KVs.vue

javascript 复制代码
 import useRouteContext from "../../mixins/useRouteContext.js";
 修改为
 import useRouteContext from "../../mixins/useRouteContext.ts";

ui/src/components/secrets/Secrets.vue

javascript 复制代码
 import useRouteContext from "../../mixins/useRouteContext.js";
 修改为
 import useRouteContext from "../../mixins/useRouteContext.ts";

ui/src/components/taskruns/TaskRuns.vue

javascript 复制代码
 import TaskRunFilterLanguage from "../../composables/monaco/languages/filters/impl/taskRunFilterLanguage.js";
 修改为
 import TaskRunFilterLanguage from "../../composables/monaco/languages/filters/impl/taskRunFilterLanguage.ts";

3 修改配置

docker-compose.yml

yaml 复制代码
    image: kestra/kestra:latest
    pull_policy: always
    修改为
    image: kestra/kestra:1.0.0-SNAPSHOT
    pull_policy: never

添加文件挂载配置

arduino 复制代码
D:\code\kestra\kestra\config\application.yml:/app/config/application.yml

application.yml文件挂载内容

yaml 复制代码
datasources:
  postgres:
    url: jdbc:postgresql://postgres:5432/kestra
    driverClassName: org.postgresql.Driver
    username: kestra
    password: k3str4
kestra:
  # server:
  #   basicAuth:
  #     username: admin@kestra.io # it must be a valid email address
  #     password: Admin1234 # it must be at least 8 characters long with uppercase letter and a number
  repository:
    type: postgres
  storage:
    type: local
    local:
      basePath: "/app/storage"
  queue:
    type: postgres
  tasks:
    tmpDir:
      path: /tmp/kestra-wd/tmp
  url: http://localhost:8080/
  plugins:
    repositories:
      central:
        url: https://repo.maven.apache.org/maven2/
    configs:
      - type: io.kestra.plugin.scripts.python.Script
        values:
          pythonPath: /usr/bin/python3

4 编译系统

依次执行以下命令后,构建镜像:kestra/kestra:1.0.0-SNAPSHOT

css 复制代码
gradle build
gradle -q executableJar --no-daemon --priority=normal

copy build\executable\* docker\app\kestra

docker build --compress --rm -f ./Dockerfile --build-arg="APT_PACKAGES=python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip jattach" --build-arg="PYTHON_LIBRARIES=kestra" -t kestra/kestra:1.0.0-SNAPSHOT ./

5 启动系统:docker compose up -d

6 添加python插件

bash 复制代码
下载插件:
docker exec -it <kestra-container-id> /app/kestra plugins install io.kestra.plugin:plugin-script-python:LATEST
 
验证插件:
/app/kestra plugins list | grep python

7 重新启动系统:docker compose up -d,就可以使用python脚本编写调度任务

相关推荐
苇柠1 小时前
Spring框架基础(1)
java·后端·spring
xiucai_cs1 小时前
布隆过滤器原理与Spring Boot实战
java·spring boot·后端·布隆过滤器
向阳花自开1 小时前
Spring Boot 常用注解速查表
java·spring boot·后端
程序视点2 小时前
如何高效率使用 Cursor ?
前端·后端·cursor
sp422 小时前
设计一个 Java 本地缓存系统
后端
东阳马生架构2 小时前
Dubbo源码—5.SPI机制和线程模型
后端
用户7785371836962 小时前
踩坑记录:Claude Code Router 配置 Gemini Balance API
后端
疯狂的程序猴3 小时前
移动端网页调试实战,网络请求延迟与超时问题全链路排查指南
后端
_杨瀚博3 小时前
Springboot构建包使用BOOT-INF中的class覆盖依赖包中的class
后端
Ice__Cai3 小时前
Python 基础详解:数据类型(Data Types)—— 程序的“数据基石”
开发语言·后端·python·数据类型