• Stars
    star
    4,812
  • Rank 8,753 (Top 0.2 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌠 Manage your shell commands.

Pueue

GitHub Actions Workflow Crates.io License: MIT Downloads codecov

Pueue

Pueue is a command-line task management tool for sequential and parallel execution of long-running tasks.

Simply put, it's a tool that processes a queue of shell commands. On top of that, there are a lot of convenient features and abstractions.

Since Pueue is not bound to any terminal, you can control your tasks from any terminal on the same machine. The queue will be continuously processed, even if you no longer have any active ssh sessions.

Features

  • Scheduling
    • Add tasks as you go.
    • Run multiple tasks at once. You decide how many tasks should run concurrently.
    • Change the order of the scheduled tasks.
    • Specify dependencies between tasks.
    • Schedule tasks to run at a specific time.
  • Process interaction
    • Easy output inspection.
    • Send input to running processes.
    • Pause/resume tasks, when you need some processing power right NOW!
  • Task groups (multiple queues)
    • Each group can have several tasks running in parallel.
    • Pause/start tasks by a group.
  • Background process execution
    • The pueued daemon runs in the background. No need to be logged in.
    • Commands are executed in their respective working directories.
    • The current environment variables are copied when adding a task.
    • Commands are run in a shell which allows the full feature set of shell coding.
  • Consistency
    • The queue is always saved to disk and restored on kill/system crash.
    • Logs are persisted onto the disk and survive a crash.
  • Miscellaneous
    • A callback hook to, for instance, set up desktop notifications.
    • JSON output for log and status if you want to display info about tasks in another program.
    • A wait subcommand to wait for specific tasks, a group (or everything) to finish.
  • A lot more. Check the -h options for each subcommand for detailed options.
  • Cross Platform
    • Linux is fully supported and battle-tested.
    • MacOS is fully supported and on par with Linux.
    • Windows is fully supported and working fine for quite a while.
  • Why should I use it
  • Advantages over Using a Terminal Multiplexer

What Pueue is not

Pueue is not designed to be a programmable (scriptable) task scheduler/executor.

The focus of pueue lies on human interaction, i.e. it's supposed to be used by a real person on some kind of OS. See the Design Goals section

Due to this, the feature set of pueue and pueued as well as their implementation and architecture have been kept simple by design! Even though it can be scripted to some degree, it hasn't been built for this and there's no official support!

There's definitely the need for a complex task scheduler/executor with advanced API access and scheduling options, but this is the job for another project, as this is not what pueue has been built for.

Installation

There are a few different ways to install Pueue.

Package Manager

Packaging status

The preferred way to install Pueue is to use your system's package manager. This will usually deploy service files and completions automatically.

Pueue has been packaged for quite a few distributions, check the table on the right for more information.

Prebuild Binaries

Statically linked (if possible) binaries for Linux (incl. ARM), Mac OS and Windows are built on each release.
You can download the binaries for the client and the daemon (pueue and pueued) for each release on the release page.
Just download both binaries for your system, rename them to pueue and pueued and place them in your $PATH/program folder.

Via Cargo

Pueue is built for the current stable Rust version. It might compile on older versions, but this isn't tested or officially supported.

cargo install --locked pueue

This will install Pueue to $CARGO_HOME/bin/pueue (default is ~/.cargo/bin/pueue)

From Source

Pueue is built for the current stable Rust version. It might compile on older versions, but this isn't tested or officially supported.

git clone [email protected]:Nukesor/pueue
cd pueue
cargo build --release --locked --path ./pueue

The final binaries will be located in target/release/{pueue,pueued}.

How to Use it

Check the wiki to get started :).

There are also detailed sections for (hopefully) every important feature:

On top of that, there is a help option (-h) for all commands.

Pueue client 2.0.0
Arne Beer <[email protected]>
Interact with the Pueue daemon

USAGE:
    pueue [OPTIONS] [SUBCOMMAND]

