task Runner
Project description
BP Runner
BP Runner 是一个轻量级的命令行任务执行引擎,用于管理和监控长时间运行的业务流程。
功能特性
- ✅ 支持命令行任务执行与监控
- ✅ 自动生成执行脚本和环境配置
- ✅ 提供任务状态、PID、执行统计信息记录
- ✅ 支持任务取消和清理
- ✅ 完善的日志记录和错误输出
安装
pip install bp-runner
配置文件
创建配置文件 config.yaml:
command: ls -l /etc # 要执行的命令
env:
ENV1: value1 # 环境变量
ENV2: value2
task_dir: ./task # 任务目录
work_dir: ./work # 工作目录
运行任务
- 创建 Runner 实例
from bp_runner import Runner
runner = Runner(config)
runner.run()
- 命令行运行
bp-runner -c config.yaml
配置选项
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| command | str/list | 是 | 要执行的命令 |
| task_dir | str | 是 | 任务输出目录 |
| work_dir | str | 否 | 命令工作目录 |
| env | dict | 否 | 环境变量配置 |
任务管理
# 获取任务状态
status = runner.get_status()
# 获取执行统计
stats = runner.get_stat()
# 取消任务
runner.cancel()
# 清理任务
runner.delete()
输出文件
任务执行后会生成以下文件:
status.yaml - 任务状态
pid.yaml - 进程ID
stat.yaml - 执行统计
output.log - 标准输出
err.log - 错误输出
run.sh - 生成的执行脚本
许可证 MIT License - 详见 LICENSE 文件
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bp_runner-0.1.1.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bp_runner-0.1.1.tar.gz.
File metadata
- Download URL: bp_runner-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf732b7a153cdc4396f3f3fea2c0c51d39b55c52b8033a6a31ed62258039e51b
|
|
| MD5 |
0df295de72424fbbd117300195e8b9e2
|
|
| BLAKE2b-256 |
9c850d088a5a33ff17770534edb3d89191953d81976ecf9ba4430189bba74468
|
File details
Details for the file bp_runner-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bp_runner-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7476da3121164a4b99a79980e69d0418762409b31369f008e969f10cf3d08193
|
|
| MD5 |
a7c2da5a79386d63591a2ed751ca2250
|
|
| BLAKE2b-256 |
cf2ee7db55026719f4833530a61828dc25f7c620e4059e4329a9d97170d7d295
|