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:
Andrew Nester 2025-01-16 12:39:59 +01:00 committed by GitHub
parent b273dc5942
commit 8f34fc7961
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View File

@ -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{}
}

View File

@ -136,6 +136,7 @@ func Deploy(outputHandler sync.OutputHandler) bundle.Mutator {
bundle.Seq(
terraform.StatePush(),
terraform.Load(),
apps.SlowDeployMessage(),
apps.InterpolateVariables(),
apps.UploadConfig(),
metadata.Compute(),