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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programs as components #16009

Open
Tracked by #15939
Frassle opened this issue Apr 19, 2024 · 0 comments
Open
Tracked by #15939

Programs as components #16009

Frassle opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
area/engine Pulumi engine area/sdks Pulumi language SDKs kind/enhancement Improvements or new features

Comments

@Frassle
Copy link
Member

Frassle commented Apr 19, 2024

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Internal docs: https://docs.google.com/document/d/1282iElLnIBPzu1LmZo2bOm5V2AU4SLgY1INX2fyYxXo/edit

Originally put together as a hackweek project by @danielrbradley, @VenelinMartinov, and @tgummerer: https://github.com/pulumi/pulumi/tree/hackathon_substack

This issue is to track getting in the base work required for this feature. That is being able to run another Pulumi program (of any language) to create a component resource in a parent program.

This requires work in the engine to support this, and some work in the core SDKs (not sdk-gen) to expose this sub-program type. Similar to how StackReferences are just a core type in the SDKs.

In the engine we allow Construct calls for pulumi:pulumi:Stack. This takes a source path and a map of config values as its input properties. The source path to start will be expected to be a local file path containing the other program with its own Pulumi.yaml. The engine will create a new component Stack resource but with a special URN that includes the new stacks name in its type. This is so all the child resource will have unique URNs without needing to edit the program to append stackName- to every resource.

Once the stack resource is registered the sub-programs project file will be read and a language runtime started up for it, the engine will then make a proxy resource monitor and tell the language runtime to Run the program using the given proxy and the config passed in via the stack properties.

The resource monitor proxy just forwards requests on to the main resource monitor but fixes up the Parent field to default to the stack resource created. It also blocks the registration the program will try to do of its own Stack resource.

We should be able to test this feature via engine and conformance tests.

Other issues will be raised to extend the capabilities of this feature to include things such as pulling programs from other sources (templates/git repos/etc), and to add static typing and sdk generation to sub-programs.

Affected area/feature

@Frassle Frassle added area/sdks Pulumi language SDKs kind/enhancement Improvements or new features area/engine Pulumi engine labels Apr 19, 2024
@Frassle Frassle self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Pulumi engine area/sdks Pulumi language SDKs kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

1 participant