Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate legacy ssh store / nix-store --serve #4665

Open
7 tasks
Ericson2314 opened this issue Mar 23, 2021 · 12 comments
Open
7 tasks

Deprecate legacy ssh store / nix-store --serve #4665

Ericson2314 opened this issue Mar 23, 2021 · 12 comments
Labels
contributor-experience Developer experience for Nix contributors remote build The SSH store, ssh:, ssh-ng:, ... (split from protocol label 2024-07)

Comments

@Ericson2314
Copy link
Member

Ericson2314 commented Mar 23, 2021

Issues like #3372 and #2770 show that things slip through the cracks when we have two sorts of remote stores.

I think after the next release they will finally be at feature parity, we should then deprecate the legacy one so we only have one thing to maintain.

Finally, we can then add the protocol version parameter to our serialization infra. This resolves the tension between structure / code reuse and and being able to evolve the protocol that has hamstrung #4588, for example.

  1. Ensure support up is to par
  2. Actually remove support
    • Remove LegacySSHStore
    • Remove nix-store --serve
@rickynils
Copy link
Member

@Ericson2314 Currently, no command line Nix options are used when using ssh-ng:// (see #5600 (comment)). I think that resolving it should be on the list.

@Ericson2314
Copy link
Member Author

Thanks, added.

@asymmetric
Copy link
Contributor

asymmetric commented May 29, 2022

@Ericson2314 #4180 ticks the first box

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/a-proposal-for-replacing-the-nix-worker-protocol/20926/12

@nrdxp
Copy link

nrdxp commented Oct 6, 2022

@Ericson2314 Currently, no command line Nix options are used when using ssh-ng:// (see #5600 (comment)). I think that resolving it should be on the list.

I'd like to ask specifically about signing. Right now it is already possible to capture an entire remote build and upload cycle in a single command: nix copy --eval-store auto --store ssh-ng://my.builder.com --to s3://myBucket. This is pretty great for building a package on some remote builder and then copying it to your intended cache all in one go, since if the artifact doesn't already exist on the builder targeted by --store then the build will initiate.

The only issue I have run into is signing. Because the nix.conf setting nix-secret-key-files doesn't propagate, I have to run a nix store sign --store s3://myBucket manually on the artifact, which is fine for s3 backed caches, but this doesn't work for ssh stores. It'd be nice if there was either a flag to nix copy to specify a singing key explicitly, or if nix-secret-key-files was respected by the remote builder.

@jmgilman
Copy link

@Ericson2314 Currently, no command line Nix options are used when using ssh-ng:// (see #5600 (comment)). I think that resolving it should be on the list.

I'd like to ask specifically about signing. Right now it is already possible to capture an entire remote build and upload cycle in a single command: nix copy --eval-store auto --store ssh-ng://my.builder.com --to s3://myBucket. This is pretty great for building a package on some remote builder and then copying it to your intended cache all in one go, since if the artifact doesn't already exist on the builder targeted by --store then the build will initiate.

The only issue I have run into is signing. Because the nix.conf setting nix-secret-key-files doesn't propagate, I have to run a nix store sign --store s3://myBucket manually on the artifact, which is fine for s3 backed caches, but this doesn't work for ssh stores. It'd be nice if there was either a flag to nix copy to specify a singing key explicitly, or if nix-secret-key-files was respected by the remote builder.

Should this be a separate issue?

@nrdxp
Copy link

nrdxp commented Oct 11, 2022

Should this be a separate issue?

It might have to be, because after writing this post I came to the realization that nix store sign -r on an s3 cache has dismal performance, probably because it is trying to determine dependencies by making an absurd amount of requests. The best solution would be to either forward the key to the build machine temporarily, or even sign in transit, which might be out of scope for this issue.

@Ericson2314
Copy link
Member Author

On a more general note, we should probably have a brand new rethought protocol to where we think about these higher level issues. For me getting rid of legacy ssh isn't because ssh-ng is good enough (it is not!), but because we want to "free up our complexity budget" first --- supporting 3 simultaneous protocols would be disastrous!

@fogti
Copy link
Contributor

fogti commented Oct 12, 2022

On that note, if we don't directly pull in something like protocol buffers or such for a newer protocol, can we anyways please describe the protocol structure in something that isn't C++, and allows automatic generation of the C++ serialization/deserialization code from that (write the transformation in perl or python for portability, we depend on that anyways), to make it easier to interact with it from other languages (e.g. Go and Rust, as commonly suggested)

@nrdxp
Copy link

nrdxp commented Oct 27, 2022

Just wanted to point out that there is actually already an "in transit" signing option, at least for s3. I learned about it just yesterday from this comment: #6960 (comment)

Essentially there is an undocumented parameter on an s3 uri to specify a Nix secret key, I tested it yesterday and it works even when the caller is neither the builder or the cache (--from & --to), so I guess no issue is needed, but we probably want to document that somewhere, as its super useful.

@rickynils
Copy link
Member

@nrdxp

Right now it is already possible to capture an entire remote build and upload cycle in a single command: nix copy --eval-store auto --store ssh-ng://my.builder.com --to s3://myBucket. This is pretty great for building a package on some remote builder and then copying it to your intended cache all in one go, since if the artifact doesn't already exist on the builder targeted by --store then the build will initiate.

That is a very useful command! You can set --to auto to get the build result copied to the local store. However, this suffers from #6950, which makes the performance simply awful :(

@Ericson2314
Copy link
Member Author

ea7fa88 optimized computeFSClosure in the legacy SSH protocol, we should have the same optimization in the daemon protocol.

@Ericson2314 Ericson2314 changed the title Deprecate legacy ssh store / nix-store --serve Deprecate legacy ssh store / nix-store --serve Apr 14, 2023
@fricklerhandwerk fricklerhandwerk added the contributor-experience Developer experience for Nix contributors label Apr 17, 2024
@roberth roberth added the remote build The SSH store, ssh:, ssh-ng:, ... (split from protocol label 2024-07) label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor-experience Developer experience for Nix contributors remote build The SSH store, ssh:, ssh-ng:, ... (split from protocol label 2024-07)
Projects
None yet
Development

No branches or pull requests

9 participants