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

[fleet] First working set of databricks script e2e #31984

Merged
merged 3 commits into from
Dec 11, 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
7 changes: 5 additions & 2 deletions pkg/fleet/installer/setup/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/DataDog/datadog-agent/pkg/fleet/installer/oci"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/packages"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/exec"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/paths"
"gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -220,7 +219,11 @@ func (i *HostInstaller) ConfigureAndInstall(ctx context.Context) error {
return fmt.Errorf("failed to write configurations: %w", err)
}

cmd := exec.NewInstallerExec(i.env, paths.StableInstallerPath)
exePath, err := os.Executable()
if err != nil {
return fmt.Errorf("failed to get executable path: %w", err)
}
cmd := exec.NewInstallerExec(i.env, exePath)

if i.injectorVersion != "" {
if err := cmd.Install(ctx, oci.PackageURL(i.env, "datadog-apm-inject", i.injectorVersion), nil); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/fleet/installer/setup/djm/databricks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
)

const (
databricksInjectorVersion = "0.21.0"
databricksJavaVersion = "1.41.1"
databricksAgentVersion = "7.57.2"
databricksInjectorVersion = "0.21.0-1"
databricksJavaVersion = "1.41.1-1"
databricksAgentVersion = "7.57.2-1"
logsService = "databricks"
)

Expand Down
9 changes: 5 additions & 4 deletions pkg/fleet/installer/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"fmt"

"github.com/DataDog/datadog-agent/pkg/fleet/installer/env"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/packages"
"github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/djm"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/exec"
"github.com/DataDog/datadog-agent/pkg/fleet/internal/paths"
Expand All @@ -25,11 +26,11 @@ const (
func Setup(ctx context.Context, env *env.Env, flavor string) error {
switch flavor {
case FlavorDatabricks:
// temporary until the whole e2e test pipeline is setup
if err := packages.SetupInstaller(ctx); err != nil {
return fmt.Errorf("failed to setup installer: %w", err)
}
if err := djm.SetupDatabricks(ctx, env); err != nil {
fmt.Printf("Databricks setup failed: %v\n", err)
} else {
fmt.Println("Databricks setup completed")
return fmt.Errorf("failed to setup Databricks: %w", err)
}
return nil
default:
Expand Down
19 changes: 15 additions & 4 deletions test/new-e2e/tests/installer/script/databricks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@ type vmUpdaterSuite struct {

func (s *vmUpdaterSuite) TestInstallScript() {
url := fmt.Sprintf("https://installtesting.datad0g.com/%s/scripts/install-databricks.sh", s.commitHash)
s.Env().RemoteHost.MustExecute(fmt.Sprintf("curl -L %s > install_script; export DD_INSTALLER_REGISTRY_URL_INSTALLER_PACKAGE=installtesting.datad0g.com; sudo -E bash install_script", url))

// worker
s.Env().RemoteHost.MustExecute(fmt.Sprintf("curl -L %s > install_script; export DD_API_KEY=test; export DD_INSTALLER_REGISTRY_URL_INSTALLER_PACKAGE=installtesting.datad0g.com; sudo -E bash install_script", url))
s.Env().RemoteHost.MustExecute("sudo test -d /opt/datadog-packages/datadog-agent/7.57.2-1")

// driver
s.Env().RemoteHost.MustExecute(fmt.Sprintf("curl -L %s > install_script; export DB_IS_DRIVER=true; export DD_API_KEY=test; export DD_INSTALLER_REGISTRY_URL_INSTALLER_PACKAGE=installtesting.datad0g.com; sudo -E bash install_script", url))
s.Env().RemoteHost.MustExecute("sudo test -d /opt/datadog-packages/datadog-agent/7.57.2-1")
s.Env().RemoteHost.MustExecute("sudo test -d /opt/datadog-packages/datadog-apm-inject/0.21.0")
s.Env().RemoteHost.MustExecute("sudo test -d /opt/datadog-packages/datadog-apm-library-java/1.41.1")
}

func TestUpdaterSuite(t *testing.T) {
e2e.Run(t, &vmUpdaterSuite{commitHash: os.Getenv("CI_COMMIT_SHA")}, e2e.WithProvisioner(awshost.ProvisionerNoFakeIntake(
awshost.WithEC2InstanceOptions(ec2.WithOSArch(osdesc.UbuntuDefault, osdesc.ARM64Arch)),
)))
for _, arch := range []osdesc.Architecture{osdesc.AMD64Arch, osdesc.ARM64Arch} {
e2e.Run(t, &vmUpdaterSuite{commitHash: os.Getenv("CI_COMMIT_SHA")}, e2e.WithProvisioner(awshost.ProvisionerNoFakeIntake(
awshost.WithEC2InstanceOptions(ec2.WithOSArch(osdesc.UbuntuDefault, arch)),
)))
}
}
Loading