28 Mar 2024 |
adamcstephens | imagine being able to run incus launch nixos:unstable/<some hash or date> | 16:50:02 |
adamcstephens | In reply to@hexa:lossy.network you mean provide an image server via our general release pipeline? i'm not sure if the release pipeline needs to run the actual server, but use it to provide the necessary data that it could be assembled | 16:51:19 |
adamcstephens | though if we want to run an image server on nixos infra, that's cool too :) | 16:51:35 |
hexa | what kind of resources woudl that need? | 16:54:02 |
hexa | * what kind of resources would that need? | 16:54:12 |
adamcstephens | ideally we could redirect from this service to the image file itself | 16:54:29 |
hexa | ok, cool. | 16:54:41 |
adamcstephens | so it should be very lightweight, and preferably stateless. | 16:55:03 |
hexa | feel free to prototype something and migrate it into nix-community | 16:55:39 |
adamcstephens | cool. i need to play with the tool first | 16:56:02 |
hexa | I can help get it running on the nixos infra then | 16:56:12 |
adamcstephens | if it has to work with whole images, i'd probably consider making it a local service for users to install | 16:57:06 |
adamcstephens | sigh | 17:17:18 |
adamcstephens | ─❯ incus-simplestreams add /nix/store/q67np57dgd8dg8fi2d425raqw9gkcc22-tarball/tarball/nixos-system-x86_64-linux.tar.xz /nix/store/cwsxnmgkv45qyyyq37gkk71c8527b1zn-nixos-disk-image/nixos.qcow2
Error: chown images/c35a1d665991475fe5e8947a355272e7cd144db6b7290cb3812a1e14912ec3d7.incus.tar.xz: operation not permitted
| 17:17:21 |
adamcstephens | may just be easier to generate the simplestreams format ourselves | 17:20:54 |
hexa | hm, what does it do? copy with permissions? | 17:21:29 |
hexa | * hm, what does it do? copy with permissions in tact? | 17:21:32 |
hexa | or does it try to create metadata in the nix store? | 17:22:09 |
hexa | * or does it try to create stuff in the nix store? | 17:22:19 |
adamcstephens | https://github.com/lxc/incus/blob/ce15a0a8c41d96466ff6222f8c2d52051fcfba85/internal/util/filesystem.go#L92 | 17:25:30 |
adamcstephens | the former | 17:25:34 |
adamcstephens | * closer to the former | 17:25:49 |
adamcstephens | https://github.com/lxc/incus/blob/ce15a0a8c41d96466ff6222f8c2d52051fcfba85/cmd/incus-simplestreams/main_add.go#L348 | 17:26:40 |
hexa | that code is so very much go | 17:29:34 |
hexa | to copy a file, open two file descriptors, and then copy between them | 17:29:49 |
adamcstephens | indeed. the idiom is to make do with the standard library, which is spartan. | 17:30:23 |
adamcstephens | and 3x the lines for every error check | 17:30:42 |
adamcstephens | on the plus side, properly passed errors are easy to trace :) | 17:32:15 |
hexa | so, I'm a bit surprised that you call os.Create(dest) and then don't own the resulting file | 17:32:42 |
hexa | becausing chowning to foreign uid is only possible as root iirc | 17:33:03 |