4 ms·
Sorry, there is zero chance I will ever deploy new code by changing a symlink to point to the new directory.
by exac 7mo ago
Sorry, there is zero chance I will ever deploy new code by changing a symlink to point to the new directory.
- sholladay 7mo agoWhy? What do you prefer to do instead?
- gib444 7mo agoAnything less than an entire new k8s cluster and switching over is just amateur hour obviously
- iberator 7mo agowhy? it works and its super clever. Simple command instead some shit written in JS with docker trash
- alpb 7mo agoNobody's saying you should deploy code with this, but symlinks are a very common filesystem locking method.
- slopusila 7mo agothat's how some phone OSes update the system (by having 2 read only fs) that's how Chrome updates itself, but without the symlink part
- x4132 7mo agonot surprised about the chrome part, but pretty shocked at the phone OS part. I know APFS migration was done in this way, but wouldn't storage considerations for this be massive?
- slopusila 7mo agowhat would be more massive would be phones not booting up because of a botched update. this way you can just switch back to the old partition
- marmarama 7mo agoNot really, because only the OS core is swapped in this way. Apps and data live in their own partitions/subvolumes, which are mutable and shared between OS versions. The OS core is deployed as a single unit and is a few GB in size, pretty small when internal storage is into the hundreds of GB.
- dizhn 7mo agoNo snapshotting at all? Thinking about it.. The filesystem does not support it I suppose.
- LiamPowell 7mo agoAndroid does use snapshots: https://source.android.com/docs/core/ota/virtual_ab https://source.android.com/docs/core/ota/virtual_ab
- dizhn 7mo agoOh cool. I was a bit confused about not using snapshots and relying on symlinks but it couldn't be so simple. I guess it's just a simple userspace cow mount. https://source.android.com/docs/core/ota/virtual_ab#compressed-snapshots https://source.android.com/docs/core/ota/virtual_ab#compress...
- bandrami 7mo agoWorks pretty well for Nix
- mananaysiempre 7mo agoAnd for Stow[1] before it, and for its inspiration Depot[2] before even that. It’s an old idea. [1] https://www.gnu.org/software/stow/ https://www.gnu.org/software/stow/ [2] http://ftp.gregor.com/download/dgregor/depot.pdf http://ftp.gregor.com/download/dgregor/depot.pdf
- bandrami 7mo agoI really liked stow. My toy distro back in the day was based on it.
- atmosx 7mo agoWorked pretty well in production systems, serving huge amount of RPS (like ~5-10k/s) running on a LAMP stack monolith in five different geographical regions. Just git branch (one branch per region because of compliance requirements) -> branch creates "tar.gz" with predefined name -> automated system downloads the new "tar.gz", checks release date, revision, etc. -> new symlink & php (serverles!!!) graceful restart and ka-b00m. Rollbacks worked by pointing back to the old dir & restart. Worked like a charm :-)
- gonzus 7mo agoThen you are locking yourself out of a pretty much ironclad (and extremely cost-effective) way of managing such things.
- 1718627440 7mo agoIsn't that the standard way to do that? Why wouldn't you?
- silisili 7mo agoI don't do devops/sysadmin anymore, so this would have been before the age of k8s for everything. But I once interviewed for a company hiring specifically because their deployment process lasted hours, and rollbacks even longer. In the interview when they were describing this problem, I asked why the didn't just put all of the new release in a new dir, and use symlinks to roll forward and backwards as needed. They kind of froze and looked at each other and all had the same 'aha' moment. I ended up not being interested in taking the job, but they still made sure to thank me for the idea which I thought was nice. Not that I'm a genius or anything, it's something I'd done previously for years, and I'm sure I learned it from someone else who'd been doing it for years. It's a very valid deployment mechanism IMO, of course depending on your architecture.
- kjs3 7mo agoClearly, there's a wildly baroque stack of abstractions meters deep that is way better than a simple, reliable, well tested, ubiquitous, idiomatic one line solution. Modern software at it's finest.