piku / piku
- среда, 12 июня 2024 г. в 00:00:02
The tiniest PaaS you've ever seen. Piku allows you to do git push deployments to your own servers.
piku, inspired by dokku, allows you do git push deployments to your own servers, no matter how small they are.
TL;DR:
curl https://piku.github.io/get | shThere are also other installation methods available, including cloud-init and manual installation.
piku is considered STABLE. It is actively maintained, but "actively" here means the feature set is pretty much done, so it is only updated when new language runtimes are added or reproducible bugs crop up.
It currently requires Python 3.7 or above, since even though 3.8+ is now the baseline Python 3 version in Ubuntu LTS 20.04 and Debian 11 has already moved on to 3.9, there are no substantial differences between those versions.
We wanted an Heroku/CloudFoundry-like way to deploy stuff on a few ARM boards, but since dokku didn't work on ARM at the time and even docker can be overkill sometimes, a simpler solution was needed.
piku is currently able to deploy, manage and independently scale multiple applications per host on both ARM and Intel architectures, and works on any cloud provider (as well as bare metal) that can run Python, nginx and uwsgi.
piku supports a Heroku-like workflow:
git SSH remote pointing to your piku server with the app name as repo name:
git remote add piku piku@yourserver:appname.git push piku master (or if you want to push a different branch than the current one use git push piku release-branch-name).piku determines the runtime and installs the dependencies for your app (building whatever's required).
virtualenv.GOPATH for each app.package.json into node_modules.pom.xml or build.gradle file.leiningen or the Clojure CLI and a deps.edn file.bundle install of your gems in an isolated folder.Procfile and starts the relevant workers using uwsgi as a generic process manager.release worker which is run once when the app is deployed.config:set) or scale up/down worker processes (ps:scale).nginx settings into an ENV file.
You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.piku has full virtual host support - i.e., you can host multiple apps on the same VPS and use DNS aliases to access them via different hostnames.
piku will also set up either a private certificate or obtain one via Let's Encrypt to enable SSL.
If you are on a LAN and are accessing piku from macOS/iOS/Linux clients, you can try using piku/avahi-aliases to announce different hosts for the same IP address via Avahi/mDNS/Bonjour.
Besides static sites, piku also supports directly mapping specific URL prefixes to filesystem paths (to serve static assets) or caching back-end responses (to remove load from applications).
These features are configured by setting appropriate values in the ENV file.
piku is intended to work in any POSIX-like environment where you have Python, nginx, uwsgi and SSH: it has been deployed on 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.
But its main use is as a micro-PaaS to run applications on cloud servers with both Intel and ARM CPUs, with Debian and Ubuntu Linux as target platforms.
piku currently supports apps written in Python, Node, Clojure, Java and a few other languages (like Go) in the works.
But as a general rule, if it can be invoked from a shell, it can be run inside piku.
git, ssh, uwsgi, nginx).