Skip to content

falcon-lab: separate topologies from scenarios - #898

Merged
taspelund merged 1 commit into
mainfrom
jj-stack/falcon-lab-separate-topologies-from-scenarios-osrxywxx
Sep 3, 2026
Merged

falcon-lab: separate topologies from scenarios#898
taspelund merged 1 commit into
mainfrom
jj-stack/falcon-lab-separate-topologies-from-scenarios-osrxywxx

Conversation

@taspelund

Copy link
Copy Markdown
Contributor

Refactor falcon-lab to have separate abstractions for Topologies and Scenarios. A Topology is a set of nodes, their backend (VM image), and the links interconnecting them. A Scenario is layered atop a Topology, describing the configuration, diagnostics, and test cases being applied.

The old run targets now look like this:

  • mgd-unnumbered -> (mgd-duo, bgp-unnumbered)
  • quartet-unnumbered -> (interop, bgp-unnumbered)
  • quartet-bfd-static-routing -> (interop, bfd-static-routing)

Signed-off-by: Trey Aspelund trey@oxidecomputer.com

@taspelund taspelund self-assigned this Sep 1, 2026
@taspelund taspelund added testing CI rust Pull requests that update rust code labels Sep 1, 2026

@cfzimmerman cfzimmerman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement, but I don't have the context to make a full judgement on design. That said, if a CI test PR passes CI tests, that seems positive.

Comment thread falcon-lab/src/main.rs

#[test]
fn run_options_follow_scenario() {
let cli = Cli::try_parse_from([

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, TIL you can test clap like this.

Comment thread falcon-lab/src/scenario.rs Outdated
Comment on lines +194 to +195
#[test]
fn deployment_names_are_falcon_compatible() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it would be cool if we could use types to make this test unnecessary. Although fair if that seems unnecessary effort/complexity.

But if falcon imposes constraints like this, it might behoove us to put that logic in falcon, document why it's imposed, and export it for clients to use.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let me double check. I thought this was a limitation stemming from falcon, but now I'm questioning my recollection :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the limitation is in illumos, which libfalcon is sort of the shepherd of for these kinds of setups... so I think the type should be added to libfalcon and then trickled down to falcon-lab. I'll make a note to submit a PR to libfalcon to use better types + a separate follow-on to fixup maghemite to use the better types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed an update via jj-stack that replaces this test with a compile-time assertion. This is meant as a stop-gap between now and when the libfalcon changes are made + incorporated into falcon-lab.

Comment thread falcon-lab/src/scenario.rs
Comment thread falcon-lab/src/scenario.rs
Comment thread falcon-lab/src/scenario.rs

@nicolaskagami nicolaskagami left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

✅ Improves our abstractions
✅ Clear intent
✅ Well compartmentalized changes

I think there's some opportunity for simplification in this code (e.g. RunTopology/CleanupTopology could be generics, and perhaps we could lose boilerplate matching scenarios to topologies as well), but it's fine the way it is.

Refactor falcon-lab to have separate abstractions for Topologies and
Scenarios. A Topology is a set of nodes, their backend (VM image), and
the links interconnecting them. A Scenario is layered atop a Topology,
describing the configuration, diagnostics, and test cases being applied.

The old run targets now look like this:
- mgd-unnumbered -> (mgd-duo, bgp-unnumbered)
- quartet-unnumbered -> (interop, bgp-unnumbered)
- quartet-bfd-static-routing -> (interop, bfd-static-routing)

Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
@taspelund

Copy link
Copy Markdown
Contributor Author

Revision history

Version Changes from previous version Submitted commit
2 (current) a0af47b3..1cca6304 1cca6304
1 Initial version a0af47b3

Generated by jj-stack from this pull request's force-push history.

@taspelund
taspelund force-pushed the jj-stack/falcon-lab-separate-topologies-from-scenarios-osrxywxx branch from a0af47b to 1cca630 Compare September 2, 2026 19:20
@taspelund

Copy link
Copy Markdown
Contributor Author

Very nice

✅ Improves our abstractions ✅ Clear intent ✅ Well compartmentalized changes

I think there's some opportunity for simplification in this code (e.g. RunTopology/CleanupTopology could be generics, and perhaps we could lose boilerplate matching scenarios to topologies as well), but it's fine the way it is.

Thanks! I took your advice and made things more generic, which even resulted in the falcon-lab Deployment type getting removed. So things are definitely looking nicer!

@taspelund
taspelund merged commit 3d4f84b into main Sep 3, 2026
20 checks passed
@taspelund
taspelund deleted the jj-stack/falcon-lab-separate-topologies-from-scenarios-osrxywxx branch September 3, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI rust Pull requests that update rust code testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants