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

相关推荐
Aurora_NeAr19 分钟前
对比Java学习Go——程序结构与变量
后端
AntBlack38 分钟前
每周学点 AI:ComfyUI + Modal 的一键部署脚本
人工智能·后端·aigc
5大大大大雄1 小时前
docker容器日志处理
后端
我是哪吒2 小时前
分布式微服务系统架构第170集:Kafka消费者并发-多节点消费-可扩展性
后端·面试·github
Badman2 小时前
分布式系统下的数据一致性-Redis分布式锁
redis·分布式·后端
Java水解2 小时前
盘点那些自带高级算法的SQL
后端
一只叫煤球的猫3 小时前
2025年基于Java21的的秒杀系统要怎么设计?来点干货
后端·面试·性能优化
方圆想当图灵4 小时前
《生产微服务》评估清单 CheckList
后端·微服务
服务端技术栈4 小时前
历时 1 个多月,我的第一个微信小程序「图片转 Excel」终于上线了!
前端·后端·微信小程序
计算机毕业设计指导4 小时前
基于Spring Boot的幼儿园管理系统
spring boot·后端·信息可视化