worried-city-86458
05/13/2021, 9:22 AMpulumi up
cli seems to be roughly:
• var stack = LocalWorkspace.CreateOrSelectStackAsync
• stack.Workspace.InstallPluginAsync
• stack.SetAllConfigAsync
• stack.RefreshAsync // needed?
• stack.UpAsync
Would the equivalent of the pulumi preview
cli be the following? (Not really in any examples?)
• var stack = LocalWorkspace.CreateOrSelectStackAsync
• stack.Workspace.InstallPluginAsync
• stack.SetAllConfigAsync
• stack.RefreshAsync // needed?
• stack.PreviewAsync
Are any of these steps not really needed like the refresh?broad-dog-22463
05/13/2021, 10:16 AMworried-city-86458
05/13/2021, 10:39 AMOutputs:
+ ClusterName: "alpha-aws-eks-cluster-7f7a93a"
+ KubeConfig : output<string>
Resources:
+ 2 to create
8 unchanged
System.NotSupportedException: Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type
'Pulumi.Automation.Events.CancelEvent'. Path: $.cancelEvent | LineNumber: 0 | BytePositionInLine: 54.
System.NotSupportedException: Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type
'Pulumi.Automation.Events.CancelEvent'.
.
at System.Text.Json.ThrowHelper.ThrowNotSupportedException(ReadStack& state, Utf8JsonReader& reader, NotSupportedException ex)
at System.Text.Json.ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(Type type, Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[[TValue]](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadValueCore[[TValue]](JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.Deserialize[[TValue]](Utf8JsonReader& reader, JsonSerializerOptions options)
at Pulumi.Automation.Serialization.Json.MapToModelJsonConverter`2.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) in MapToModelJsonConverter.cs:16
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[[TValue]](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[[TValue]](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[[TValue]](String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[[TValue]](String json, JsonSerializerOptions options)
at Pulumi.Automation.Serialization.LocalSerializer.DeserializeJson[[T]](String content) in LocalSerializer.cs:30
at Pulumi.Automation.Events.EventLogWatcher.ReadEventsOnce() in EventLogWatcher.cs:107
at Pulumi.Automation.Events.EventLogWatcher.PollForEvents(CancellationToken externalCancellationToken) in EventLogWatcher.cs:82
at Pulumi.Automation.Events.EventLogWatcher.AwaitPollingTask() in EventLogWatcher.cs:65
at Pulumi.Automation.Events.EventLogWatcher.Stop() in EventLogWatcher.cs:40
at Pulumi.Automation.Commands.LocalPulumiCmd.RunAsync(IEnumerable`1 args, String workingDir, IDictionary`2 additionalEnv, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken)
in LocalPulumiCmd.cs:40
at Pulumi.Automation.Workspace.RunStackCommandAsync(String stackName, IEnumerable`1 args, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken) in Workspace.cs:288
at Pulumi.Automation.WorkspaceStack.RunCommandAsync(IEnumerable`1 args, Action`1 onStandardOutput, Action`1 onStandardError, Action`1 onEngineEvent, CancellationToken cancellationToken) in WorkspaceStack.cs:627
at Pulumi.Automation.WorkspaceStack.PreviewAsync(PreviewOptions options, CancellationToken cancellationToken) in WorkspaceStack.cs:393
at Pulumi.Automation.WorkspaceStack.PreviewAsync(PreviewOptions options, CancellationToken cancellationToken) in WorkspaceStack.cs:413
at Pharos.Gemini.DeployCommand.OnExecuteAsync(CommandContext context, Settings settings) in DeployCommand.cs:80
at Pharos.Gemini.AsyncCommandBase`1.ExecuteAsync(CommandContext context, TSettings settings) in AsyncCommandBase.cs:22
protected override async Task<int> OnExecuteAsync(CommandContext context, Settings settings)
{
var deployedResources = OrderedResources.Where(resource => settings.Resources.HasFlag(resource));
foreach (var resource in deployedResources)
{
var info = ResourceInfoMap[resource];
Logger.LogDebug($"Deploying {info.ProjectName}...");
var stackName = $"{settings.Organization.ToLower()}/{settings.Environment.ToString().ToLower()}";
var stackArgs = new InlineProgramArgs(info.ProjectName, stackName, PulumiFn.Create(ServiceProvider, info.StackType));
var stack = await LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
foreach (var plugin in info.Plugins)
{
var pluginArgs = plugin.Split(" ");
await stack.Workspace.InstallPluginAsync(pluginArgs[0], pluginArgs[1]);
}
var config = Config.ToTokens()
.ToDictionary(entry => $"Gemini:{entry.Key}", entry => new ConfigValue(entry.Value?.ToString() ?? string.Empty));
await stack.SetAllConfigAsync(config);
if (settings.Refresh)
{
await stack.RefreshAsync(new RefreshOptions { OnStandardOutput = AnsiConsole.WriteLine });
}
if (settings.Preview)
{
var result = await stack.PreviewAsync(new PreviewOptions { OnStandardOutput = AnsiConsole.WriteLine });
AnsiConsole.WriteLine("Summary:");
foreach (var (key, value) in result.ChangeSummary)
{
AnsiConsole.WriteLine($" {key}: {value}");
}
}
else
{
var result = await stack.UpAsync(new UpOptions { OnStandardOutput = AnsiConsole.WriteLine });
if (result.Summary.ResourceChanges != null)
{
AnsiConsole.WriteLine("Summary:");
foreach (var (key, value) in result.Summary.ResourceChanges)
{
AnsiConsole.WriteLine($" {key}: {value}");
}
}
}
Logger.LogDebug($"Deployed {info.ProjectName}");
}
return 0;
}
bored-oyster-3147
05/13/2021, 1:24 PMOnEngineEvent
delegate. Let me take a lookbroad-dog-22463
05/13/2021, 1:50 PMbored-oyster-3147
05/13/2021, 2:57 PMbroad-dog-22463
05/13/2021, 5:16 PMbored-oyster-3147
05/13/2021, 5:20 PMPulumi.Automation
that is targetting .NET 5worried-city-86458
05/13/2021, 6:18 PMbored-oyster-3147
05/13/2021, 6:35 PMprehistoric-coat-10166
05/14/2021, 5:05 AMworried-city-86458
05/14/2021, 5:21 AMbroad-dog-22463
05/14/2021, 8:47 AMbored-oyster-3147
05/14/2021, 12:15 PMworried-city-86458
05/14/2021, 9:30 PMbroad-dog-22463
05/14/2021, 9:33 PM