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

Move trampoline code into trampoline package #1793

Merged
merged 1 commit into from
Sep 27, 2024
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
4 changes: 2 additions & 2 deletions bundle/phases/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/databricks/cli/bundle/deploy/terraform"
"github.com/databricks/cli/bundle/libraries"
"github.com/databricks/cli/bundle/permissions"
"github.com/databricks/cli/bundle/python"
"github.com/databricks/cli/bundle/scripts"
"github.com/databricks/cli/bundle/trampoline"
"github.com/databricks/cli/libs/cmdio"
"github.com/databricks/cli/libs/sync"
terraformlib "github.com/databricks/cli/libs/terraform"
Expand Down Expand Up @@ -157,7 +157,7 @@ func Deploy(outputHandler sync.OutputHandler) bundle.Mutator {
artifacts.CleanUp(),
libraries.ExpandGlobReferences(),
libraries.Upload(),
python.TransformWheelTask(),
trampoline.TransformWheelTask(),
files.Upload(outputHandler),
deploy.StateUpdate(),
deploy.StatePush(),
Expand Down
4 changes: 2 additions & 2 deletions bundle/phases/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/databricks/cli/bundle/deploy/metadata"
"github.com/databricks/cli/bundle/deploy/terraform"
"github.com/databricks/cli/bundle/permissions"
"github.com/databricks/cli/bundle/python"
"github.com/databricks/cli/bundle/scripts"
"github.com/databricks/cli/bundle/trampoline"
)

// The initialize phase fills in defaults and connects to the workspace.
Expand Down Expand Up @@ -66,7 +66,7 @@ func Initialize() bundle.Mutator {
mutator.ConfigureWSFS(),

mutator.TranslatePaths(),
python.WrapperWarning(),
trampoline.WrapperWarning(),
permissions.ApplyBundlePermissions(),
permissions.FilterCurrentUser(),
metadata.AnnotateJobs(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package python
package trampoline

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package python
package trampoline

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package python
package trampoline

import (
"context"
Expand Down
10 changes: 5 additions & 5 deletions bundle/python/transform.go → bundle/trampoline/python_wheel.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package python
package trampoline

import (
"context"
Expand Down Expand Up @@ -69,7 +69,7 @@ func TransformWheelTask() bundle.Mutator {
res := b.Config.Experimental != nil && b.Config.Experimental.PythonWheelWrapper
return res, nil
},
mutator.NewTrampoline(
NewTrampoline(
"python_wheel",
&pythonTrampoline{},
NOTEBOOK_TEMPLATE,
Expand All @@ -94,9 +94,9 @@ func (t *pythonTrampoline) CleanUp(task *jobs.Task) error {
return nil
}

func (t *pythonTrampoline) GetTasks(b *bundle.Bundle) []mutator.TaskWithJobKey {
func (t *pythonTrampoline) GetTasks(b *bundle.Bundle) []TaskWithJobKey {
r := b.Config.Resources
result := make([]mutator.TaskWithJobKey, 0)
result := make([]TaskWithJobKey, 0)
for k := range b.Config.Resources.Jobs {
tasks := r.Jobs[k].JobSettings.Tasks
for i := range tasks {
Expand All @@ -110,7 +110,7 @@ func (t *pythonTrampoline) GetTasks(b *bundle.Bundle) []mutator.TaskWithJobKey {
continue
}

result = append(result, mutator.TaskWithJobKey{
result = append(result, TaskWithJobKey{
JobKey: k,
Task: task,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package python
package trampoline

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mutator
package trampoline

import (
"context"
Expand All @@ -23,6 +23,7 @@ type TrampolineFunctions interface {
GetTasks(b *bundle.Bundle) []TaskWithJobKey
CleanUp(task *jobs.Task) error
}

type trampoline struct {
name string
functions TrampolineFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mutator
package trampoline

import (
"context"
Expand Down
Loading