The tiniest PaaS you've ever seen. Piku allows you to do git push deployments to your own servers.
The tiniest Heroku/CloudFoundry-like PaaS you've ever seen.
piku, inspired by dokku, allows you do
git pushdeployments to your own servers.
dockercan be overkill sometimes, I decided to roll my own.
pikusupports a Heroku-like workflow, like so:
gitSSH remote pointing to your
pikuserver with the app name as repo name.
git remote add piku [email protected]:appname.
git push piku master.
pikudetermines the runtime and installs the dependencies for your app (building whatever's required).
GOPATHfor each app.
Procfilewhich is documented here and starts the relevant workers using uWSGI as a generic process manager.
releaseworker which is run once when the app is deployed.
config:set) or scale up/down worker processes (
ENVwhich is documented here.
staticworker type, with the root path as the argument, can be used to deploy a gh-pages style static site.
pikuyou need a VPS, Raspberry Pi, or other server bootstrapped with
piku's requirements. You can use a single server to run multiple
Warning: You should use a fresh server or VPS instance without anything important running on it already, as
piku-bootstrapwill make changes to configuration files, running services, etc.
Once you've got a fresh server, download the piku-bootstrap shell script onto your local machine and run it:
curl https://piku.github.io/get | sh
The first time it is run
piku-bootstrapwill install itself into
~/.piku-bootstrapon your local machine and set up a virtualenv there with the dependencies it requires. It will only need to do this once.
The script will display a usage message and you can then bootstrap your server:
./piku-bootstrap [email protected]
If you put the
piku-bootstrapscript on your
PATHsomewhere, you can use it again to provision other servers in the future.
See below for instructions on installing other custom dependencies that your apps might need like a database etc.
To make life easier you can also install the piku helper CLI. Install it into your path e.g.
~/binto run it from anywhere.
./piku-bootstrap install-cli ~/bin
This shell script makes working with
pikuremotes a bit simpler. If you have a git remote called
pikuin the current folder it will infer the remote server and app name and insert those into the remote piku commands. This allows you to execute commands like the following on your running remote app:
$ piku logs $ piku config:set MYVAR=12 $ piku stop $ piku deploy $ piku destroy $ piku #
You can pass flags through to the underlying SSH command, for example-tto run interactive commands remotely, and-Ato proxy authentication credentials in order to do remote git pulls.
Here is an example of using the-tflag to obtain abashshell in the app directory of one of your Piku apps:$ piku -t run bash Piku remote operator. Server: [email protected]cloud.mccormickit.com App: dashboard
[email protected]:~/.piku/apps/dashboard$ ls data ENV index.html package.json package-lock.json Procfile server.wisp
Tip: If you put thispikuscript on yourPATHyou can use thepikucommand across multiple apps on your local.
Installing other dependenciespiku-bootstrapuses Ansible internally and it comes with several extra built-in playbooks which you can use to bootstrap common components onto yourpikuserver.
Usepiku-bootstrap list-playbooksto show a list of built-in playbooks, and then to install one add it as an argument to the bootstrap command.
For example, to deploynodeenvonto your server:piku-bootstrap [email protected] nodeenv.yml
You can also usepiku-bootstrapto run your own Ansible playbooks like this:piku-bootstrap [email protected] ./myplaybook.yml
If you are on a LAN and are accessingpikufrom macOS/iOS/Linux clients, you can try usingpiku/avahi-aliasesto announce different hosts via Avahi/mDNS/Bonjour.
Supported Platformspikuis 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, it began its development on an original, 256MB Rasbperry Pi Model B, and still runs reliably on it.
Since I have an ODROID-U2, a bunch of Pi 2s and a few more ARM boards on the way, it is often tested on a number of places where runningx64binaries is unfeasible.
But there are already a few folk usingpikuon vanillax64Linux without any issues whatsoever, so yes, you can use it as a micro-PaaS for 'real' stuff. Your mileage may vary.
Supported Runtimespikucurrently supports deploying apps (and dependencies) written in Python, with Go, Clojure (Java) and Node (see above) in the works. But if it can be invoked from a shell, it can be run insidepiku.