Skip to content

Conversation

@nblair2
Copy link
Contributor

@nblair2 nblair2 commented Oct 22, 2025

feat: includeTopologies

Description

This change introduces the ability to nest and compose topologies by leveraging existing stored topologies or defined in files on disk. This allows for modularity and reusability when defining complex topologies

Ex:

...
  includeTopooliges:
    - /phenix/topologies/enterprise/phenix-configs/topolgy.yml
    - /phenix/topolgies/ot/phenix-configs/topolgy.yml
    - store-topo
  nodes:
...

Related Issue

Tangential to #247

Type of Change

Please select the type of change your pull request introduces:

  • Bugfix
  • New feature
  • Documentation update
  • Other (please describe):

Checklist

  • This PR conforms to the process detailed in the Contributing Guide.
  • I have included no proprietary/sensitive information in my code.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have tested my code.

This adds the ability to nest and compose topologies from others,
via existing topologies in the store or files on disk.

Ex:
```yml
...
  includeTopooliges:
    - /phenix/topologies/enterprise/phenix-configs/topolgy.yml
    - /phenix/topolgies/ot/phenix-configs/topolgy.yml
    - store-topo
  nodes:
...
```
if err := processIncludedTopologies(v1Spec); err != nil {
return nil, fmt.Errorf("processing included topologies: %w", err)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unsure if doing this here is the right way to do it

description: Array of topology file paths or store names to include
example:
- /phenix/topologies/base-topology.yml
- common-nodes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

have to add this to the v2 spec, even though there is no v2 topology.

}

return this.IncludeTopologiesF
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if this function is useful. Should I add it to the interface (and return nil for v0 topology) ?

@nblair2
Copy link
Contributor Author

nblair2 commented Oct 22, 2025

@glattercj @activeshadow let me know if you have thoughts. I am still looking at a few things and testing edge cases.

@GhostofGoes
Copy link
Collaborator

Make sure to update the documentation with a minimal example 🤠

example: [email protected]
Topology:
type: object
required:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to require one of nodes or includeTopologies?

@nblair2
Copy link
Contributor Author

nblair2 commented Nov 4, 2025

This is not working out how I hoped. It helps a little but then we still have to maintain multiple different versions of the same app in different scenario files to correspond to different topos.

I am thinking about a different way to tackle this through the API, allowing multiple topo/scenario pairs to get loaded at once and then "merged" at experiment creation time.

apiVersion: phenix.sandia.gov/v0
kind: Workflow
metadata: {}
spec:
  auto:
    create: ${BRANCH_NAME}
  configs:
  - topology: ${BRANCH_NAME}-IT
    scenario: ${BRANCH_NAME}-IT
  - topology: ${BRANCH_NAME}-OT
    scenario: ${BRANCH_NAME}-OT
...

Then on exp creation:

  • each topo / scenario file is validated against each other (as normal)
  • topos are merged (look for duplicate nodes, etc)
  • scenarios are merged (the same app can be defined in multiple scenarios, so we have to intelligently combine them. This is the most dangerous part)
  • one big beautiful experiment is created, proceed as normal

I will leave this open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants