|
1 | 1 | # Launch |
2 | 2 |
|
3 | | -A simple runtime-agnostic process manager that eases Docker services startup and logging. |
4 | | -Consider it a half way house between Kubernetes and Docker. |
| 3 | +A lightweight process manager designed to run as PID 1 in Docker containers. |
5 | 4 |
|
6 | | -Launch is expected to be process 1 in a container. It allows you to watch other processes in your containers and when they are all finished it will finish allowing containers to stop correctly. |
| 5 | +Launch lets you run multiple processes in a single container with centralized logging, ordered startup hooks, and graceful signal propagation. |
7 | 6 |
|
8 | | -## What can Launch help with |
| 7 | +## Features |
9 | 8 |
|
10 | | -Launch is designed to be a process manager with simple but powerful logging. It borrows some ideas from kubernetes without having to deploy a kubernetes stack. |
| 9 | +- Run **multiple processes** in one container. |
| 10 | +- **Secret collection** runs first and injects output as environment variables for all later processes. |
| 11 | +- **Init processes** run sequentially after secrets — any failure aborts startup. |
| 12 | +- **Main processes** run in parallel; if one exits, Launch sends SIGTERM to all remaining ones and waits for shutdown. |
| 13 | +- Ship logs to **console, file, syslog, or /dev/null** independently per process. |
| 14 | +- **Templated YAML config** — inject environment variables and use built-in helper functions. |
11 | 15 |
|
12 | | -* You can run multiple processes in a single container. |
13 | | -* You can ship logs from processes to different logging engines. |
14 | | -* You can run init processes that run before your main processes. This allows you to collect artifacts, secrets or just setup an environment. |
15 | | -* A single main process dying will bring down a container, gracefully shutting down the other applications. |
| 16 | +## How it works |
16 | 17 |
|
17 | | -## Configuration |
18 | | - |
19 | | -More details can be found in the [README Folder](./READMEs/) |
| 18 | +``` |
| 19 | +Startup sequence: |
| 20 | + 1. Read and render config file (first pass — container env vars available) |
| 21 | + 2. Run secret processes → capture stdout JSON and inject as env vars |
| 22 | + 3. Re-render config file (second pass — secret env vars now available) |
| 23 | + 4. Run init processes sequentially — any non-zero exit aborts startup |
| 24 | + 5. Start main processes in parallel |
| 25 | + 6. Wait — when any main process exits, send SIGTERM to all others and shut down |
| 26 | +``` |
20 | 27 |
|
21 | 28 | ## Processes |
22 | 29 |
|
23 | | -Launch has 3 processes types when running. |
| 30 | +Launch supports three types of processes, each with a distinct role. |
24 | 31 |
|
25 | 32 | ### Secret processes |
26 | 33 |
|
27 | | -These are used to collect secret data like username and passwords at startup. |
| 34 | +Run before anything else. They collect credentials or other secrets and expose them as environment variables. Because full logging is not yet available at this stage, output goes to the console. |
28 | 35 |
|
29 | 36 | ### Init processes |
30 | 37 |
|
31 | | -These are used to configure the state of the container or collect more resources that don't need to be exported to environment variables. |
| 38 | +Run sequentially after secrets. Use these for setup tasks — running migrations, fetching config, preparing the filesystem. All init processes must succeed before main processes start. |
32 | 39 |
|
33 | | -### Main Processes |
| 40 | +### Main processes |
34 | 41 |
|
35 | | -These are the long running processes in your containers. |
| 42 | +The long-running processes in your container. They start in parallel and are expected to run for the lifetime of the container. If any one of them exits, Launch sends SIGTERM to all the others. |
36 | 43 |
|
37 | 44 | ## Configuration |
38 | 45 |
|
39 | | -The configuration YAML file is the driving force behind Launch. The configuration file will tell Launch what processes to run with what arguments, where to send logs. |
| 46 | +The configuration is driven by a YAML file. Run the following to generate an annotated example: |
| 47 | + |
| 48 | +```bash |
| 49 | +./launch -example-config |
| 50 | +``` |
40 | 51 |
|
41 | | -The configuration file has a templating feature that allows you to make the configuration dynamic. |
| 52 | +Full documentation: |
42 | 53 |
|
43 | | -The configuration file has many sections that are documented in the |
44 | | -[README dedicated to configuration](./READMEs/ConfigurationFile.MD). |
| 54 | +- [Configuration reference](./READMEs/ConfigurationFile.md) — all sections and options |
| 55 | +- [Logging engines](./READMEs/Logging.md) — console, file, syslog, `/dev/null` |
| 56 | +- [Secrets](./READMEs/Secrets.md) — how secret collection works |
45 | 57 |
|
46 | 58 | ## Contributing |
47 | 59 |
|
48 | | -This project is still very much in active development. Expect changes and improvements. |
| 60 | +This project is still in active development. There is a simple build script for integration testing. |
49 | 61 |
|
50 | | -There is a simple build script that does the current integration testing. |
| 62 | +```bash |
| 63 | +# Run tests only |
| 64 | +./build_and_test.sh |
51 | 65 |
|
52 | | -Use `./build_and_test.sh` to run only the tests |
53 | | -Use `./build_and_test.sh` gobuild" to also rebuild the go project |
| 66 | +# Rebuild the binary and run tests |
| 67 | +./build_and_test.sh gobuild |
| 68 | +``` |
0 commit comments