piku, inspired by dokku, allows you do git push deployments to your own servers, no matter how small they are.
 
 
 
Go to file
Rui Carmo c875d4f121 Readability 2016-04-03 17:18:25 +01:00
examples/python Nicer example app 2016-04-02 00:58:47 +01:00
.gitignore Initial commit 2016-03-26 12:52:54 +00:00
DESIGN.md ENV docs 2016-04-02 20:16:44 +01:00
INSTALL.md Readability 2016-04-03 17:18:25 +01:00
LICENSE Initial commit 2016-03-26 12:53:50 +00:00
README.md Installation instructions and SSH key helper 2016-04-03 17:14:15 +01:00
piku.py Installation instructions and SSH key helper 2016-04-03 17:14:15 +01:00
requirements.txt Documentation 2016-03-28 23:28:38 +01:00
uwsgi-piku.dist Tweaks 2016-03-29 21:41:03 +01:00

README.md

piku

The tiniest Heroku/CloudFoundry-like PaaS you've ever seen, inspired by dokku.

Motivation

I kept finding myself wanting an Heroku/CloudFoundry-like way to deploy stuff on a few remote ARM boards and my Raspberry Pi cluster, but since dokku still doesn't work on ARM and even docker can be overkill sometimes, I decided to roll my own.

Project Status/ToDo:

From the bottom up:

  • Support Node deployments (if at all possible in a sane fashion)
  • chroot/namespace isolation
  • Proxy deployments to other nodes (build on one box, deploy to many)
  • Support Clojure/Java deployments
  • CLI command documentation
  • Support barebones binary deployments
  • Sample Go app
  • Support Go deployments
  • Complete installation instructions (see INSTALL.md, which also has a draft of Go installation steps)
  • Installation helper/SSH key setup
  • Worker scaling
  • Remote CLI commands for changing/viewing applied/live settings
  • Remote tailing of all logfiles for a single application
  • HTTP port selection (and per-app environment variables)
  • Sample Python app
  • Procfile support (wsgi and worker processes for now, web processes being tested)
  • Basic CLI commands to manage apps
  • virtualenv isolation
  • Support Python deployments
  • Repo creation upon first push
  • Basic understanding of how dokku works

Typical Workflow

piku aims to support a Heroku-like workflow, like so:

  • Set up an SSH git remote pointing to piku with the app name as repo name (git remote add paas piku@server:app1)
  • git push paas master your code
  • piku determines the runtime and installs the dependencies for your app (building whatever's required)
    • For Python, it segregates each app's dependencies into a virtualenv
    • For Go, it defines a separate GOPATH for each app
  • It then looks at a Procfile and starts the relevant workers using uWSGI as a generic process manager
  • You can then remotely change application settings (config:set) or scale up/down worker processes (ps:scale) at will.

Later on, I intend to do fancier dokku-like stuff like reconfiguring nginx, but a twist I'm planning on doing is having one piku machine act as a build box and deploy the finished product to another.

Supported Platforms

piku is intended to work in any POSIX-like environment where you have Python, uWSGI and SSH, i.e.: Linux, FreeBSD, Cygwin and the Windows Subsystem for Linux.

As a baseline, I intend to make sure this runs on an original, 256MB Rasbperry Pi Model B (which is where I'm testing it).

Since I have an ODROID-U2, a bunch of Pi 2s and a few more ARM boards on the way, it will be tested on a number of places where running x64 binaries is unfeasible.

Supported Runtimes

piku will support deploying apps written in Python, Go, Clojure (Java) and Node (see above).

FAQ

Q: Why piku?

A: Partly because it's supposed to run on a Pi, because it's Japanese onomatopeia for 'twitch' or 'jolt', and because I know the name will annoy some of my friends.

Q: Why Python/why not Go?

A: I actually thought about doing this in Go right off the bat, but click is so cool and I needed to have uWSGI running anyway, so I caved in. But I'm very likely to take something like suture and port this across, doing away with uWSGI altogether.

Q: Does it run under Python 3?

A: It should. click goes a long way towards abstracting the simpler stuff, and I tried to avoid most obvious incompatibilities (other than a few differences in subprocess.call and the like). However, this targets Python 2.7 first, since that's the default on Raspbian. Pull requests are welcome.

Q: Why not just use dokku?

A: I use dokku daily, and for most of my personal stuff. But the dokku stack relies on a number of x64 containers that need to be completely rebuilt for ARM, and when I decided I needed something like this (March 2016) that was barely possible - docker itself is not fully baked for ARM yet, and people are still trying to get herokuish and buildstep to build on ARM.