Test setup as builder, pull DNS server out of simulated sled agent#3364
Conversation
| [deployment.internal_dns] | ||
| type = "from_subnet" | ||
| subnet.net = "fd00:1122:3344:0100::/56" |
There was a problem hiding this comment.
I think this is probably not what we want in the example config. The example config is used in the how-to-simulated instructions for people running the components by hand. It seems like we need to update those in this PR to have you start an internal DNS server (probably on a known port on localhost) and then have this config file point at that. That's what we already do for the other components in those steps.
There was a problem hiding this comment.
I'll update the documentation - I believe if the how-to-run-simulated instructions are followed, and internal DNS server is already being spun up, and this value is overwritten: 65e0473
There was a problem hiding this comment.
I think you have updated the "quick start" pieces in that commit (thanks!) but if somebody follows the "Running the pieces by hand" section, won't they be missing the internal DNS server?
There was a problem hiding this comment.
Starting the simulated sled agent still starts a crucible pantry and an internal DNS server, as it did before this PR. It certainly isn't getting populated with all the records we want, but I think that's the same as before this PR -- it only adds a record for the Crucible Pantry.
I think it would certainly be an improvement to start the Internal DNS server separately from the simulated sled agent, and have more of the configs point to it (rather than using hard-coded addresses, as they currently do!), but I don't think that would be a small change.
(Regardless, thanks for pointing this out - it prompted me to run through all the "simulated sled agent" manually, where I patched an unrelated bug.)
There was a problem hiding this comment.
But this configuration file is also used directly in the how-to-run-simulated instructions. It still points Nexus at a specific IP address which is not right for the user's configuration. Right? It seems like there's a missing step in these instructions which is to customize this file somehow? (and the next question is whether there's any way we could avoid that -- e.g., maybe running the simulated sled agent by hand should use a fixed IP and port for the DNS server so that we can put that directly in this file? That's what we do for the other components there.)
There was a problem hiding this comment.
I tried to tackle this in e745c76 - that lets callers customize the internal DNS, DNS (not http) address which can then be propagated to Nexus.
This means that the value in the Nexus config file will be respected, as long as the same address is passed to the simulated sled agent to start a DNS server listening on it too.
| [deployment.internal_dns] | ||
| type = "from_subnet" | ||
| subnet.net = "fd00:1122:3344:0100::/56" |
There was a problem hiding this comment.
I think you have updated the "quick start" pieces in that commit (thanks!) but if somebody follows the "Running the pieces by hand" section, won't they be missing the internal DNS server?
davepacheco
left a comment
There was a problem hiding this comment.
Thanks! It'd be good to know that the updated "how-to-run" instructions work as-is.
Just manually ran it, seems to work: Nexus comes up (and can respond to requests) using the provided docs. |
This change is necessary for #3365 , which tests arbitrary boot order for Nexus.
What changes do we need?
Why are these changes useful?
Previously
test_setup_with_config, fromnexus/test-utils/src/lib.rs, was used as the "one-stop-shop" for setting up all state before running tests. This includes launching CockroachDB, then launching Nexus. For most tests, this is useful, but for our explicitly-testing-weird-order initialization test, this function is too opinionated to call directly.Now
ControlPlaneTestContextBuilder. This adds a "builder pattern" to the construction of ControlPlaneTestContext, using a bunch of Options to store intermediate state.InMemoryServerto the dns-server crate, which the tests can use for a dynamic DNS server.