feat: Add Nix Builder + Add remote runner example plan#1425
feat: Add Nix Builder + Add remote runner example plan#1425MarcoPolo wants to merge 1 commit intotestground:masterfrom
Conversation
|
@laurentsenta and I discussed this PR today and what it would enable for the libp2p maintainers. We specifically talked about this proposal
For that reason, this PR has been prioritized and added to both the test-plans and go-libp2p roadmaps (for Q2 November) to bootstrap the go-libp2p benchmarking efforts. The questions we had were:
A question Laurent had with regard to the Testground team's project prioritization was:
Next steps: both of those will be topics for discussion when people are together in Lisbon. Note: it's important to callout that
Footnotes
|
| You may need to set up [remote | ||
| builders](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html) | ||
| to properly cross-build the application. | ||
| 1. Using a `local:exec` runner to run a shell script that copies the built |
There was a problem hiding this comment.
| 1. Using a `local:exec` runner to run a shell script that copies the built | |
| 2. Using a `local:exec` runner to run a shell script that copies the built |
Numbering is wrong.
Also, would it be better define a new remote:exec runner?
There was a problem hiding this comment.
If you keep using 1.s for list items then GitHub Markdown creates a numbered list starting from 1. That's where the numbering comes from.
As for the name, local:exec is an existing construct. Also, the name is fitting here because the shell script that performs the copy is executed locally.
|
@galargh friendly ping on this |
It's on my TODO list for this week. I'll have it reviewed on Wednesday the latest - hopefully, tomorrow. Sorry for the delay. |
a0c3ba2 to
8de0332
Compare
galargh
left a comment
There was a problem hiding this comment.
Looks good :) We'll probably want to update docs at some point but I think we can hold of for a bit and see how we end up using it in practice.
I left a few questions here and there, mostly to make sure I understand it correctly.
🚀
| AttributeToBuild string `toml:"attr"` | ||
| } | ||
|
|
||
| // Build builds a testplan written in Go and outputs an executable. |
There was a problem hiding this comment.
Am I right in saying it builds whatever flake.nix specifies so it doesn't necessarily have to be Go?
| ) | ||
|
|
||
| // NixBuilder (id: "nix:generic") is a builder that build the test plan using | ||
| // Nix. The resulting artifact can be a binary or a container. |
There was a problem hiding this comment.
Do we care about distinguishing between binary/container artifacts? Should we flag it somehow?
|
|
||
| decoder := json.NewDecoder(&stdout) | ||
| type nixBuildOutput struct { | ||
| DrvPath string |
| // BinPath is the path of the binary relative to the artifact path. Use this | ||
| // if the builder doesn't put the binary as the artifact path | ||
| BinPath string `toml:"bin_path"` |
There was a problem hiding this comment.
Just to confirm I understand this. We need this for nix. It outputs an artifact. We pass the artifact path to local exec runner. We want to execute a specific binary within that artifact. Is it correct?
951e5b5 to
8de0332
Compare
|
@laurentsenta What was the trick for |
|
@galargh I used a https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns
@MarcoPolo is this still priority if we plan on moving the building out of testground in |
|
Closing this. I think we want to get out of the building game. And I think we need to make testground simpler to enable remote workers properly. |
This PR does a couple things:
a. Adds an integration test (that will fail until we add Nix to Circle CI)
local:execto allow you to run any executable, not just Go binaries.sshand the Nix builder. It leverages Nix to build for different architectures and efficiently/correctly deploy the application to the remote machine – even if the application is dynamically linked (caveat that the remote machine must have Nix installed).a. This plan tests a simple server/client ping across machines.
In the long term we'll probably want some sort of first class support for remote runners in testground, but I think this is a usable solution in the short term that will let us set up some reproducible benchmark environments. But I may be missing something in my understanding of how Testground works, so apologies if that's the case.
r? @laurentsenta