easytask-failed-rerun
SKILL.md
Easytask 失败任务重跑
概述
本技能用于安全地处理 EasyTask 失败任务:
- 查询指定时间范围内的失败实例。
- 按
execId重跑单个实例(默认仅重跑 FAILED 节点)。 - 可按
jobId精确指定重跑节点。
脚本路径:
scripts/easytask_failed_rerun.py
前置条件
通过环境变量配置密钥,避免在代码或命令历史中暴露 AK/SK。
export EASYTASK_ACCESS_KEY="<your_access_key>"
export EASYTASK_SECRET_KEY="<your_secret_key>"
# 可选
export EASYTASK_BASE_URL="http://easyopenapi-gy.service.163.org/openapi/easytaskops"
使用方式
在 skill 目录下执行:
python3 scripts/easytask_failed_rerun.py --help
1)查询失败任务
python3 scripts/easytask_failed_rerun.py list-failed \
--product smart_ep \
--cluster-id hz8 \
--user your_email@corp.netease.com \
--start-time "2026-03-29 00:00:00" \
--end-time "2026-03-30 00:00:00" \
--json
说明:
--start-time和--end-time支持毫秒时间戳,或YYYY-MM-DD/YYYY-MM-DD HH:MM:SS。- 可加
--flow-alias-name <name>按 flow 名称过滤。
2)重跑指定实例(默认重跑该实例全部 FAILED 节点)
python3 scripts/easytask_failed_rerun.py rerun \
--product smart_ep \
--cluster-id hz8 \
--user your_email@corp.netease.com \
--exec-id 12095801
3)仅重跑指定 jobId
python3 scripts/easytask_failed_rerun.py rerun \
--product smart_ep \
--cluster-id hz8 \
--user your_email@corp.netease.com \
--exec-id 12095801 \
--job-id job_a --job-id job_b
4)先做 dry-run(不实际触发重跑)
python3 scripts/easytask_failed_rerun.py rerun \
--product smart_ep \
--cluster-id hz8 \
--user your_email@corp.netease.com \
--exec-id 12095801 \
--dry-run
操作规范
- AK/SK 仅放在环境变量中,禁止硬编码。
- 建议先执行
list-failed,确认后再按execId重跑。 - 在新环境首次使用时,优先使用
--dry-run进行检查。