OPTIONS:
    -c, --config <CONFIG>      Path to a specific pueue config file to use. This ignores all other
                               config files
    -h, --help                 Print help information
    -p, --profile <PROFILE>    The name of the profile that should be loaded from your config file
    -v, --verbose              Verbose mode (-v, -vv, -vvv)
    -V, --version              Print version information

SUBCOMMANDS:
    add              Enqueue a task for execution
    clean            Remove all finished tasks from the list
    completions      Generates shell completion files. This can be ignored during normal
                     operations
    edit             Edit the command or path of a stashed or queued task.
                     The command is edited by default.
    enqueue          Enqueue stashed tasks. They'll be handled normally afterwards
    follow           Follow the output of a currently running task. This command works like tail
                     -f
    format-status    Accept a list or map of JSON pueue tasks via stdin and display it just like
                     "status". A simple example might look like this: pueue status --json | jq
                     -c '.tasks' | pueue format-status
    group            Use this to add or remove groups. By default, this will simply display all
                     known groups
    help             Print this message or the help of the given subcommand(s)
    kill             Kill specific running tasks or whole task groups. Kills all tasks of the
                     default group when no ids are provided
    log              Display the log output of finished tasks. When looking at multiple logs,
                     only the last few lines will be shown. If you want to "follow" the output
                     of a task, please use the "follow" subcommand
    parallel         Set the amount of allowed parallel tasks. By default, adjusts the amount of
                     the default group
    pause            Either pause running tasks or specific groups of tasks.
                     By default, pauses the default group and all its tasks.
                     A paused queue (group) won't start any new tasks.
    remove           Remove tasks from the list. Running or paused tasks need to be killed first
    reset            Kill all tasks, clean up afterwards and reset EVERYTHING!
    restart          Restart task(s). Identical tasks will be created and by default enqueued.
                     By default, a new task will be created
    send             Send something to a task. Useful for sending confirmations such as 'y\n'
    shutdown         Remotely shut down the daemon. Should only be used if the daemon isn't
                     started by a service manager
    start            Resume operation of specific tasks or groups of tasks.
                     By default, this resumes the default group and all its tasks.
                     Can also be used force-start specific tasks.
    stash            Stashed tasks won't be automatically started. You have to enqueue them or
                     start them by hand
    status           Display the current status of all tasks
    switch           Switches the queue position of two commands. Only works on queued and
                     stashed commands
    wait             Wait until tasks are finished. By default, this will wait for all tasks
                     in the default group to finish. Note:
                     This will also wait for all tasks that aren't somehow 'Done'. Includes:
                     [Paused, Stashed, Locked, Queued, ...]

Design Goals

Pueue is designed to be a convenient helper tool for a single user.

It's supposed to work stand-alone and without any external integration. The idea is to keep it simple and to prevent feature creep.

Hence, these features won't be included as they're out of scope:

  • Distributed task management/execution.
  • Multi-user task management.
  • Sophisticated task scheduling for optimal load balancing.
  • Tight system integration or integration with external tools.
  • Explicit support for scripting. If you're adamant about scripting it anyway, take a look at the pueue-lib library, which provides proper API calls for pueued. However, keep in mind that pueued is still supposed to be a minimalistic task executor with as little scheduling logic as possible.

There seems to be the need for some project that satisfies all these points mentioned above, but that isn't Pueue's job.

Similar Projects

GNU Parallel

A robust and featureful parrallel processor with text-based joblog and n-retries. GNU Parallel is able to scale to multi-host parallelization and has complex code to have deep integration across different tools and shells, as well as other advanced features. Pueue differentiates itself from GNU Parallel by focusing more on visibility across many different long running commands, and creating a central location for commands to be stored, rather than GNU Parallel's focus on chunking a specific task.

nq

A very lightweight job queue systems which require no setup, maintenance, supervision, or any long-running processes.
Link to project

task-spooler

task spooler is a Unix batch system where the tasks spooled run one after the other.
Links to ubuntu manpage and a fork on Github. The original website seems to be down.

Contributing

Feature requests and pull requests are very much appreciated and welcome!

Anyhow, please talk to me a bit about your ideas before you start hacking! It's always nice to know what you're working on and I might have a few suggestions or tips :)

