Skip to content

Can the "uses" in a Jsonnet pnode be converted to a type/name string to reduce size during parsing? #476

@brettviren

Description

@brettviren

The nodes (pnodes and bare) in the config may carry a uses attribute in addition to name, type, data. This provides a list of other nodes "used" by a node. Effectively, the "uses" define a dependency graph which is topologically-sorted in order to determine the order of the final configuration sequence.

For reasons that escape me now, we populate the "uses" list with full objects and not the "type:name" string that identifies a node instance. As a consequence, a lot of extra data is carried around and this can be prohibitive for some configurations.

Right now, I think we could change pnode() to apply wc.tn() to each node in the uses list to shrink the data considerably. But need to do this follow up:

  1. Check all users of "uses" can be modified to handle strings, not objects.
  2. Figure out how to handle bare nodes (eg for services) which do not pass through a pnode() like choke point.
  3. Figure out how to flatten nodes with "uses" of nodes with "uses" of ....
  4. Understand if this change can be done without requiring changes to user configs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions