Skip to content

Bundle cli dependencies#1147

Merged
ilia-db merged 17 commits intobundle-integfrom
bundle-cli-dependencies
Apr 8, 2024
Merged

Bundle cli dependencies#1147
ilia-db merged 17 commits intobundle-integfrom
bundle-cli-dependencies

Conversation

@ilia-db
Copy link
Copy Markdown
Contributor

@ilia-db ilia-db commented Mar 19, 2024

Bundle terraform binaries with the extension and expose them with env vars to the CLI and the terminal

Depends on databricks/cli#1294

ilia-db added 2 commits March 19, 2024 16:09
And expose them with env vars to the CLI and the terminal
@ilia-db ilia-db marked this pull request as ready for review March 20, 2024 10:13
@ilia-db ilia-db temporarily deployed to azure-prod-usr March 20, 2024 10:13 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr March 20, 2024 10:13 — with GitHub Actions Inactive
@ilia-db ilia-db requested a review from kartikgupta-db March 20, 2024 10:14
);

const cliDeps = getCLIDependenciesEnvVars(context);
for (const [key, value] of Object.entries(cliDeps)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The idea is to always use the packaged tf binaries? Can you add a comment for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, we always use bundled dependencies, this approach seems to be the simples one. I've added the comment here

@ilia-db ilia-db temporarily deployed to azure-prod-usr April 2, 2024 09:44 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 2, 2024 09:44 — with GitHub Actions Inactive
github-merge-queue bot pushed a commit to databricks/cli that referenced this pull request Apr 2, 2024
- Add `bundle debug terraform` command. It prints versions of the
Terraform and the Databricks Terraform provider. In the text mode it
also explains how to setup the CLI in environments with restricted
internet access.
- Use `DATABRICKS_TF_EXEC_PATH` env var to point Databricks CLI to the
Terraform binary. The CLI only uses it if `DATABRICKS_TF_VERSION`
matches the currently used terraform version.
- Use `DATABRICKS_TF_CLI_CONFIG_FILE` env var to point Terraform CLI
config that points to the filesystem mirror for the Databricks provider.
The CLI only uses it if `DATABRICKS_TF_PROVIDER_VERSION` matches the
currently used provider version.


Relevant PR on the VSCode extension side:
databricks/databricks-vscode#1147

Example output of the `databricks bundle debug terraform`:
```
Terraform version: 1.5.5
Terraform URL: https://releases.hashicorp.com/terraform/1.5.5

Databricks Terraform Provider version: 1.38.0
Databricks Terraform Provider URL: https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.38.0

Databricks CLI downloads its Terraform dependencies automatically.

If you run the CLI in an air-gapped environment, you can download the dependencies manually and set these environment variables:

  DATABRICKS_TF_VERSION=1.5.5
  DATABRICKS_TF_EXEC_PATH=/path/to/terraform/binary
  DATABRICKS_TF_PROVIDER_VERSION=1.38.0
  DATABRICKS_TF_CLI_CONFIG_FILE=/path/to/terraform/cli/config.tfrc

Here is an example *.tfrc configuration file:

  disable_checkpoint = true
  provider_installation {
    filesystem_mirror {
      path = "/path/to/a/folder/with/databricks/terraform/provider"
    }
  }

The filesystem mirror path should point to the folder with the Databricks Terraform Provider. The folder should have this structure: /registry.terraform.io/databricks/databricks/terraform-provider-databricks_1.38.0_ARCH.zip

For more information about filesystem mirrors, see the Terraform documentation: https://developer.hashicorp.com/terraform/cli/config/config-file#filesystem_mirror
```

---------

Co-authored-by: shreyas-goenka <[email protected]>
github-merge-queue bot pushed a commit to databricks/cli that referenced this pull request Apr 2, 2024
- Add `bundle debug terraform` command. It prints versions of the
Terraform and the Databricks Terraform provider. In the text mode it
also explains how to setup the CLI in environments with restricted
internet access.
- Use `DATABRICKS_TF_EXEC_PATH` env var to point Databricks CLI to the
Terraform binary. The CLI only uses it if `DATABRICKS_TF_VERSION`
matches the currently used terraform version.
- Use `DATABRICKS_TF_CLI_CONFIG_FILE` env var to point Terraform CLI
config that points to the filesystem mirror for the Databricks provider.
The CLI only uses it if `DATABRICKS_TF_PROVIDER_VERSION` matches the
currently used provider version.


Relevant PR on the VSCode extension side:
databricks/databricks-vscode#1147

Example output of the `databricks bundle debug terraform`:
```
Terraform version: 1.5.5
Terraform URL: https://releases.hashicorp.com/terraform/1.5.5

Databricks Terraform Provider version: 1.38.0
Databricks Terraform Provider URL: https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.38.0

Databricks CLI downloads its Terraform dependencies automatically.

If you run the CLI in an air-gapped environment, you can download the dependencies manually and set these environment variables:

  DATABRICKS_TF_VERSION=1.5.5
  DATABRICKS_TF_EXEC_PATH=/path/to/terraform/binary
  DATABRICKS_TF_PROVIDER_VERSION=1.38.0
  DATABRICKS_TF_CLI_CONFIG_FILE=/path/to/terraform/cli/config.tfrc

Here is an example *.tfrc configuration file:

  disable_checkpoint = true
  provider_installation {
    filesystem_mirror {
      path = "/path/to/a/folder/with/databricks/terraform/provider"
    }
  }

The filesystem mirror path should point to the folder with the Databricks Terraform Provider. The folder should have this structure: /registry.terraform.io/databricks/databricks/terraform-provider-databricks_1.38.0_ARCH.zip

For more information about filesystem mirrors, see the Terraform documentation: https://developer.hashicorp.com/terraform/cli/config/config-file#filesystem_mirror
```

---------

Co-authored-by: shreyas-goenka <[email protected]>
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 09:29 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 09:29 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 09:31 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 09:31 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 11:41 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 11:41 — with GitHub Actions Inactive
@ilia-db ilia-db requested a review from kartikgupta-db April 4, 2024 11:42
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 11:53 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 11:53 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 12:25 — with GitHub Actions Inactive
@ilia-db ilia-db temporarily deployed to azure-prod-usr April 4, 2024 12:25 — with GitHub Actions Inactive
@ilia-db ilia-db merged commit 5b4f896 into bundle-integ Apr 8, 2024
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
ilia-db added a commit that referenced this pull request Apr 8, 2024
## packages/databricks-vscode
##  (2024-04-08)

* Bundle cli dependencies (#1147)
([5b4f896](5b4f896)),
closes
[#1147](#1147)
* Fix build platform detection (#1174)
([97c6d8b](97c6d8b)),
closes
[#1174](#1174)



## packages/databricks-vscode-types
##  (2024-04-08)

---------

Co-authored-by: releasebot <[email protected]>
Co-authored-by: Ilia Babanov <[email protected]>
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.

2 participants