Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow framework layers to form a directed acyclic graph #18

Open
ncoghlan opened this issue Oct 7, 2024 · 0 comments
Open

Allow framework layers to form a directed acyclic graph #18

ncoghlan opened this issue Oct 7, 2024 · 0 comments
Labels
Affects: Command Line Affects the command line interface Affects: Python API Affects the public Python API of the project Affects: Spec Format Affect the stack specification format Category: Enhancement New feature or request

Comments

@ncoghlan
Copy link
Collaborator

ncoghlan commented Oct 7, 2024

The current venvstacks model has exactly three layers:

  • the application layer (defines the launch module/package that actually does something when deployed)
  • one or more framework layers defining shared packages that use a given runtime layer
  • the runtime layer (the actual Python runtime, and potentially some additional commonly needed packages for that runtime)

It would be feasible to make the "depending on framework layers" feature a shared characteristic of both the framework and application layers, rather than restricting it to the application layer.

We would need to define a linearisation algorithm for translating the graph of framework nodes in the declared layer dependencies into a predictable sys.path order in the application layers.

My initial instinct is that it should be sufficient to make that a breadth-first traversal for frameworks (i.e. all first-order framework deps in declared left-to-right order, than second order deps, etc), with the runtime folders always forced to the end regardless of how shallow or deep the framework chains are. However, rather than trying to assure ourselves that the simplistic approach is sufficient, it may be better to instead use a well-defined and studied linearisation algorithm like the C3 algorithm that Python uses to resolve class method resolution orders: https://en.wikipedia.org/wiki/C3_linearization

@ncoghlan ncoghlan added the Category: Enhancement New feature or request label Oct 7, 2024
@ncoghlan ncoghlan transferred this issue from another repository Oct 18, 2024
@ncoghlan ncoghlan added Affects: Python API Affects the public Python API of the project Affects: Command Line Affects the command line interface Affects: Spec Format Affect the stack specification format labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Command Line Affects the command line interface Affects: Python API Affects the public Python API of the project Affects: Spec Format Affect the stack specification format Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant