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

Enable offline install of labs projects #2049

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

HariGS-DB
Copy link

@HariGS-DB HariGS-DB commented Dec 27, 2024

Changes

This PR makes changes to labs code base to allow for offline install of labs project (like UCX). by passing a flag --offline-install=true, the code will skip checking for project versions, and downloading code from github and instead will look from local installation folder. It is expected that the user will download and copy the code from other machine where it can install labs project and then run installation on the machine which has internet restriction.

Closes #1646

related to databrickslabs/ucx#3418

Tests

Added unit test case and tested.

.vscode/settings.json Outdated Show resolved Hide resolved
cmd/labs/install.go Outdated Show resolved Hide resolved
cmd/labs/github/releases.go Outdated Show resolved Hide resolved
cmd/labs/project/installer.go Show resolved Hide resolved
Copy link

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 2049
  • Commit SHA: d846c91f96bd43854cfc8344621416e2a33d924c

Checks will be approved automatically on success.

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pietern pietern changed the title Enable offline install of labs projects in environment with no internet access Enable offline install of labs projects Jan 29, 2025
@@ -9,7 +9,7 @@
],
"go.useLanguageServer": true,
"gopls": {
"formatting.gofumpt": true
"formatting.gofumpt": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert.

@@ -15,15 +15,15 @@ import (
)

type installable interface {
Install(ctx context.Context) error
Install(ctx context.Context, offlineInstall bool) error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a property on the installable, not a function argument.

}

type devInstallation struct {
*Project
*cobra.Command
}

func (d *devInstallation) Install(ctx context.Context) error {
func (d *devInstallation) Install(ctx context.Context, offlineInstall bool) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, not needed here.

@@ -54,7 +54,7 @@ func (d *devInstallation) Install(ctx context.Context) error {
return d.Installer.runHook(d.Command)
}

func NewInstaller(cmd *cobra.Command, name string) (installable, error) {
func NewInstaller(cmd *cobra.Command, name string, offlineInstall bool) (installable, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bool should be a property on the installer struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offline install for Databricks labs project
3 participants