colmena icon indicating copy to clipboard operation
colmena copied to clipboard

Boostrapping from ISO

Open blaggacao opened this issue 2 years ago • 6 comments

  • Suppose I have a headless machine with link-local connectivity
  • That machine has a specially prepared live iso with a well-known (static & link-local) ip address
  • The mount point of the store is to be construed at /mnt/nix/...
  • Let's call the still anonymous host (no own IP, no crypto identiy) larva
  • Now we want to: colmena apply --on butterfly --over [fe80::47]:2222 --store /mnt/nix

Can you give me a few pointers where to implement this?

  • Option 1: colmena bootstrap butterfly --over [fe80::47]:2222 - colmena takes care of the mounting and formatting
  • Option 2: as above - mounting and formatting is to be manual step over ssh

blaggacao avatar Mar 30 '22 05:03 blaggacao

For this usecase, I currently use an external script that calls colmena eval to evaluate and build system profiles outside of the normal deployment flow: https://github.com/zhaofengli/colmena/issues/42#issuecomment-1004528027

zhaofengli avatar Mar 30 '22 08:03 zhaofengli

Awesome, thank you.

Why are you using nix-env & nix-build instead of nix profile & nix build?

But still nix copy.

blaggacao avatar Mar 30 '22 12:03 blaggacao

Why are you using nix-env & nix-build instead of nix profile & nix build?

But still nix copy.

Oops, missed this one. nix profile is not compatible with nix-env and has different semantics. The output of nix-build is also easier to work with in scripts compared to nix build --json.

I'm using nix copy instead of nix-copy-closure because the former allows you to directly copy to a chroot store.

zhaofengli avatar Apr 03 '22 23:04 zhaofengli

Notably nix profile doesn't support priority, yet. This leads sometimes to installation failures.

blaggacao avatar Apr 06 '22 04:04 blaggacao

We have a simple python installer wizard on a custom image, which formats the disk with labels according to a standard, sets up the correct IP address and sets up SSH with proper users. After that is run, we can simply adopt with colmena.

Maybe a similar approach could work for you too?

dminuoso avatar May 24 '22 11:05 dminuoso

@dminuoso is it available somewhere?

otavio avatar May 24 '22 11:05 otavio