Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not wait for app compute to start on bundle deploy #2144

Merged
merged 6 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions bundle/apps/slow_deploy_message.go

This file was deleted.

6 changes: 6 additions & 0 deletions bundle/deploy/terraform/tfdyn/convert_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func (appConverter) Convert(ctx context.Context, key string, vin dyn.Value, out
return err
}

// We always set no_compute to true as it allows DABs not to wait for app compute to be started when app is created.
vout, err = dyn.Set(vout, "no_compute", dyn.V(true))
if err != nil {
return err
}

// Add the converted resource to the output.
out.App[key] = vout.AsAny()

Expand Down
2 changes: 2 additions & 0 deletions bundle/deploy/terraform/tfdyn/convert_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func TestConvertApp(t *testing.T) {
assert.Equal(t, map[string]any{
"description": "app description",
"name": "app_id",
"no_compute": true,
"resources": []any{
map[string]any{
"name": "job1",
Expand Down Expand Up @@ -136,6 +137,7 @@ func TestConvertAppWithNoDescription(t *testing.T) {
assert.Equal(t, map[string]any{
"name": "app_id",
"description": "", // Due to Apps API always returning a description field, we set it in the output as well to avoid permanent TF drift
"no_compute": true,
"resources": []any{
map[string]any{
"name": "job1",
Expand Down
1 change: 0 additions & 1 deletion bundle/phases/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func Deploy(outputHandler sync.OutputHandler) bundle.Mutator {
// mutators need informed consent if they are potentially destructive.
deployCore := bundle.Defer(
bundle.Seq(
apps.SlowDeployMessage(),
bundle.LogString("Deploying resources..."),
terraform.Apply(),
),
Expand Down
11 changes: 5 additions & 6 deletions integration/bundle/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ import (
func TestDeployBundleWithApp(t *testing.T) {
ctx, wt := acc.WorkspaceTest(t)

// TODO: should only skip app run when app can be created with no_compute option.
if testing.Short() {
t.Log("Skip the app creation and run in short mode")
return
}

if testutil.GetCloud(t) == testutil.GCP {
t.Skip("Skipping test for GCP cloud because /api/2.0/apps is temporarily unavailable there.")
}
Expand Down Expand Up @@ -106,6 +100,11 @@ env:
- name: JOB_ID
value: "%d"`, job.JobId))

if testing.Short() {
t.Log("Skip the app run in short mode")
return
}

// Try to run the app
_, out := runResourceWithStderr(t, ctx, root, "test_app")
require.Contains(t, out, app.Url)
Expand Down
1 change: 0 additions & 1 deletion integration/bundle/testdata/apps/bundle_deploy.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Uploading bundle files to /Workspace/Users/$USERNAME/.bundle/$UNIQUE_PRJ/files...
Note: Databricks apps included in this bundle may increase initial deployment time due to compute provisioning.
Deploying resources...
Updating deployment state...
Deployment complete!