This message was deleted.
s
This message was deleted.
m
Interesting question. You can the option of remote deployment https://github.com/pulumi/automation-api-examples/tree/main/go/remote_deployment to use the new Pulumi Deployment feature!
👀 1
Default Timeout on Pulumi Deployment is 2h but I can ask engineering if there is an option to extend this.
Or you need to come up with your own implementation, like a container, function etc to execute the cli only for the long running deployments
Could see the Pulumi k8s-operator doing this 🙂
q
In my case, the activity fails after 5 mins but the instance is created after 5 hours without any problem. The thing is that I am sending to Pulumi 2 resources to be created (the instance and the database) but only the instance is created
m
q
Not related i think
Copy code
Diagnostics:
  pulumi:pulumi:Stack (jandroav/jarvis/jandro)
    warning: Attempting to deploy or update resources with 4 pending operations from previous deployment.
  * urn:pulumi:jandro::jarvis::azure-native:sql:ManagedInstance::jarvis-mssql-teams-app, interrupted while creating
  * urn:pulumi:jandro::jarvis::azure-native:sql:ManagedInstance::jarvis-mssql-teams-app, interrupted while creating
  * urn:pulumi:jandro::jarvis::azure-native:sql:ManagedInstance::jarvis-mssql-teams-app, interrupted while creating
  * urn:pulumi:jandro::jarvis::azure-native:sql:ManagedInstance::jarvis-mssql-teams-app, interrupted while creating
These resources are in an unknown state because the Pulumi CLI was interrupted while waiting for changes to these resources to complete. You should confirm whether or not the operations listed completed successfully by checking the state of the appropriate provider. For example, if you are using AWS, you can confirm using the AWS Console.

Once you have confirmed the status of the interrupted operations, you can repair your stack using `pulumi refresh` which will refresh the state from the provider you are using and clear the pending operations if there are any.

Note that `pulumi refresh` will need to be run interactively to clear pending CREATE operations.
I think that is because my golang cli is no longer running
My pulumi function consists on 2 resource creation, and the second depends on the first one
m
and why the cli stops Should it not wait
q
cause it will be waiting for 5 hours and no other cli command could be executed
m
yes, and that could be the issue with the state file being in an unknown state
q
the cli executes something like
jarvis db create
and then you need to be able to run other stuff. thats why i thought it could be nice to let the pulumi service handle it in a async way
the cli ends cause I am executing the pulumi function in a goroutine
Copy code
go func() {
		_, err := executePulumiFunction(cm.AZURE, deployManagedInstanceFunc, destroy)
		if err != nil {
			log.Error(err)
		}
	}()
that's the only way I found to call pulumi without waiting 5 hours for the Azure Managed instance, but the thing I am missing is the ability of Pulumi to not fail after 5 min 🙂. My idea is to provide the user with the database connection details and a message like : "DB creation in progress, try to connect in 5 hours xD"
do you think remote deployment could help me here?
m
let me ask @echoing-dinner-19531 or @limited-rainbow-51650 if they have an idea without any major architectural changes in your cli
q
thanks a lot!
e
the cli ends cause I am executing the pulumi function in a goroutine
You should be able to keep the CLI alive with waitgroups: https://gobyexample.com/waitgroups But it does sounds like the deployment API is more what you want here, that will let our server carry on running the program and waiting for the resources to be created.
m
q
hey team thanks a lot. I will check it right now
m
I try to reconstruct your inital use case @quaint-salesclerk-22166
Hi @quaint-salesclerk-22166, the Remote Deployment will only work with, as @echoing-dinner-19531 correctly pointed out, with the usage of
var wg sync.WaitGroup
But then your CLI will wait again for completion.
q
ok got it, no way to do without waiting