Overmind

repository·master·Indexed 25 days ago

https://github.com/darthsim/overmind

A process manager for Procfile-based applications that leverages tmux to manage multiple processes in a single terminal session. It provides features for individual process restarts, automatic restarts, and seamless tmux integration for process control. Overmind can be installed via Homebrew, RubyGems, binary download, or built from source using Go 1.21+.

Tokens
3.4K
Snippets
11
Records
32
Agent score
86%

What's inside Overmind

  1. Compile tmux binaries for Linux using Docker buildx

    master

    To build multi-architecture tmux binaries for Linux platforms (amd64, arm64, arm/v7, and 386), use docker buildx. The resulting binaries will be placed in the ./dist directory.

    docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/386 -t tmux-multiarch:latest --output type=local,dest=./dist data
  2. Build Overmind from source

    master

    To build Overmind from source, you must have Go 1.21 or later installed. The binary will be installed to $(go env GOPATH)/bin. Ensure this directory is in your PATH.

    $ go install github.com/DarthSim/overmind/v2@latest
  3. Build Overmind gems for multiple platforms

    master

    To build Overmind gems for all supported platforms (Linux, macOS, and FreeBSD), ensure you have run bundle install first, then use the rake "overmind:build:all" command.

    Requirements:

    • overmind and tmux binaries must exist in the GitHub release.
    • Ruby version must be at least 3.0 to support the --platform argument in RubyGems.
    bundle install
    rake "overmind:build:all"
  4. Run processes using Overmind

    master

    Overmind manages processes defined in a Procfile. By default, it looks for a file named Procfile in your current working directory.

    To start processes:

    • In a Rails project with binstubs: bin/overmind start
    • In a standard Ruby project: overmind start

    To specify a custom Procfile path, use the -f flag or the OVERMIND_PROCFILE environment variable.

  5. Connect to a running process

    master

    To interact with a specific process (e.g., for debugging or providing input), use the connect command. This connects you to the process's tmux window.

    • To connect to a specific process: bin/overmind connect <process_name>
    • To connect to the first process defined in the Procfile: bin/overmind connect

    To safely disconnect from the window without stopping the process, press your tmux prefix (usually Ctrl b) followed by d.

    bin/overmind connect web
  6. Configure Overmind for a Rails project

    master

    To integrate Overmind into a Rails application, add it to your Gemfile within the development group, generate a binstub, and create a bin/dev script to manage your development processes.

    Steps:

    1. Add to Gemfile:
      group :development do
        gem "overmind"
      end
    2. Generate binstubs:
      bundle binstubs overmind
    3. Create or update bin/dev:
      #!/usr/bin/env sh
      
      bin/overmind start -f Procfile.dev
    group :development do
      gem "overmind"
    end