How do you deploy in 10 seconds? (paravoce.bearblog.dev)
from something_random_tho@lemmy.world to programming@programming.dev on 20 Oct 2024 14:50
https://lemmy.world/post/21065836

Hi friends, as promised, I’m back with my second post. I’ll be hanging around in the comments for any questions!

In this post, I take a look at a typical deployment process, how long each part of it takes, and then I present a simple alternative that I use which is much faster and perfect for hobbit software.

#programming

threaded - newest

scorchingheat@lemmy.world on 20 Oct 2024 17:55 next collapse

Your proposed solution to overly complex systems seems to be to ignore the requirements that make them complex in the first place. If that works for you, this is a perfectly fine approach. But most companies with actual signed SLAs won’t accept “we’ll just have a few seconds of downtime/high latency every time a developer deploys something to production #yolo”.

Max_P@lemmy.max-p.me on 20 Oct 2024 18:55 collapse

Also, series F but they’re only deploying on one server? Try scaling that to a real deployment (200+ servers) with millions of requests going through and see how well that goes.

And also no way their process passes ISO/SOC 2/PCI certifications. CI/CD isn’t just “make do things”, it’s also the process, the logs, all the checks done, mandatory peer reviews. You can’t just deploy without the audit logs of who pushed what when and who approved it.

BatmanAoD@programming.dev on 20 Oct 2024 20:25 collapse

You’re not wrong, but not everything needs to scale to 200+ servers (…arguably almost nothing does), and I’ve actually seen middle managers assume that a product needs that kind of scale when in fact the product was fundamentally not targeting a large enough market for that.

Similarly, not everything needs certifications, but of course if you do need them there’s absolutely no getting around it.

something_random_tho@lemmy.world on 20 Oct 2024 21:35 collapse

For sure, in PCI environments this doesn’t work. And in the Series F company we don’t use this approach for that very reason. But there’s tons of companies that don’t have or need external certifications, and it works for that much more common scenario. For the small web (i.e. most of the web), it’s ideal.

The important takeaway isn’t “wow, doing production builds on your PC isn’t secure.” Do it on a dedicated box in production, then. The important takeaway is there’s a mountain of slow things (GitHub workers, docker caching, etc) which slow developer velocity, and we should design systems and processes which remove or eliminate those pains.

Kissaki@programming.dev on 20 Oct 2024 18:56 next collapse

So it really is that simple: a small bash script, building locally, rsync’ing the changes, and restarting the service. It’s just the bare essentials of a deployment. That’s how I deploy in 10 seconds.

I’m strongly opposed to local builds on any semi-important or semi-complex production product or system.

Tagged CI release builds give you a lot of important guarantees involved in release concerns.

I’ll take the fresh checkout and release build time cost for those consistency and versioned source state guarantees.

radau@lemmy.dbzer0.com on 21 Oct 2024 02:09 collapse

I would imagine you could run into an issue like this building off an M1 or newer Mac and deploying to a Linux based env. We’ve run into a bit of an adjustment with our docker image builds where we need to set the buildarch or else it fails to deploy.

Our build times aren’t blazingly fast, typically around 4 minutes for npm/yarn build for frontend apps and loading the data to the image and any other extras like composer installs. Best time saving for us was doing a base image for all the dependency junk that we do a nightly on

ilega_dh@feddit.nl on 21 Oct 2024 16:20 collapse

This was exactly the problem in my last environment. I was the second dev and two more were onboarded after me, but everyone had issues replicating the original dev’s local environment in order to deploy.

First thing I did was set up a basic gitops pipeline. Worked like a charm.

ericjmorey@programming.dev on 20 Oct 2024 19:03 next collapse

I’m not sure I understand the trade offs you’re choosing by deploying this way. The benefit of simplicity an speed of deployment seems clear from your write-up. But are those the most important considerations? Why or why not?

[deleted] on 20 Oct 2024 19:10 next collapse

.

pupbiru@aussie.zone on 21 Oct 2024 02:48 collapse

this has the same logic as saying npm install takes a while so just don’t use libraries

something_random_tho@lemmy.world on 21 Oct 2024 03:21 collapse

Also yes.