gflow - A lightweight, single-node job scheduler
gflow is a lightweight, single-node job scheduler written in Rust, inspired by Slurm. It is designed for efficiently managing and scheduling tasks, especially on machines with GPU resources.
Snapshot
Core Features
- Daemon-based Scheduling: A persistent daemon (
gflowd) manages the job queue and resource allocation. - Rich Job Submission: Supports dependencies, priorities, and job arrays via the
gbatchcommand. - Service and Job Control: Provides clear commands to manage the scheduler daemon (
gctl), query the job queue (gqueue), and signal jobs (gsignal). tmuxIntegration: Usestmuxfor robust, background task execution and session management.- Simple Command-Line Interface: Offers a user-friendly and powerful set of command-line tools.
Component Overview
The gflow suite consists of several command-line tools:
gflowd: The scheduler daemon that runs in the background, managing jobs and resources.gctl: Controls thegflowddaemon (start, stop, status).gbatch: Submits jobs to the scheduler, similar to Slurm'ssbatch.gqueue: Lists and filters jobs in the queue, similar to Slurm'ssqueue.gsignal: Sends signals (e.g., finish, fail) to running jobs.
Installation
Install via cargo (Recommended)
This will install all the necessary binaries (gflowd, gctl, gbatch, gqueue, gsignal).
Build Manually
-
Clone the repository:
-
Build the project:
The executables will be available in the
target/release/directory.
Quick Start
-
Start the scheduler daemon:
You can check its status with
gctl status. -
Submit a job: Create a script
my_job.sh:#!/bin/bashSubmit it using
gbatch: -
Check the job queue:
You can also watch the queue update live:
watch gqueue. -
Stop the scheduler:
Usage Guide
Submitting Jobs with gbatch
gbatch provides flexible options for job submission.
-
Submit a command directly:
-
Set a job name and priority:
-
Create a job that depends on another:
# First job # Get job ID from gqueue, e.g., 123 # Second job depends on the first
Querying Jobs with gqueue
gqueue allows you to filter and format the job list.
-
Filter by job state:
-
Filter by job ID or name:
-
Customize output format:
Configuration
Configuration for gflowd can be customized. The default configuration file is located at ~/.config/gflow/gflowd.toml.
Contributing
If you find any bugs or have feature requests, feel free to create an Issue and contribute by submitting Pull Requests.
License
gflow is licensed under the MIT License. See LICENSE for more details.