Depending on the type of your contribution, you should branch of from either the main branch or the development branch.

  • Bug fixes or critical library updates should branch of main and be merged into main. New patch level releases will be published for this kind of issues. Any patches in main will also regularily be merged into development.
  • Everything else, such as new features, refactorings, or breaking changes, should branch of development and be merged into development. Once a new minor or major version has been published, development will then be merged into main.

There's also the Architecture Guide, which is supposed to give you a brief overview and introduction to the project.

Copyright © 2019 Arne Beer (@Nukesor)

More Repositories

1

comfy-table

🔶 Build beautiful terminal tables with automatic content wrapping
Rust
911
star
2

ultimate-poll-bot

💡 The ultimate vote and poll bot for creating, sharing and evaluating polls inside of Telegram
Python
138
star
3

sticker-finder

⚡ A telegram bot for searching all the stickers (just like @gif).
Python
99
star
4

archivebot

💾 A telegram bot for backing up and collecting all kinds of media.
Python
98
star
5

webhook-server

Trigger program/script execution on your server via http calls. Ships with a scheduler, templating and Github's CI support
Rust
43
star
6

libwifi

📦 A library for parsing IEEE 802.11 frames
Rust
42
star
7

inter-struct

❓ Experimental autogenerated traits for operations between arbitrary structs (in the same crate).
Rust
19
star
8

hetznerbot

📲 Get the newest hetzner server offers right to your telegram chat.
Python
18
star
9

gitalizer

A git/github repository data collector to analyse privacy implications of exposing Git metadata
Python
14
star
10

encarne

📺 Reencode all your movies to h.265
Python
11
star
11

geil

🚀 A tool to update your repositories and for keeping them clean
Rust
10
star
12

pueue-webhook-server

A webhook server that schedules commands on request. Uses Pueue as executor backend.
Rust
9
star
13

selfhosted-gaming

A collection of installation and configuration instructions for selfhosted game servers
HTML
8
star
14

scripts

A bunch of shell scripts and small rust programs for my personal use
Rust
7
star
15

wifitify

A research project for tracking devices via WiFi and sending notifications.
Rust
6
star
16

mixxx-library-exporter

A small converter tool, which exports a mixxx library into other formats.
Rust
6
star
17

dotfiles

Config stuff
Lua
6
star
18

setup

Shell
4
star
19

roflcopter

Do you want a lot of ROFLCOPTER on your screen? Then this is for you.
Rust
4
star
20

struct-merge

Generate code for merging structs
Rust
3
star
21

game-server-management

Management scripts for some of my self-hosted game servers
Rust
3
star
22

game-saver

Save and restore games that don't want to be restored
Rust
3
star
23

Media-bot

A telegram bot for viewing media from reddit links inside the messenger
Python
3
star
24

rust-boilerplate

Rust
2
star
25

python-mini-tutorial

A small mini tutorial to get a quick impression of the languages syntax and base features
Python
2
star
26

spacesurvival

A collaborative mmo space survival game
Python
2
star
27

Arrrsync

Secure rsync and file exploration in python. An extra `r` for extra security.
Python
2
star
28

blocker

Simple convenience layer around airmon-ng for deauthentication attacks.
Rust
2
star
29

thesis

Privacy implications of exposing git metadata
TeX
2
star
30

advent_of_code

Advent of code challenges
Rust
1
star
31

rocket-diesel-rest-boilerplate

Rust
1
star
32

ShapeRape

Our repository for the global gamejam 2014
C
1
star
33

chef-cookbook

LOL
HTML
1
star
34

music-organizer

A small program, which helps me organize my music library.
Rust
1
star
35

notification-bot

Kleinanzeigen scraper
Python
1
star
36

adminbot

This is my personal user-bot that helps me moderating my bots
Python
1
star
37

collatz_conjecture

A little playground for high performance computing with Rust based on the collatz conjecture.
Rust
1
star
38

gitalysis

The data mining and visualization code for metadata collected by gitalizer
Python
1
star
39

mixxx-controller-scripts

Custom script for my DJ controller
JavaScript
1
star