Giter Club home page Giter Club logo

shipper's Introduction

Shipper

Shipper is a fabric for docker - tool for orchestrating docker containers. Supports parallel execution and can generate command line interface.

hello.py:

from shipper import Shipper, run, command

@command
def hello():
   print Shipper().containers(pretty=True)
 
run() 

Now your file is a fully functional command line tool that talks to local docker!

python hello.py -h
python hello.py hello -h
python hello.py hello

The fun part is you can turn your tiny hello.py to a massive scale docker client in 1 change:

print Shipper(["host-a", "host-b", "host-c", "host-d"]).containers(pretty=True)

All the steps would be executed in parallel.

More complex example:

from shipper import Shipper, run, command

@command
def build(tag, path):
    s = Shipper()
    s.build(tag=tag, path=path)

@command
def ps(all=False, running=True):
    s = Shipper(["host-a", "host-b"])
    print s.containers(pretty=True, all=all, running=running)

@command
def start(image, command, ports=None):
    if ports:
        ports = ports.split(",")
    s = Shipper()
    s.run(image, command, ports=ports, once=True)

@command
def stop(image=None):
    s = Shipper()
    s.stop(*s.containers(image=image, running=True))

run()

Now you can use the env.py file as your command line tool, shipper has generated the command line interface.

python env.py ps --all
python env.py build base ~/images/base
python env.py build stop --image dev/.*

Setup

git clone [email protected]:mailgun/shipper.git
cd shipper
python setup.py install

Status

Undergoing development. Is already useful for building dev environments.

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.