5 ms·
Gokrazy is cool
- c7DJTLrn 3y agoI'm also a fan of router7[0] which is based on gokrazy. I'd love to build my own router like it some day. [0] https://router7.org/ https://router7.org/
- assbuttbuttass 3y agoTo be clear, the GNU+Linux copypasta is not a real quote. Though RMS doesn't fully disagree with the content https://www.gnu.org/gnu/incorrect-quotation.html https://www.gnu.org/gnu/incorrect-quotation.html
- telotortium 3y agoFortunately Gokrazy's site (https://gokrazy.org/ https://gokrazy.org/) explains exactly what it is and what it's for up front: "With gokrazy, you can deploy your Go programs as appliances to a Raspberry Pi or PC (→ supported platforms)." It's a minimal Linux distribution that contains just the Linux kernel and the bare minimum of userspace (basically just init) needed to run Go programs on Linux. Like Alpine Linux, but just for Go.
- gabereiser 3y agoIn all honesty, if you write go programs, provided you don’t need CGo, you can write bare metal services that can bootstrap and run as pid 0. Try doing that with .Net or Java (ok, you technically can, but it’s a challenge). Go + Linux Kernel and maybe musl is really all you need to run a go web service. I wouldn’t recommend for production but it will get you to 5mb image sizes.
- sapiogram 3y ago> I wouldn’t recommend for production but it will get you to 5mb image sizes. Former co-worker did this, and we still have tons of docker images in production that lack basic debugging functionality like... a shell. Alpine Linux is only like 8 MB more :(
- brainzap 3y agowhy do you need a shell in production?
- sdf4j 3y agodebugging of course.
- gabereiser 3y agoI don’t always debug my code, but when I do, it’s in production. /s
- xena 3y agoThis is the wrong question. The better question is something along the lines of "why do you think you need a shell?", and the only answers you can have there are making attacker's lives easier and theoretical cases where you may need to run shell commands against a service in anger. I don't personally think it's worth it.
- oooyay 3y agoI prefer to run my service containers without a shell or much of an operating system. YMMV but in this corporate world where every container is scanned for every CVE and some binaries are deep inspected my list of vulnerabilities on a more full fledged container or VM can become a task that spirals out of control. The context being that many (maybe even most) of those CVEs probably don't pertain to how I use the software or package and that it's far easier to patch than file for an exemption. Thus, I spend the investment up front in getting log streaming working, my logs are concise, I implement application monitoring, and I demand host monitoring from the platforms I use. If I check all of those boxes, I generally don't have anything I need to do with a shell.
- ericbarrett 3y agoI fully agree with you about vuln scans, but as a counterpoint there have been dozens of times when I've saved hours of debugging with a well-applied strace or tcpdump. Logging and monitoring are great and necessary, but they'll only catch things you thought of ahead of time; using them to debug something ongoing is basically printf() debugging where compile time = the full length of your CI/CD pipeline.
- RetroTechie 3y agoThat's go on top of Linux kernel. Not bare metal. But I love small systems like this. Today's software ecosystems have grown to ridiculous sizes. "Back to basics" is refreshing no matter the purpose.
- gabereiser 3y agoBOOTBOOT to be precise but yeah, however you can do it all the way down to the asm bridge if you wish. https://github.com/icexin/eggos https://github.com/icexin/eggos
- beepbooptheory 3y agoWhy "fortunately"? Seems a pretty standard thing to do.
- RetroTechie 3y agoThe article could have replaced the entire section about Linux vs. GNU/Linux (until 1st occurrence of "gokrazy") with 1 line explaining what gokrazy is, and it would be a better article. Linux vs. GNU/Linux has been discussed ad nauseum. Reading several pages through an article before it says what it's about, is both annoying & wasting many readers' time.
- akaij 3y agoYou've just made me appreciate the privilege of having the ability to scroll up and down without having to read it all. Thanks!
- tredre3 3y agoNot sure if you were being snarky but having the ability to scroll doesn't fix a poorly structured article... Things should be explained as they come, or have a linked explanation, or say things like "we'll explain what XYZ is later". If an article is about a tool but I don't know what the tool is and the first paragraph doesn't explain it, am I really expected to skim the entire article in the hope that somewhere is hidden an explanation, and then go back and read from the top? That can't possibly be good story telling?
- akaij 3y agoI don't think it would be too wild to imagine that, maybe, this article isn't meant for you. It does seem perfect for other people that might benefit from a primer on the background. Good storytelling comes in many shapes and forms, maybe the author was trying to use anticipation as the main element! I really don't understand the surprise you're apparently filled with when coming across an article that's not presented in the way you expected; an imaginary problem that stops existing once you scroll down or do a keyword search. Unsolicited recommendation, if I may: do not watch Pulp Fiction.
- bluedays 3y agoThat’s the part of the article that I liked
- deleted 3y ago[deleted]
- j3s 3y agothis couldn’t be better timed. i just started using gokrazy + tailscale + a reverse proxy running on a VPS to host https://j3s.sh https://j3s.sh! my plan is to get a “this van runs linux” bumper sticker, since my gokrazy machine is powered by my van i’ll make a blog post about this setup soon, it’s all still pretty in flux rn. one thing worth mentioning is that if you’re operating in a limited bandwidth environment, goks update may be annoying/impossible to tolerate - it uploads the full resulting squashfs to the pi. in my case, it’s about 40MB over the network per change, even if it’s just a flag adjustment. that’s just the cost of the “appliance model” (comment x-posted from another site)
- lagniappe 3y agoCool site :) I think there is a template error at the moment listing the books you're reading. books i'm reading currently:template: now.html:9:33: executing "now.html" at <.CurrentBooks.ReadingLogEntries>: can't evaluate field CurrentBooks in type struct { Title string; Data interface {} }
- j3s 3y agoindeed there is. i tore the backend of my website apart the other night & haven't gotten to fixing that page quite yet. thx for letting me know :3
- deleted 3y ago[deleted]
- zoogeny 3y agoIt seems the developer works for Tailscale in an evangelist / developer relations role. I feel that ought to have been disclosed in this article. That gripe aside - I love this idea and the general principle. Minimal OS's are really interesting to me. I've long dreamed of a basic environment where there are 3 UI surfaces: a Terminal, a Web server / browser, an OpenGL context. Of course, if you have a full capablity web browser you can emulate a Terminal and use WebGL for 3d. Of course, things like this exist I am sure - but the idea that you could have one that is a dozen files is super compelling. It reminds me of how I was able to get a basic http server in C using civetweb which is a handful of files I can just copy-paste into my source tree. Or the handful of files sized libraries like raylib that provide huge amounts of functionality.
- cedws 3y agoXe is just an enthusiastic engineer at Tailscale.
- xena 3y agoFun fact: I can't legally call myself an "Engineer" in Canada because I don't have the ring/haven't passed an engineering course in college. My official job title is "Archmage of Infrastructure", but overall I'd call myself an artist/philosopher more than an engineer. I explore what is possible and turn it into what is practical.
- pcthrowaway 3y agoI'm curious if this is actually a thing that has ever been an issue for software engineers. I feel like it's not the government's place to argue semantics, and it's widely understood that the word "engineering" is used to describe a process that one engages in that involves some amount of education, but that the education is not necessarily scholastic in nature. "Software engineer" specifically is used around the world to refer to the role performed. I'm in Canada, and my job title is "(lead) software engineer". It's on my contract; it's on my job portal. I'm not convinced this is been a problem for anyone, though I have heard of people in Canada getting in trouble for misrepesenting themselves as accredited engineers
- mtee 3y agoYes, it is. I'm using gokrazy with blocky[0] on a Raspberry Pi as a replacement ever since my PiHole died to sd card failure. It's been running very reliably. Another thing that should very much be in Xe's wheelhouse: For non-go software you can write a small go wrapper which launches the software from a nix closure. This is a fun way to get a single-purpose RPi up and running. [0]: https://github.com/0xERR0R/blocky https://github.com/0xERR0R/blocky
- xena 3y agoJust you wait. I have plans. Oh boy I have PLANS. It involves the nixStatic package.
- fragmede 3y ago> single-purpose RPi Just as soon as I can get a Pi, that is!
- coder543 3y agoAre they that hard to find now? https://rpilocator.com/?cat=PI4 https://rpilocator.com/?cat=PI4
- fragmede 3y agoI have my Twitter alerts set via them. My preferred source (AdaFruit) is still limiting them to one per order. They're still scarce, but not as bad as it used to be, and getting better.
- rollcat 3y agoWhat a coincidence! I've just been playing with Gokrazy a couple weeks ago, and just kept thinking "this is so cool". If you're building some sort of an appliance, and want the least amount of reliance on / hassle maintaining the base OS, it definitely is a viable choice. It can also run programs that are not written in go, by using a little neat hack to build/embed a binary inside a Go package; this is e.g. how Gokrazy sets up persistent storage: https://github.com/gokrazy/mkfs https://github.com/gokrazy/mkfs I don't think it's for everyone; if you're relying on your base OS / package manager for a lot of stuff, or just want to run Docker containers, I think there are simpler/better ways to set things up. But it's absolutely great at what it's made for; doubly so with the Raspberry Pi's finally being back in stock.
- justinsaccount 3y ago18 months ago I spent a few days figuring out how to get WPA working natively on gokrazy, and then as soon as all the bits got merged, got sidetracked and forgot all about it. One of these days I will get around to picking it up again and trying to use it for the original idea I had.
- hackernudes 3y agoSee also https://u-root.org/ https://u-root.org/
- beardog 3y agoThere is even a desktop environment written in Go: https://fyshos.com/desktop/ https://fyshos.com/desktop/
- andrewstuart 3y agoIf anything, Linux should be called Linux/systemd rather than GNU/Linux. I’d be happy with a Linux entirely without GNU. I don’t see how a bunch of included GNU utilities gives it naming rights. On the other hand, systemd in many ways really defines how the operating system works, making it worthy of inclusion in the name, unlike GNU.
- hparadiz 3y agoUh.... no. Posted from a Linux/OpenRC system.
- xena 3y agoTake a look at Chimera Linux: https://chimera-linux.org/ https://chimera-linux.org/
- cpach 3y agoInteresting point! However, I rarely see people write “GNU/Linux” these days, at least in the parts of Internet where I hang out. (And there’s quite a lot of FOSS/Linux folks in those parts.)
- znpy 3y agoSystemd is gpl-licensed, so it’s somewhat part of the gnu in gnu/linux
- yjftsjthsd-h 3y agoLinux itself is GPLv2, but neither it nor systemd are GNU projects
- frou_dh 3y agoNow that's what we call gratitude on GNU's 40th birthday!
- masklinn 3y ago> I don’t see how a bunch of included GNU utilities gives it naming rights. On early-ish Linux, gnu projects provided basically the entire userland, and since it was also the compiler and the libc, that was the foundation to the entire system.
- psanford 3y agoGokrazy is easily the most pleasant way I've found to deploy code to a raspberry pi. The worst part about setting up a raspberry pi is having to get out a keyboard and monitor (or serial cable) to manually configure a the rpi before you can start using it. Gokrazy builds fully configured system images, so the rpi comes up properly without having to shell into it first. Gokrazy also lets you push updated images over the network. The other issue I often had with raspberry pi systems was the high probability that an `apt-get upgrade` would trigger a filesystem error on mediocre sdcards. Gokrazy also helps with this 1) by having a read-only file system by default, 2) by using a/b partitions for updates, and 3) having very small image sizes. It has honestly rejuvenated my enthusiasm for running code on raspberries pi.
- ripley12 3y agoHave you tried recent versions of the Raspberry Pi Imager utility? It lets you build pre-configured Raspbian images, similar to what you're describing.
- rcarmo 3y agoI never had any serious issue with SD cards since the Pi 2B (and I've kept Pis running for years). Anyway, for those wanting to deploy more generic apps, that is why I initially wrote https://github.com/piku/piku https://github.com/piku/piku - you still have to flash the OS (and rpi-imager does that with sane defaults these days), but once you're done you have Heroku-like deployments for any language runtime you install on the Pi. I also have https://github.com/rcarmo/ground-init https://github.com/rcarmo/ground-init, a cloud-init like shim that simplifies setting up machines (I'm a big fan of cloud-init, but since Raspbian doesn't support it and Ubuntu on ARM requires some fiddling to make it work I decided it wasn't too hard to roll my own). (I probably should look into glueing that into rpi-imager, but there is are only so many hours in the day...)
- andrewfromx 3y agoQuestion about Gokrazy for the group then. If I wanted to build a rpi image that uses fyne: https://developer.fyne.io/started/cross-compiling https://developer.fyne.io/started/cross-compiling is it possible to cross-compile that from a mac or window machine and get this rpi working binary ready to ship via Gokrazy? So far cross-compiling has failed for me. Too many x11 deps and weird stuff that makes it so much easier to just run go build on the rpi itself.
- heleninboodler 3y agoCross-compiling something for gokrazy will likely be a can of worms if it has a lot of C dependencies, which tend to be dynamically linked by default. There's no dynamic library loader on gokrazy, so you either need to add one yourself or get all those C deps (and their deps) to be statically compiled into your Go binary. Neither is a picnic, although maybe someone else has already done the work of figuring out how to set up a dynamic loader.
- kohlerm 3y agoM. Stapelberg is a legend. He also gave us i3wm ...
- gorgoiler 3y agoWell said. Also hugely grateful to Tuomo Valkonen and everyone involved with ion for gifting the world such a great tiling wm implementation in the first place. I’ve been a happy user of both for 15 years!
- denysvitali 3y agoHe's such a smart guy, and I'm glad I have the honor to talk w/ him many times per year. He's giving a lot of talks to our Go meetups. Such a nice person to talk to, and a really great engineer!
- fragmede 3y agoThe examples aren't copy-and-pastable; you need to add the -i casa to all the commands if you want to use that namespace, eg: gok -i casa add tailscale.com/cmd/tailscale
- lakomen 3y agoUseless title