Live data from Hacker News

Ask HN: Solo-preneurs, how do you DevOps to save time?

news.ycombinator.com

161–170 of 328 posts

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#161
I made my own HTTP app. server and JSON database on top of that.

The server accepts .jars over HTTP with code (and files) so I can hotdeploy while developing on live on the entire cluster in real time. My turnaround is about 1 second.

The JSON database allows for schema-less simplicity, and it has all the features you need like indexes, relations, multi crossref and security (and then some, like global realtime distributed while still being performant) in 2000 lines of code.

I have zero pain developing the most scalable (and energy efficient) backend in the world, yet very few seem to care or use it: https://github.com/tinspin/rupy

It has been proven on a real project with 5 years uptime and 350.000 users: https://store.steampowered.com/app/486310/Meadow/

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#163

Earlier quoted context omitted.

This looks awesome. I'm currently in the middle of learning Ansible now for my FjeeBSD jails. Have any other plugins to recommend?

Anything by geerlingguy on Ansible Galaxy.

> Anything by geerlingguy on Ansible Galaxy.

I've been writing some Ansible playbooks recently for the first time in years, and came upon geerlingguy's work. That guy is a powerhouse when it comes to writing Ansible roles/modules!

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#164
I strip it down to a bare minimum.

Some people probably don't realize that you can have a full-featured git-push deployment including a PostgreSQL database and Redis on few hundred lines of simple Bash code. The only exception to keeping it bare is security (proper SSL, SELinux, etc.).

- 1 cheap VM per project (I prefer Digital Ocean at this time) + snapshots

- No CI (run tests locally), no staging until later

- Little bit of Bash to configure everything, no IaC

- Simple systemd services (+ maybe systemd socket activation)

- git-push deploy... bad release? repush previous version

- Automatic system updates and log rotation

- Few auxiliary scripts for Rails console (./railsc.sh), backups (./backup.sh), etc.

- External error and performance monitoring, but keeping raw logs on server (rarely need them)

- Stable CentOS/Rocky Linux with long time support, rootless access

I teach all of that in my book https://deploymentfromscratch.com/ and I basically run my oldest side-project on the book demo which is similar to this. Some people might not like Bash, but it's surprisingly refreshing, and I keep my script flexible and idempotent:

Set everything up after providing IP address and domain name in settings.sh: $ ./setup.sh

Change the database configuration after changing the config file: $ ./setup.sh -u postgresql

Deploy a new version: $ git push production master:master

Later on I would separate the database and have staging, but it's overkill for my projects right now.

The funny thing is that apart from having CI and staging we could have the same setup at 2 early stage startups I worked on...and it would probably last 3-5 years with maybe an in-place server spec upgrade, no kidding. People really like to overdo operations and you know where overdoing it leads to? Mistakes. You maintain K8s and then forget to do something basic security-wise that almost kill the company (seen).

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#165

Earlier quoted context omitted.

Naive question: what's the correct way of doing this when you need to cp your content to a dir like /var/www/html that your user doesn't own (when logging in as root is prohibited)? My "spooky" (and probably very stupid) method is an Expect script that lets me supply a password to sudo.

a pattern I have seen before is to clone the branch commit of each release to a folder /var/releases/{release_commit} and then html is not a folder but a soft link so /var/www/html -> /var/releases/latest_release_commit this is useful if you need to revert back quickly. But then releases folder needs to be cleaned up, or you can run out of space.

That's dangerous unless you've properly configured your web server to block access to your .git directory.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#166
post #151

Because everyone here is hell bent on "spooky arcane oldhat sysadmin deploy techniques", I'll share my setup using k8s. - CI on github actions - Project management on post-its (short) and READMEs (long term) - deployment is done by a github action trigger on the `main` branch - Hosting is using AKS, GKE, or on-prem k3s on a raspberry pi. Want to restart a service ? just kill the pods. - Devops took about 2 days of wo…

How did you set up the DNS part?

Via annotations on my ingresses, and, of course, with this : https://github.com/kubernetes-sigs/external-dns

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#167

I have no idea why there's nothing here saying "don't". Go and get a Heroku account, hook it up to your Github repository's master branch for deploys, use Github Actions for CI, and then get on with life. Yes, you'll pay more for a Heroku Postgres instance than you would for a VPS on Digital Ocean with Postgres running on it, likewise you'll pay more for Heroku Dynos than another VPS to run your application server. O…

Until Heroku has a huge downtime (like recently) and you are f*ked. If you have your own VMs, you can quickly move them to a different provider, but it's hard to start figuring out servers when Heroku is down and your business stopped.

That said, I would also recommend Heroku to many.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#168
post #98

Earlier quoted context omitted.

git checkout abcd1234 ./build.sh && ./deploy.sh I don't see the issue.

If you have any migration, you probably want to rollback them as well

That's sort of pet peeve of mine: Migration are done separate from code deploys. Version 1 of your code runs on schema version 1. Schema version 2 does not make chances that will break code version 1. Code version 2 can utilize the chances made in schema version 2, but you're still able to rollback the code.

Each schema migration should also come with its own rollback script.

The downside is that you might need three migrations for some operation, but at least you won't break stuff.

The assumption that you can do a schema migration while deploying new code is only valid when you have very limited database sizes. I've seen Flyway migrations break so many times, because developers assumed it was fine to just do complicated migrations on a 200GB database. Or a Django database migration just lock up everything for hours because no one cared to think about the difference between migrating 100MB and 100GB. And I've never seen anyone seriously considering rolling back a Flyway migration.

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#169
I replicated Anthony Simon's architecture [0] in a few days and it has worked beautifully so far with a toy project [1]. Probably overkill for OP, but the combination of GH Actions & Flux [2] means that starting (and killing) namespaced projects – with all the cluster benefits of automatic TLS certification, DNS record management, rate limiting, pod restarts, logging, autoscaling, CD, etc. – is a single push to a git repository. Really nice if you're taking a shotgun approach and trying different ideas quickly.

[0] https://anthonynsimon.com/blog/one-man-saas-architecture/

[1] https://www.wyzetickets.com/

[2] https://fluxcd.io/

Re: Ask HN: Solo-preneurs, how do you DevOps to save time?

#170
post #13

Not a solo founder, but I do a lot of ops professionally. Unless you have a specific reason, I say it’s best to avoid complicated tooling until later. k8s, ci, etc are all really useful and solve a lot of hard problems, but god are they a bitch to set up and then monitor, fix when something weird happens, secure from nasty people outside, patch when some update becomes necessary, resist the urge to “improve”, etc. Th…

>you can get away with spooky arcane oldhat sysadmin deploy techniques (scp release to prod hosts, run deploy script, service or cron to keep running)

You would be surprised at how many old enterprises still do this. Sure, it's ugly, but it can be simpler than k8s, and anyone with scripting chops can understand it.

Post reply on HN