Giter Site home page Giter Site logo

slugrunner's Introduction

Panoply Slugrunner

The Slugrunner is a Docker container that will run Heroku-like slugs. A slug is essentially a gzipped tarball of an application that is self-contained and includes everything it needs to run. These slugs can be built from panoplymedia/slugbuilder, lxfontes/slugbuilder, deis/slugbuilder and the like.

Requirements

You will need to have Docker installed and set up on your system.

Installation

docker pull panoplymedia/slugrunner

Usage

You will use docker run to run your slug in this container, passing a string argument at the end, which will be run.

# ellipses notate additional args
docker run ... panoplymedia/slugrunner npm start

docker run ... panoplymedia/slugrunner bundle exec rails s

Alternatively, if your slug contains a Procfile you can use the start command followed by the name of the process.

# Procfile
web: npm start
worker: node worker.js
# ellipses notate additional args
docker run ... panoplymedia/slugrunner start web

There are various ways you can pass the slug in to be run:

STDIN

cat myslug.tgz | docker run -i -a stdin -a stdout panoplymedia/slugrunner start worker

SLUG_URL Environment Variable

By specifying the SLUG_URL as an environment variable, it will use the slug located at that URL.

docker run -e SLUG_URL=http://example.org/myslug.tgz panoplymedia/slugrunner bundle exec rails s

Amazon S3

You can also use a slug from Amazon S3 with the following environment variables:

  • SLUG_KEY: s3-bucket-name/path/to/slug.tgz
  • SLUG_AWS_KEY: your AWS access key
  • SLUG_AWS_SECRET: your AWS secret access key
docker run -e SLUG_KEY=my-bucket/items/stuff/someslug.tgz -e SLUG_AWS_KEY=XXX -e SLUG_AWS_SECRET=XXX panoplymedia/slugrunner start web

Google Cloud Storage

You may use Google Cloud with a developer access key and secret key. Alternatively you may use service account credentials.

To use a slug from Google Cloud Storage with a developer access key and secret key, follow Google's documentation and then provide the following environment variables:

  • SLUG_KEY: cloud-storage-bucket-name/path/to/slug.tgz
  • SLUG_GOOGLE_KEY: your Cloud Storage access key
  • SLUG_GOOGLE_SECRET: your Cloud Storage secret access key
docker run -e SLUG_KEY=my-bucket/items/stuff/someslug.tgz -e SLUG_GOOGLE_KEY=XXX -e SLUG_GOOGLE_SECRET=XXX panoplymedia/slugrunner start web

To use a slug from Google Cloud Storage with service account credentials, follow Google's documentation to generate a JSON service account credential and convert the credential into a Base64 string. Then provide the following environment variables:

  • SLUG_KEY: cloud-storage-bucket-name/path/to/slug.tgz
  • SLUG_GOOGLE_ACCOUNT_KEY_B64: your Base64 encoded JSON-formatted Google service account credentials

Debugging

Set environment variable DEBUG=true to get debug output from the script.

Motivation and Thanks

This library is heavily based on deis/slugrunner, and most notably adds the option to run a slug off of Amazon S3 and Google Cloud Storage.

slugrunner's People

Contributors

jdlehman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.