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

Inline runner machinery #1616

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mikhailshilkov
Copy link
Member

The use case is to be able to create resources without an arbitrary function that is created inside a provider (Construct in particular). All methods are marked internal and are intended to be consumed from our own SDK.

Based on our .NET implementation in https://github.com/pulumi/pulumi-dotnet/tree/main/sdk/Pulumi/Deployment

Towards #1335

No testing yet - but opening it up also for @justinvp to take a look in case there may be any overlap with Automation API work.

@mikhailshilkov mikhailshilkov added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Jan 31, 2025
@mikhailshilkov mikhailshilkov requested a review from a team as a code owner January 31, 2025 17:21
public static DeploymentImpl fromInline(InlineDeploymentSettings settings) {
var state = DeploymentState.fromInline(settings);
var impl = new DeploymentImpl(state);
DeploymentInstanceHolder.setInstance(new DeploymentInstanceInternal(impl));
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried multiple calls to Construct within the same process (e.g. creating two separate instances of an MLC from the Pulumi program)?

I am hitting the following when I have multiple operations that involve the inline program (e.g. a preview and up) in the same process:

throw new IllegalStateException("Deployment#instance should only be set once at the beginning of a 'run' call.");

I haven't dug in to see if/how .NET avoids it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I confirm I can see the same, thank you. .NET seems to work fine - I'll dig further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants