Skip to content

Commit

Permalink
Added output message to warn about slower deployments with apps (#2161)
Browse files Browse the repository at this point in the history
## 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 (#2144)
  • Loading branch information
andrewnester authored Jan 16, 2025
1 parent b273dc5 commit 8f34fc7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bundle/apps/slow_deploy_message.go
Original file line number Diff line number Diff line change
@@ -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{}
}
1 change: 1 addition & 0 deletions bundle/phases/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 8f34fc7

Please sign in to comment.