Coder Social home page Coder Social logo

overmind's Introduction

Overmind

Build Status

Overmind is a process manager for Procfile-based applications and tmux. With Overmind, you can easily run several processes from your Procfile in a single terminal.

Procfile is a simple format to specify types of processes your application provides (such as web application server, background queue process, front-end builder) and commands to run those processes. It can significantly simplify process management for developers and is used by popular hosting platforms, such as Heroku and Deis. You can learn more about the Procfile format here or here.

There are some good Procfile-based process management tools, including foreman by David Dollar, which started it all. The problem with most of those tools is that processes you want to manage start to think they are logging their output into a file, and that can lead to all sorts of problems: severe lagging, losing or breaking colored output. Tools can also add vanity information (unneeded timestamps in logs). Overmind was created to fix those problems once and for all.

Sponsored by Evil Martians

Overmind features

You may know several Procfile process management tools, but Overmind has some unique, extraterrestrial powers others don't:

  • Overmind starts processes in a tmux session, so you can easily connect to any process and gain control over it;
  • Overmind can restart a single process on the fly — you don't need to restart the whole stack;
  • Overmind allows a specified process to die without interrupting all of the other ones;
  • Overmind uses pty to capture process output — so it won't be clipped, delayed, and it won't break colored output;
  • Overmind can read environment variables from a file and use them as parameters so that you can configure Overmind behavior globally and/or per directory.

If a lot of those features seem like overkill for you, especially the tmux integration, you should take a look at Overmind's little sister — Hivemind!

Overmind screenshot

Installation

Note: At the moment, Overmind supports Linux, *BSD, and macOS only.

Overmind works with tmux, so you need to install it first:

# on macOS (with homebrew)
$ brew install tmux

# on Ubuntu
$ apt-get install tmux

Note: You can find installation manual for other systems here: https://github.com/tmux/tmux

There are two ways to install Overmind:

Download the latest Overmind release binary

You can download the latest release here.

Build Overmind from source

You need Go 1.6 or later to build the project.

$ go get -u -f github.com/DarthSim/overmind

Note: You can update Overmind the same way.

Usage

In short: You can get help by running overmind -h and overmind help [command].

Running processes

Overmind reads the list of processes you want to manage from a file named Procfile. It may look like this:

web: bin/rails server
worker: bundle exec sidekiq
assets: gulp watch

To get started, you just need to run Overmind from your working directory containing a Procfile:

$ overmind start

You can also use the short alias:

$ overmind s

Specifying a Procfile

If a Procfile isn't located in your working directory, you can specify the exact path:

$ overmind start -f path/to/your/Procfile
$ OVERMIND_PROCFILE=path/to/your/Procfile overmind start

Running only the specified processes

You can specify the names of processes you want to run:

$ overmind start -l web,sidekiq
$ OVERMIND_PROCESSES=web,sidekiq overmind start

Processes that can die

Usually, when a process dies, Overmind will interrupt all other processes. However, you can specify processes that can die without interrupting all other ones:

$ overmind start -c assets,npm_install
$ OVERMIND_CAN_DIE=assets,npm_install overmind start

Connecting to a process

If you need to gain access to process input, you can connect to its tmux window:

$ overmind connect [process_name]

Restarting a process

You can restart a single process without restarting all the other ones:

$ overmind restart sidekiq

You can restart multiple processes the same way:

$ overmind restart sidekiq assets

Killing processes

If something goes wrong, you can kill all running processes:

$ overmind kill

Overmind environment

If you need to set specific environment variables before running a Procfile, you can specify them in the .overmind.env file in the current working directory and/or your home directory. The file should contain variable=value pairs, one per line:

PATH=$PATH:/additional/path
OVERMIND_CAN_DIE=npm_install
OVERMIND_PORT_BASE=3000

Specifying a socket

Overmind receives commands via a Unix socket. Usually, it opens a socket named .overmind.sock in a working directory, but you can specify the full path:

$ overmind start -s path/to/socket

All other commands support the same flag:

$ overmind connect -s path/to/socket web
$ overmind restart -s path/to/socket sidekiq
$ overmind kill -s path/to/socket

Author

Sergey "DarthSim" Aleksandrovich

Highly inspired by Foreman.

Many thanks to @antiflasher for the awesome logo.

License

Overmind is licensed under the MIT license.

See LICENSE for the full license text.

overmind's People

Contributors

darthsim avatar

Watchers

Stan Sobolev avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.