Live data from Hacker News

Piku: Allows git push deployments to your own servers

github.com

91–100 of 169 posts

Re: Piku: Allows git push deployments to your own servers

#91
post #57

[flagged]

> set -e > echo "Downloading piku-bootstrap here." > curl -s bootstrap" rel="nofollow">https://raw.githubusercontent.com/piku/piku-bootstrap/master... > piku-bootstrap > chmod 755 piku-bootstrap > echo "Now you can install Piku on `hostname` like this:" > echo "./piku-bootstrap install" Did you look at the script?

the script is irrelevant.

it's the culture it attracts/creates when you start with this.

and while i didn't look at the script for the reason above, i did look at the site and found no high level or architecture designs links.

good luck basing, even your dev, infrastructure on things like this.

Re: Piku: Allows git push deployments to your own servers

#92
post #29

Does someone know how it handles (if any) zero downtime deployments? Like, if your Python service is running in one machine on port 8080 behind nginx, how does piku switch to a fresh instance running in the same port?

Slightly off-topic, but you can do zero downtime deployments using systemd and socket activation.

Re: Piku: Allows git push deployments to your own servers

#93
post #77

Earlier quoted context omitted.

Thanks for the explanation, official repo doesn't make it clear enough for me. So, did I understand correctly, that Pico installs both an agent on the remote machine and a commit hook on the local machine? Why didn't they minimize the overhead by just making the remote machine a Git remote and do all the work there when you push a specific branch to that remote?

piku installs an agent on the remote machine (piku.py) which itself also provides the support for making that machine a git remote. There is no commit hook on the local machine. On the local machine, you simply have a shim named "piku" which is essentially running "ssh remote /path/to/piku.py $@" to control the remote machine.

Thanks for clarifying!

Re: Piku: Allows git push deployments to your own servers

#94
post #88
post #77

Earlier quoted context omitted.

Thanks for the explanation, official repo doesn't make it clear enough for me. So, did I understand correctly, that Pico installs both an agent on the remote machine and a commit hook on the local machine? Why didn't they minimize the overhead by just making the remote machine a Git remote and do all the work there when you push a specific branch to that remote?

You’re confusing things, there is only the remote, the local machine doesn’t need anything. We do have a simple CLI you can run locally, but all it does is ssh remote to scale up/down workers, change settings, etc.

Thanks for clarifying!

Re: Piku: Allows git push deployments to your own servers

#95
post #4

This looks good, and Dokku has been very solid for me, but removing the Docker dependency means that now I'm beholden to my OS's choices. For apps that might run for years without maintenance, that's not ideal, as you'll quickly find you need a specific version of the OS for them.

Question - how can dependency hell be solved when using such a tool?

It seems so elegant and I love the "it just works" attitude, and I do understand that docker can't be used everywhere due to its technical (and mental) overhead, but I love it because it allows to isolate everything, freeze everything in time so running a container 5 years for now "just works".

In my humble workflow, I'm using lazydocker to manage the containers, gitlab workflow (action?) for deployment on push and a small VPS to build and push the containers to gitlab registry and to run it, on the same VPS. It's a little bit overkill - I could use a combination of a Dockerfile and a compose.yml with docker compose build. Also, I didn't figure out scaling yet. Good thing I don't need it! Otherwise I would swap docker for k8s and lazydocker for k9s.

(I'm open to suggestions. I just got into devops, and I love it!)

Re: Piku: Allows git push deployments to your own servers

#97
post #79

That is brilliant. Something complex, but not complicated. A project distilled down to its UNIX essence: hackable, lean, and magic. That said I want to give this a go but don't immediately see how I can migrate my overengineered 8-10 container spaghetti of a docker-compose file to a state where I can use piku instead of manual 'git pull && docker compose up' on the remote

That kind of situation was what drove me to go simpler :)

Yes it's me, not you ;)

Currently hyping myself up to drastically simplify everything, which will be a joy onto itself

Re: Piku: Allows git push deployments to your own servers

#98

I love piku. I wrote a webapp tutorial for piku which got turned into a repo as part of the official GitHub piku org. You can find that here: https://github.com/piku/webapp-tutorial?tab=readme-ov-file#b... It explains how piku works under the hood, as well as showing a minimalistic Python web app example from a user standpoint.

The new piku docs are pretty but, as a potential new user very interested in trying piku, the new docs are completely useless to me. I gave up on piku because the docs essentially assume I already know everything I need to know to run and use piku. Your doc fixes that, but I never found your doc even after spending quite a bit of time trying to figure out how and whether I could use piku. I never would have known it existed without your comment here.

At a minimum, your doc should be prominently linked to from both the piku repo and the piku docs (or more prominently linked, if it's already linked somewhere), if not pulled completely into the docs home page.

That said, if you're interested in a suggestion, take a look at an end-to-end coolio tutorial that shows how to go from new bare metal server to publicly accessible custom domain name with SSL cert, and add the extra steps to your doc (even though yes, they have nothing directly to do with piku, because they have everything to do with what a potential new user actually wants to do and the potential new user doesn't know how to do those steps yet even though you do).

Your doc is already hundreds of times more useful than the main piku docs page. Extending your doc to cover an example of how to get to exposing a publicly accessible custom domain with SSL cert would make your doc hundreds of times more useful than it is now. Yes, I know, there are a ton of ways to get from where your doc ends to a publicly available custom domain with SSL cert. Pick one. It doesn't matter what you pick. The person who cares which approach you use already knows how to do the approach they prefer. You're adding these steps for the person who doesn't know how to do any of the anpproaches and just wants to get to their site hosted on a $5 droplet or whatever.

Again, your page is a huge help, this suggestion is just about making your page a huger help.

For reference, here's a sample coolio end-to-end example showing how they go from bare metal to publicly accessible custom domain with SSL:

https://billyle.dev/posts/self-hosting-your-website-with-coo...

The goal of all this isn't about making it possible to do things, it's about massively increasing the number of people who adopt piku by making it easier for more people to do so.

Re: Piku: Allows git push deployments to your own servers

#99
post #89

Earlier quoted context omitted.

That’s pretty funny. You may want to look a little further field to discover that the machines with Python are far from “all the machines” out there. Particularly production servers, which, if they run responsibly, are hardened with every extraneous bit of software removed.

I developed security software in Python that ran on 100k+ production nodes covering dozens of operating systems. They all had Python.

Counter-anecdote: none of my Linux PCs have python.

Re: Piku: Allows git push deployments to your own servers

#100
post #50

First time I read about piku. I have no idea why, but the feeling of `git push` to initiate a deployment like piku does always felt magical to me. There's nothing simpler than that. This is timely for me as well as I just open sourced (yesterday!) a project that is in the same space, but for Kubernetes ( https://github.com/pier-oliviert/sequencer ). All of this to say, congrats! It looks great.

It works like magic, but it's also extremely simple to DIY if you wanna learn. If you set up a server, you can create a git repo by just doing `git init --bare`, add the setting `git config receive.denyCurrentBranch updateInstead`. After that you can use git hooks (more specifically push-to-checkout hook), to receive uploads, compile and launch. The hook will just be a simple shell script, the most basic version coul…

I've been doing almost exactly this. Have set up Ansible to automate it.

Why would I want to use Piku? Would it give me some benefits I currently don't have?

Post reply on HN