piku/README.md

77 wiersze
3.9 KiB
Markdown
Czysty Zwykły widok Historia

2016-03-26 12:52:54 +00:00
# piku
2016-03-28 22:28:38 +00:00
The tiniest Heroku/CloudFoundry-like PaaS you've ever seen, inspired by [dokku][dokku].
2016-03-26 12:52:54 +00:00
## Motivation
2016-03-28 22:28:38 +00:00
I kept finding myself wanting an Heroku/CloudFoundry-like way to deploy stuff on a few remote ARM boards and [my Raspberry Pi cluster][raspi-cluster], but since [dokku][dokku] still doesn't work on ARM and even `docker` can be overkill sometimes, I decided to roll my own.
2016-03-26 12:52:54 +00:00
## Project Status/ToDo:
From the bottom up:
2016-03-28 17:10:07 +00:00
- [ ] Support Node deployments (if at all possible in a sane fashion)
2016-03-28 22:28:38 +00:00
- [ ] `chroot`/namespace isolation
- [ ] Proxy deployments to other nodes (build on one box, deploy to many)
2016-03-28 23:00:23 +00:00
- [ ] Support Clojure/Java deployments
2016-03-26 12:52:54 +00:00
- [ ] Support Go deployments
- [ ] Support barebones binary deployments
2016-03-28 22:28:38 +00:00
- [ ] CLI command documentation
2016-03-28 22:56:25 +00:00
- [ ] Complete installation instructions (see `INSTALL.md` for a working draft)
2016-04-02 16:56:48 +00:00
- [ ] Installation helper/SSH key add
- [x] Worker scaling
2016-04-02 15:46:03 +00:00
- [x] Remote CLI commands for changing/viewing applied/live settings
2016-04-02 00:05:19 +00:00
- [x] Remote tailing of all logfiles for a single application
- [x] HTTP port selection (and per-app environment variables)
2016-03-29 21:06:53 +00:00
- [x] Sample Python app
2016-03-31 22:44:36 +00:00
- [X] `Procfile` support (`wsgi` and `worker` processes for now, `web` processes being tested)
2016-03-26 23:38:20 +00:00
- [x] Basic CLI commands to manage apps
2016-03-28 22:28:38 +00:00
- [x] `virtualenv` isolation
2016-03-28 22:56:25 +00:00
- [x] Support Python deployments (currently hardcoded until `Procfile` is implemented)
2016-03-26 12:52:54 +00:00
- [x] Repo creation upon first push
- [x] Basic understanding of [how `dokku` works](http://off-the-stack.moorman.nu/2013-11-23-how-dokku-works.html)
2016-03-26 23:38:20 +00:00
## Workflow
2016-03-26 12:52:54 +00:00
2016-03-26 17:30:45 +00:00
* 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
2016-03-28 22:28:38 +00:00
* `piku` determines the runtime and installs the dependencies for your app (building whatever's required)
2016-04-02 00:05:19 +00:00
* For Python, it segregates each app's dependencies into a `virtualenv`
2016-03-27 11:54:25 +00:00
* It then looks at a `Procfile` and starts the relevant workers using [uWSGI][uwsgi] as a generic process manager
2016-03-26 12:52:54 +00:00
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.
Might take a while, though.
2016-03-26 23:38:20 +00:00
## Target Platforms
2016-03-26 13:05:52 +00:00
As a baseline, I intend to make sure this runs on the original Rasbperry Pi Model B (which is where I'm testing it).
But since I have an ODROID-U2, [a bunch of Pi 2s][raspi-cluster] and a few more boards on the way, it will be tested on a number of places where running `x64` binaries is unfeasible.
In general, it will likely work in any POSIX-like environment where you have Python and SSH (I'm very likely to test it under [Cygwin][cygwin] at some point).
2016-03-26 23:38:20 +00:00
## Target Runtimes
2016-03-26 12:52:54 +00:00
2016-04-02 00:05:19 +00:00
I intend to support Python, Go, Node and Clojure (Java), but will be focusing on Python first.
2016-03-26 12:52:54 +00:00
## FAQ
**Q:** Why `piku`?
2016-03-26 13:05:52 +00:00
**A:** Partly because it's supposed to run on a [Pi][pi], because it's Japanese onomatopeia for 'twitch' or 'jolt', and because I know the name will annoy some of my friends.
2016-03-26 12:52:54 +00:00
2016-03-28 23:00:23 +00:00
**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.
2016-03-26 12:52:54 +00:00
**Q:** Why not just use `dokku`?
2016-03-28 22:55:02 +00:00
**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.
2016-03-26 12:52:54 +00:00
[pi]: http://www.raspberrypi.org
[dokku]: https://github.com/dokku/dokku
2016-03-26 13:05:52 +00:00
[raspi-cluster]: https://github.com/rcarmo/raspi-cluster
2016-03-26 23:38:20 +00:00
[cygwin]: http://www.cygwin.com
2016-03-31 22:44:36 +00:00
[uwsgi]: https://github.com/unbit/uwsgi