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脚本编写调度任务

相关推荐
量化分析码农5 分钟前
【Python量化系统工程实战 #03】任务跑挂了没人知道?用 60 行代码搭一套「监控 + 邮件 + 桌面推送」告警系统
后端
柠檬味拥抱9 分钟前
基于YOLOv8的电梯内电瓶车检测识别(中英文双版) | 附完整源码与效果演示
后端
知守观16 分钟前
HTML 转 PDF 方案实战:iTextPDF 与 wkhtmltopdf 踩坑复盘,附 Flying Saucer / openhtmltopdf 选型对比
java·后端
程序边界20 分钟前
16个通道并行灌库是什么体验——KFS入库这点事儿(下)
后端
H.莓飛21 分钟前
【Linux】命令行参数、环境变量与程序地址空间
linux·c语言·chrome·后端·centos
粥里有勺糖23 分钟前
拿 Codex 协助清理磁盘,Nice!
前端·后端·github
专业程序开发源26 分钟前
springboot高校学生社团管理系统74810-计算机课程设计、毕业设计
java·vue.js·spring boot·后端·spring·php·课程设计
励志不掉头发的内向程序员31 分钟前
【LibreCAD 2D架构】从鼠标点击到屏幕像素:LibreCAD绘图架构全链路解析之整体架构与源码组织
后端
专业程序开发源2 小时前
springboot生命故事书制作小程序65290-计算机课程设计、毕业设计
java·vue.js·spring boot·后端·mysql·小程序·课程设计
AINative软件工程2 小时前
LLM Prompt Registry 工程实践:集中管理 Prompt,让模型调用不再散落在代码各处
后端·python·llm