mirror of https://github.com/databricks/cli.git
Added output message to warn about slower deployments with apps (#2161)
## Changes When users create one or more Databricks apps in their bundle it can lead to initial bundle deployment being slower because apps need to wait until their compute is fully provisioned and started. This PR adds a message to warn about it. This message will be removed when `no_compute` option becomes available in TF provider and used in DABs (https://github.com/databricks/cli/pull/2144)
This commit is contained in:
parent
b273dc5942
commit
8f34fc7961
|
@ -0,0 +1,29 @@
|
||||||
|
package apps
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/databricks/cli/bundle"
|
||||||
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
|
"github.com/databricks/cli/libs/diag"
|
||||||
|
)
|
||||||
|
|
||||||
|
type slowDeployMessage struct{}
|
||||||
|
|
||||||
|
// TODO: needs to be removed when when no_compute option becomes available in TF provider and used in DABs
|
||||||
|
// See https://github.com/databricks/cli/pull/2144
|
||||||
|
func (v *slowDeployMessage) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
|
||||||
|
if len(b.Config.Resources.Apps) > 0 {
|
||||||
|
cmdio.LogString(ctx, "Databricks apps in your bundle can slow initial deployment as they wait for compute provisioning.")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *slowDeployMessage) Name() string {
|
||||||
|
return "apps.SlowDeployMessage"
|
||||||
|
}
|
||||||
|
|
||||||
|
func SlowDeployMessage() bundle.Mutator {
|
||||||
|
return &slowDeployMessage{}
|
||||||
|
}
|
|
@ -136,6 +136,7 @@ func Deploy(outputHandler sync.OutputHandler) bundle.Mutator {
|
||||||
bundle.Seq(
|
bundle.Seq(
|
||||||
terraform.StatePush(),
|
terraform.StatePush(),
|
||||||
terraform.Load(),
|
terraform.Load(),
|
||||||
|
apps.SlowDeployMessage(),
|
||||||
apps.InterpolateVariables(),
|
apps.InterpolateVariables(),
|
||||||
apps.UploadConfig(),
|
apps.UploadConfig(),
|
||||||
metadata.Compute(),
|
metadata.Compute(),
|
||||||
|
|
Loading…
Reference in New Issue