Process Compose is a simple and flexible scheduler and orchestrator to manage non-containerized applications.
Go to file
2022-04-16 01:44:27 +03:00
.github/workflows Create go.yml 2022-04-07 00:54:42 +03:00
examples Initial Commit 2022-04-06 00:26:50 +03:00
fixtures Windows Support with CMD 2022-04-16 01:44:27 +03:00
imgs Initial Commit 2022-04-06 00:26:50 +03:00
src Windows Support with CMD 2022-04-16 01:44:27 +03:00
.editorconfig added .editorconfig 2022-04-06 01:30:46 +03:00
.gitignore Initial Commit 2022-04-06 00:26:50 +03:00
go.mod Initial Commit 2022-04-06 00:26:50 +03:00
go.sum Initial Commit 2022-04-06 00:26:50 +03:00
LICENSE Initial Commit 2022-04-06 00:26:50 +03:00
Makefile Windows Support with CMD 2022-04-16 01:44:27 +03:00
process-compose-win.yaml Windows Support with CMD 2022-04-16 01:44:27 +03:00
process-compose.yaml Windows Support with CMD 2022-04-16 01:44:27 +03:00
README.md Log level support 2022-04-07 00:32:09 +03:00
test_loop.bash Initial Commit 2022-04-06 00:26:50 +03:00
test_loop.ps1 Windows Support with CMD 2022-04-16 01:44:27 +03:00

Process Compose

made-with-Go Linux Maintenance PRs Welcome Go Report

Process compose is a lightweight utility for building custom workflows and execution sequences. It is optimized for:

  • Parallelizing processes execution
  • Defining execution dependencies and order
  • Defining recovery policies (restart on-failure, always, no)
  • Declaring processes arguments
  • Declaring processes environment variables

It is heavily inspired by docker-compose, but without the need for containers. The configuration syntax tries to follow the docker-compose specifications, with a few minor additions and lots of subtractions.

Installation

Documentation

  • See examples of workflows for best practices
  • See below

List of Features and Planned Features

Mostly implemented
Implementation not started (Your feedback and will motivate further development 😃)

Launcher

Parallel
process1:
  command: "sleep 3"
process2:
  command: "sleep 3"
Serial
process1:
  command: "sleep 3"
  depends_on:
    process2: 
      condition: process_completed_successfully # or "process_completed" if you don't care about errors
process2:
  command: "sleep 3"
  depends_on:
    process3: 
      condition: process_completed_successfully # or "process_completed" if you don't care about errors
Instance Number
Define process dependencies
process2:
  depends_on:
  process2: 
    condition: process_completed_successfully # or "process_started" (default)
  process3: 
    condition: process_completed_successfully

Output Handling

Show process name
Different colors per process
StdErr is printed in Red
output
Silence specific processes

Logger

Per Process Log Collection
process2:
  log_location: ./pc.process2.log #if undefined or empty no logs will be saved
Capture StdOut output
Capture StdErr output
Merge into a single file
processes:
  process2:
    command: "chmod 666 /path/to/file"
environment:
  - 'ABC=42'
log_location: ./pc.global.log #if undefined or empty no logs will be saved (if also not defined per process)
Silence specific processes
Process compose console log level
log_level: info # other options: "trace", "debug", "info", "warn", "error", "fatal", "panic"
processes:
  process2:
    command: "chmod 666 /path/to/file"

This setting controls the process-compose log level. The processes log level should be defined inside the process. It is recommended to support its definition with an environment variable that can be defined in process-compose.yaml

Health Checks

Is Alive
Is Ready
Auto Restart if not healthy
Auto Restart on exit
process2:
  availability:
    restart: on-failure # other options: "always", "no" (default)
    backoff_seconds: 2  # default: 1
    max_restarts: 5 # default: 0 (unlimited)

Environment Variables

Per Process
process2:
  environment:
    - 'I_AM_LOCAL_EV=42'
Global
processes:
  process2:
    command: "chmod 666 /path/to/file"
  environment:
    - 'I_AM_LOCAL_EV=42'		
environment:
  - 'I_AM_GLOBAL_EV=42'

System Variables

Process replica number
Monitoring
REST API

Configuration

Support .env file
Override ${var} and $var from environment variables or .env values
Merge 2 or more configuration files with override values
Specify which configuration files to use
process-compose -f "path/to/process-compose-file.yaml"
Auto discover configuration files

The following discovery order is used: compose.yml, compose.yaml, process-compose.yml, process-compose.yaml. If multiple files are present the first one will be used.

Multi-platform

Linux
Windows
macOS