Stream: nixos

Topic: Home CI machine (portable)


view this post on Zulip Srid (Feb 20 2024 at 13:20):

For macOS builds, the answer to what "the simplest and space efficient & portable way to setup a CI machine at home" is clearly the Mac Mini.

What would be the answer for x86 Linux (NixOS) builds? Is there an equivalent hardware? I'd like to move away from Hetzner Dedicated to something hosted at home.

cc @Tim DeHerrera @Shivaraj B H

view this post on Zulip Srid (Feb 20 2024 at 13:21):

Note: 'portable' as in I can throw it all in an international-flight allowed luggage.

view this post on Zulip Shivaraj B H (Feb 20 2024 at 15:51):

I have only experience of self-hosting a raspberry pi model 4 and an old ASUS fx503vd laptop of mine. I host DNS server, password manager, file syncing service and a reverse proxy on my pi. I use the Asus laptop to play around with GitHub runners.

view this post on Zulip Shivaraj B H (Feb 20 2024 at 15:51):

I am looking for a portable Linux box as well, in the same form factor as the Mac mini

view this post on Zulip Shivaraj B H (Feb 20 2024 at 15:55):

For portability, I tend to carry around the SSD, I got an SSD enclosure that supports upto 10gbps of transfer speeds if I want to carry only the data around. I am still yet to play around with encrypting the disk for security and hardware RAID for redundancy

view this post on Zulip Tim DeHerrera (Feb 20 2024 at 17:41):

Have you looked at intel's NUC boxes? Some of those have fairly decent compute and are basically the same size as a mac mini.

view this post on Zulip Srid (Feb 20 2024 at 17:44):

Interesting, I think I'll buy one of those NUCs.

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:48):

66500FAF-187B-4E03-94B1-59F7EB30DB24.jpg

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:48):

Great, I am getting one as well

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:49):

Oh wait, let me see if I can even buy this in India :smile:

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:50):

Okay, I can.

view this post on Zulip Srid (Feb 20 2024 at 17:51):

Which NUC will you be getting?

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:55):

Intel NUC 13 pro is what I was thinking

view this post on Zulip Shivaraj B H (Feb 20 2024 at 17:55):

https://amzn.eu/d/bTINAUA

view this post on Zulip Srid (Feb 20 2024 at 18:00):

This looks like barebones configuration without memory/SSD?

I'm looking at the same, but with memory/SSD installed: https://www.amazon.ca/Canyon-i5-1340P-Support-Thunderbolt-Windows/dp/B0CC2P1TVH/

Though it makes sense to get the barebones one and install whatever you need on top.

view this post on Zulip Shivaraj B H (Feb 20 2024 at 18:01):

Yeah, I want to swap stuff based on need

view this post on Zulip Srid (Feb 20 2024 at 18:08):

NUCs are dead?

The popular Intel NUC Mini PCs were to be scrapped - an austerity measure that was necessary after Intel's mounting losses. The processor giant has now reached an agreement with Asus to continue manufacturing existing NUC models and to develop new mini PCs. https://www.notebookcheck.com/Intel-NUC-Mini-PCs-werden-kuenftig-von-Asus-entwickelt-und-vertrieben.735057.0.html

view this post on Zulip Srid (Feb 20 2024 at 18:09):

That's a German article, but I learned of it from this English one

view this post on Zulip Tim DeHerrera (Feb 20 2024 at 18:09):

Huh, well you can still buy them on Amazon for now at least :sweat_smile:

view this post on Zulip Srid (Feb 20 2024 at 18:09):

I wish the world switched to ARM, then I can just run a Linux VM on my arm Mac.

view this post on Zulip Tim DeHerrera (Feb 20 2024 at 18:11):

Well, it is really easy to setup an x86 NixOS box to emulate arm at least. I know that's the opposite of what you want though :sweat_smile:

view this post on Zulip Shivaraj B H (Feb 20 2024 at 18:15):

I am thinking that the NUC is a little too expensive for only the CPU, ports and the box. I might go scavenging in the local market nearby, see if I can find something cheap

view this post on Zulip Srid (Feb 20 2024 at 18:25):

Tim DeHerrera said:

Well, it is really easy to setup an x86 NixOS box to emulate arm at least. I know that's the opposite of what you want though :sweat_smile:

You know what I am thinking? Just get a Mac Studio and setup a x86 Linux VM on it providing Linux CI.

But if I'm going with that option, I should probably just wait for the M3 studio in second half of this year.

