Skip to content

leunga1000/kinetic

Repository files navigation

Screenshot

Kinetic, a process runner

Runs commands and captures/monitors results.

Commands can be linked together into workflows.

Because the commands are at the shell level, you can choose the technology you need for each step in your workflow.

Example Config flow

[step-one]
schedule="0 1 * * *"
command="python -c 'print(\"step one\")'"
next="step-two"
error="error-one"

[step-one-error]
schedule="0 5 * * *"
command="python -c 'print(\"step one error\");raise Exception(\"2\")'"
next="step-two"
error="error-one"

[step-two]
command="echo step-two"

[error-one]
command="echo error-one"

Kinetic runs at the user account level (e.g. files in user’s home directory, permissions are user permissions)

$ kin log

job-id                                          status  start               end    pid     duration
---------------------------------------------------------------------------------------------------
sync-to-backup-NeP8nb4q                         OK      13:54  ->-          13:55  353842  1m 18s
ER: raise-exception-NePaHZyV                    ER      14:00  ->-          14:00  353983  2s
ER: print-output-NePaIKni                       ER      14:00  ->-          14:00  354000  2s
check-free-mem-NePb7aPc                         OK      14:01  ->-          14:01  354026  2s

(If the line begins with ER: there was error output, but the job may have returned/completed successfully - for this see the status column)

Usage:

kin start

Install and start the kin server

kin log

List job runs

kin edit

Edit job definitions

kin list

List job definitions

kin run <jobname>

Run a job by its name

kin help

See available commands

kin jl <job_id>

Fetch a job run’s log

Configuration file:

Any .toml file in ~/.pm_dir will be loaded. Example config.toml:

[print-output]
schedule="0 13 * * *"
command="python -c 'print(\"hello\");raise Exception(\"2\")'"

[hello]
command="echo hello"

So to run the "hello" job from the command line, you can run kin run hello

Config properties

[suitably-involved-command]                                  <-- jobname
command="cd $HOME/somewhere && getparams.sh | run_program"   <-- command to run
schedule="0 18 * * *"                                        <-- cron schedule to run at, optional
next="hello"                                                 <-- job to run next (comma delimited list ok)
error="print-output"                                         <-- (comma delimited list ook)
timeout=5000                                                 <-- max run length in seconds

Miscellaneous info:

Statuses

OK
ER
GO
CL
TI (Timed out)
SB (Job started before latest boot)
SK (Skipped/gavewayto)

Storage

Config, logs and states are held in $HOME/.kin_dir (symlinks supported)

Installation:

The kin executable file can be downloaded from the RELEASES page and stored in your path (e.g. $HOME/bin)

then running kin start will install and activate a user service

Building the executable yourself:

After cloning repo, install.sh will build the application and distribute it to your $home/bin directory.

About

Process manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors