lemon-agent-27707
12/02/2020, 5:39 PMbored-oyster-3147
12/02/2020, 6:39 PMLocalWorkspace
.
@lemon-agent-27707 I think I'm still awaiting a response on some questions I had in my most recent comment on that PR. But I haven't returned to this yet since before thanksgiving as I have been busy. I'm hoping to get back to this this week, either tomorrow or friday.
I will be working on the deserialization of project settings when I return, both YAML & JSON. I have been putting it off since it is a little more complex without the duck typing the other platforms have, so I'll need to write some custom converters I think. Shouldn't be too bad though but should be fairly easy for @tall-needle-56640 to work without colliding.
How do we want to deal with merging? Is my PR into pulumi/auto/dotnet
fine as-is?tall-needle-56640
12/02/2020, 6:45 PMbored-oyster-3147
12/02/2020, 6:56 PMInlineProgram
support herelemon-agent-27707
12/02/2020, 7:10 PMup
and preview
spin up this server and invert control with the engine https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/x/automation/stack.ts#L147-L169tall-needle-56640
12/02/2020, 9:18 PMbored-oyster-3147
12/02/2020, 9:32 PMtall-needle-56640
12/07/2020, 9:26 PMruntime.runInPulumiStack
? Or does that still need to be developed?lemon-agent-27707
12/07/2020, 9:44 PMDeployment.RunAsync
Stack
class, or a lambda function.tall-needle-56640
12/07/2020, 10:29 PMSetAllConfig(IDictionary)
, so that it can be changed for each deployment instance. Something like:
public void SetAllConfig(IDictionary<string, string> config)
{
AllConfig = config.ToImmutableDictionary();
}
What do you think?lemon-agent-27707
12/07/2020, 10:30 PMtall-needle-56640
12/08/2020, 5:34 AMServiceCallContext
which is generic. I couldn't find any auto-generated contexts either. Do I need to create my own?
NodeJS's Run method sets the config through runtime.setAllConfig
, but all that does is set a global config variable. But I can't figure out where it is actually used in the context of pulumi.runInPulumiStack.
I need direction of which approach to choose and where the config is inserted into the stack/deployment/whatever.lemon-agent-27707
12/08/2020, 6:01 AMlemon-agent-27707
12/08/2020, 9:17 PMOne option here is to create another implementation ofthat is used forDeployment
that has theInlinePrograms
Up
etc functions exposed. You should only ever be using one form of deployment in a program, eitherPreview
orDeployment.runAsync
so this would probably work out fine.Deployment.Up
bored-oyster-3147
12/09/2020, 2:44 PMbored-oyster-3147
12/09/2020, 5:19 PMpulumi config set
as JSON I can't myself get an idea of what the different shapes look like in JSON in order to write deserialization.
like the example you linked gives me plain text, and secure text - but what does a plain object and a secure object look like in JSON?
since structured config is supportedlemon-agent-27707
12/09/2020, 8:00 PMpulumi config set --path
). It just works with KVPs and requires the user to marshal/unmarshal.bored-oyster-3147
12/09/2020, 8:04 PMlemon-agent-27707
12/09/2020, 8:08 PMbored-oyster-3147
12/09/2020, 8:12 PMexport type StackSettingsConfigValue = string | StackSettingsSecureConfigValue | any;
is that any
case at the end. I would like the .NET implementation to have parity with the TS implementation, but I need some way to represent that final dynamic type case that isn't too ugly.lemon-agent-27707
12/09/2020, 8:17 PMbored-oyster-3147
12/09/2020, 8:25 PMSystem.Text.Json
equivalent is JsonElement
I think, so if it is an object we could just deserialize it as that and let the consumer figure it out.
It means that our StackSettingsConfigValue
would now be aware of whether the underlying config was JSON or YAML, because it would also need whatever the Yaml.Dotnet
equivalent of JsonElement
is. So our config value type would be something like:
{
string? Value,
JsonElement? ValueJson,
YamlElement? ValueYaml,
bool IsSecure,
bool IsObject,
}
lemon-agent-27707
12/09/2020, 9:17 PMDictionary<string, Object>
?bored-oyster-3147
12/09/2020, 10:26 PMDictionary<string, object>
might work for JSON deserialization. Will need to experiment with that. I'll let you knowtall-needle-56640
12/10/2020, 11:28 PMlemon-agent-27707
12/11/2020, 1:28 AMprogram
in the arguments (InlineProgramArguments
) causes the stack and the workspace to operate in "inline" program mode:
https://github.com/pulumi/automation-api-examples/blob/main/nodejs/inlineProgram-ts/index.ts#L69
When stack.up
is called, we check to see a program was specified (rather than relying on a pulumi project on disk): https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/x/automation/stack.ts#L147
When we do have a program (a function pointer), we start the language server: https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/x/automation/stack.ts#L152tall-needle-56640
12/11/2020, 8:39 PMlanguageServer.Run
is not being used. Is something else calling it? If so, from where?lemon-agent-27707
12/11/2020, 8:41 PMtall-needle-56640
12/11/2020, 8:44 PMlemon-agent-27707
12/11/2020, 8:45 PMtall-needle-56640
12/11/2020, 8:56 PMbored-oyster-3147
12/15/2020, 8:29 PMDeployment
partial should reside up by the other Deployment
partials if we're going to keep it a partial. Rather than in the Automation directory. So maybe X/Deployment/Deployment_InlineProgram.cs
?
2. I think the LanguageServer file should be called LanguageServer.cs
rather than Server.cs
3. Why is LanguageServer<T>
generic? It doesn't look like we're using the type argument anywhere.
those are largely styling thoughts I had on first glance.. I will need to figure out the functionality to remark on anything elseXStack
later today, and then maybe you can merge with mine again and we can wire it up as part of the same PR?
It's all coming together though!tall-needle-56640
12/15/2020, 8:43 PMbored-oyster-3147
12/15/2020, 8:43 PMlemon-agent-27707
12/15/2020, 9:34 PMtall-needle-56640
12/15/2020, 9:52 PMStack.Up()
is called concurrently?lemon-agent-27707
12/15/2020, 9:56 PMbored-oyster-3147
12/23/2020, 3:36 PMStack.Up
implementation they are starting a GRPC Server & the LanguageServer side-by-side. They then wire them together and handle the closing / shutdown of the server.
It looks like though that our LanguageServer implementation is instantiating an instance of Deployment
with your new Deployment_Inline
constructor, and within that a new GRPC Server is instantiated as well. Is that intended? What am I missing?tall-needle-56640
12/23/2020, 8:37 PMgrpc
(in TS). It seems that GrpcEngine has very limited functionaility, and doesn't have a way to add the LanguageServer to it, like in TS (i.e. server.addService()
).var stack = await LocalWorkspace.SelectStackAsync(new InlineProgramArgs("projectName", "dev", () => Console.WriteLine("ProgramArgs")) { WorkDir = @"C:\Pulumi\functionapp" });
But I get the error
Pulumi.X.Automation.Commands.Exceptions.CommandException:
could not get cloud url: could not load current project: project is missing a 'name' attributeSo it's trying to execute the pulumi CLI before I could possibly call an
Up()
method (if it existed). So where would the gPRC service even get a chance to spin up?
I seem to be missing something as well. lollemon-agent-27707
12/24/2020, 11:38 AMbored-oyster-3147
12/24/2020, 2:22 PMtall-needle-56640
12/24/2020, 2:32 PM-name: PulumiPort
-runtime: dotnet
-description: A minimal Azure C# Pulumi program
+Name: asd
+Runtime:
+ Name: NodeJS
+ Options:
+Main:
+Description:
+Author:
+Website:
+License:
+Config:
+Template:
+Backend:
bored-oyster-3147
12/24/2020, 3:10 PMtall-needle-56640
12/24/2020, 3:19 PMbored-oyster-3147
12/28/2020, 10:28 PMOptions
objects for the actions as well as the Result
objects. Then I will be wiring it together.tall-needle-56640
01/04/2021, 10:17 PMbored-oyster-3147
01/04/2021, 10:17 PMtall-needle-56640
01/04/2021, 10:22 PMlemon-agent-27707
01/04/2021, 10:25 PMbored-oyster-3147
01/04/2021, 10:27 PM