view this post on Zulip Srid (Feb 20 2024 at 18:27):

Shivaraj B H said:

I am thinking that the NUC is a little too expensive for only the CPU, ports and the box. I might go scavenging in the local market nearby, see if I can find something cheap

You will find cheaper alternative. I found some in Canada,

view this post on Zulip Shivaraj B H (Feb 20 2024 at 18:29):

Yes, I was also considering getting all teh parts separately and assembling myself.

I am literally getting i5 13th gen 14 core CPU for half the price of what the NUC with 12 core variant costed.

view this post on Zulip Srid (Feb 20 2024 at 18:30):

Srid said:

Tim DeHerrera said:

Well, it is really easy to setup an x86 NixOS box to emulate arm at least. I know that's the opposite of what you want though :sweat_smile:

You know what I am thinking? Just get a Mac Studio and setup a x86 Linux VM on it providing Linux CI.

But if I'm going with that option, I should probably just wait for the M3 studio in second half of this year.

I'll try this in the meanwhile: repurpose my M1 Max (macbook pro) to run intel x86 VM providing CI for my github projects, in addition to having a native macOS runner (maybe in a VM too) providing macOS CI for the same projects. If nothing else, it would put a good use of my mostly unused 64GB of RAM and CPU cycles.

view this post on Zulip Srid (Feb 20 2024 at 18:59):

Actually I don't even need a separate VM for it. Just use the arm NixOS VM, and setup boot.binfmt.emulatedSystems. Then I can build for intel using --option system. Parallels allows the use of rosetta somehow.

image.png

view this post on Zulip Srid (Feb 20 2024 at 19:08):

The linux-builder in nix-darwin would streamline it even further,

https://nixcademy.com/2024/02/12/macos-linux-builder/

However, it:

view this post on Zulip Shivaraj B H (Feb 20 2024 at 19:13):

What is the overhead of running parallels NixOS VM? Running a qemu NixOS VM consumes additional 600 MB RAM (on my M1 Pro Mac) to keep the VM running, didn’t check the CPU usage though

view this post on Zulip Srid (Feb 20 2024 at 19:21):

~850 MB

view this post on Zulip Srid (Feb 20 2024 at 19:23):

(That's the total usage, not just overhead, as NixOS boots up)

view this post on Zulip Tim DeHerrera (Feb 20 2024 at 19:30):

yeah the binfmt.emulatedSystems is what I was referring to. As for VM overhead I am currently using https://astro.github.io/microvm.nix/.

The cloud-hypervisor instance I'm running seems to reserve all the memory I allocated for the machine up front, but I believe there are ways to configure it so that it doesn't do that. According to this post though, the memory overhead should be miniscule:
https://github.com/cloud-hypervisor/cloud-hypervisor/issues/1729#issuecomment-1158573430

view this post on Zulip Notification Bot (Feb 22 2024 at 18:00):

A message was moved from this topic to #nixos > Darwin's linux-builder by Srid.

view this post on Zulip Shivaraj B H (Feb 26 2024 at 19:55):

for portable home CI (linux), I am planning to assemble myself. I will be using mini-itx motherboard for mac-mini like form factor.
This guy on youtube has some pretty cool builds: https://www.youtube.com/watch?v=WN6DUjML8Eo

view this post on Zulip Srid (Feb 26 2024 at 21:41):

Take pictures along the way for a great blog post.

view this post on Zulip Andreas (Feb 27 2024 at 16:50):

Shivaraj B H said:

This guy on youtube has some pretty cool builds: https://www.youtube.com/watch?v=WN6DUjML8Eo

That looks very portable indeed!

view this post on Zulip Shivaraj B H (Feb 28 2024 at 05:48):

1243781E-3B6F-4E7F-9B9E-ED75CF220836.jpg

Got my mac mini to self-host CI and other misc. stuff. Next up, linux build that I spoke of earlier. That might take a while though, temporarily I will use another rog strix laptop I got with i9 13th gen and 3070ti.

Only problem is power consumption, I will try to hack my way through to have something like WOL for mac mini and also on the rog strix for now.

view this post on Zulip Andreas (Feb 28 2024 at 11:08):

Only problem is power consumption

I power expensive where you live? In any case it is hard to beat the Mac Mini when you put in a dedicated GPU I guess...

view this post on Zulip Shivaraj B H (Feb 28 2024 at 11:09):

It’s not expensive, but I like to be efficient :laughing:


Last updated: Nov 15 2024 at 12:33 UTC