Live data from Hacker News

Piku: Allows git push deployments to your own servers

github.com

151–160 of 169 posts

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

#151
I use dokku for my side gigs and it works best. The performance issue I’ve experienced was when the container with my app was being built and it dramatically increased the load on a $20 vm. Then I migrated to use container registry to utilize GitHub actions for building and pushing containers to the registry and then deploying the container directly on the dokku host. Does piku support that flow?

Another question is subdomain support: to have a catch all virtual host that will respond to anything.domain.tld and have wildcard letsenrypt enabled ssl with DNS challenge.

Those two problems make me think that my side gig has grown up enough to switch to ArgoCD/K8s, although there are many other problems that come with it (from my experience on the day job). For now I just do the certificate rotation manually, which is not much ideal but works with a couple make targets.

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

#152

Repeat after me: git, is, not, a, deployment, tool

Why? Not?

I think the main reason is it's sensible to pass the source code through a process that organises and optimises it for release to a specific environment. My first assumption seeing a git repo used in this way would be that someone was cutting corners and probably doing bad things like committing secrets to the repo, things like that.

If the person setting it up is aware of the potential pitfalls and has a good explanation for the process - particularly if there is no build step involved and secrets are managed appropriately, then it can be fine.

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

#153

Earlier quoted context omitted.

Why? Not?

I think the main reason is it's sensible to pass the source code through a process that organises and optimises it for release to a specific environment. My first assumption seeing a git repo used in this way would be that someone was cutting corners and probably doing bad things like committing secrets to the repo, things like that. If the person setting it up is aware of the potential pitfalls and has a good explan…

You can do all that with a pre-commit or post-commit hook.

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

#154
post #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…

I like your suggestions. I haven't looked at this tutorial in awhile but I have an occasion to do so coming up, so I'll keep your feedback in mind for a revision.

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

#155

Earlier quoted context omitted.

I think the main reason is it's sensible to pass the source code through a process that organises and optimises it for release to a specific environment. My first assumption seeing a git repo used in this way would be that someone was cutting corners and probably doing bad things like committing secrets to the repo, things like that. If the person setting it up is aware of the potential pitfalls and has a good explan…

You can do all that with a pre-commit or post-commit hook.

It goes further than that, those were just examples. The principle of least knowledge, and the principle of least privilege, guide deployment to a process that does not include the source code on a production server. But like I said, there are ways for it to be a reasonable approach if properly justified

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

#156

Earlier quoted context omitted.

I think the main reason is it's sensible to pass the source code through a process that organises and optimises it for release to a specific environment. My first assumption seeing a git repo used in this way would be that someone was cutting corners and probably doing bad things like committing secrets to the repo, things like that. If the person setting it up is aware of the potential pitfalls and has a good explan…

You can do all that with a pre-commit or post-commit hook.

Then you’re checking in artifacts generated from source code (for this method that relies on git push to work).

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

#157

Earlier quoted context omitted.

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 t…

Personally I use the same approach to piku, but instead rebuild my Nixos config on push. My projects use nix flakes, so I get both something that I know will run on my server and on my local machine with the full development environment. No containers needed technically, but I use systemd nspawn to run the software in its own sandboxed namespace. My entire server is then managed declaratively, so if I want to add a n…

Question, could one use piku for that? (Would it be able to rebuild nixos on each commit?)

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

#159
post #100

Earlier quoted context omitted.

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?

I guess the benefit of piku comes with the ease of use for developers who don't know lots about system administration/infrastructure.

Spinning up a server and installing a repo on it is easy. Depends on your use case and on what you know/have.

I prefer ansible or jenkins+scp-build-to-server+run-deploy.script

I added it to my tools list in case i need sth quick'n working for a small team/to recommend when there's no ansible/sysadmin knowledge available.

(I haven't looked into piku but i guess you'll hit its limitation once you have more complex deployment schemes, privilege/access management, ...)

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

#160
post #145
post #136

Earlier quoted context omitted.

Your readme doesn't really answer the question of why not cloud-init?

You can’t use cloud-init on already installed systems.

Can't is a bit strong - shouldn't I guess?

https://cloudinit.readthedocs.io/en/latest/howto/rerun_cloud...

Post reply on HN