fartask
Task submission and tracking for SLURM cluster jobs and local C++ compile-and-run jobs, with a NiceGUI web dashboard for monitoring task status.
Install
fartask is not published on PyPI yet, so install it from the source checkout:
git clone https://github.com/farfarfun/fartask.git
cd fartask
uv sync # development environment (or: pip install .)
Usage
Submit a task from a directory containing either config.slurm (submitted via sbatch) or main.cpp (compiled with g++ and executed locally):
from fartask import submit_task
task_dir = submit_task()
submit_task() copies the job files into a timestamped directory under $HOME/workbench, runs the job there, and returns that directory. It raises TaskSubmissionError when the current directory contains neither config.slurm nor main.cpp, and TaskCommandError when submission, compilation or execution exits non-zero.
Each submission is recorded in a local SQLite database (tasks.db) with its status (pending/running/completed/failed) and output. Query or edit those records with TaskManager:
from fartask import TaskManager
manager = TaskManager() # defaults to sqlite:///tasks.db
for task in manager.get_all_tasks():
print(task.id, task.task_type, task.status)
Launch the web dashboard to view and manage tasks:
python -m fartask
This starts a NiceGUI server (default http://0.0.0.0:8080) listing all tasks with options to view output or delete a task.
For long-running deployments, use scripts/setup.sh to manage the dashboard process (run/start/stop/restart each require a dev or prod environment argument; status reports both):
scripts/setup.sh start dev # background
scripts/setup.sh run dev # foreground
scripts/setup.sh status
scripts/setup.sh stop dev
prod only runs a fartask distribution installed from a package index; it refuses to start from an editable or locally built checkout. Since the package is not on PyPI yet, use dev for now — prod becomes available once a release is published.
关于 farfarfun
farfarfun 是一个专注于实用工具库的开源组织, 涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。
- 🏠 组织主页:https://github.com/farfarfun
- 📦 PyPI:https://pypi.org/user/niuliangtao/
- 📧 联系:farfarfun@qq.com
本项目基于 MIT 协议开源。
Metadata
Release files for fartask 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fartask-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Release files / fartask-1.0.8-py3-none-any.whl
| Download URL | fartask-1.0.8-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c635dd81f99894f82908d10eb2d8729eaf6df3edab812643d56b80c6e151aa68
|
|
BLAKE2b-256 checksum How to use checksums |
0e5060b65d4e18bf895de560dd809ff2bdadad5477a047dff4b4496ceb1de0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|