mirror of https://github.com/databricks/cli.git
569bb1cf63
## Changes This PR follows instructions in https://goreleaser.com/cookbooks/multi-platform-docker-images/ to create a multi-arch docker CLI image. Thus customers can simply specify `docker pull ghcr.io/databricks/cli:latest` to pull and run the image. The current approach uses the `docker manifest` support in goreleaser to create a multi-arch image. This has a couple of pros and cons. TLDR; The changes as is in the PR are good to go and very low risk. The information provided here is just FYI. pros: Fewer configurations/workflows for us to manage/maintain. Goreleaser makes sure the correct CLI binary is in place when building the CLI and also takes care of publishing it to the Github Container Registry. cons: Goreleaser only supports [docker manifest](https://docs.docker.com/reference/cli/docker/manifest/) to create multi-arch images. This has a few minor disadvantages: 1. `goreleaser` pushes all intermediate images (arm64 and and64 specific images) to the registry. This is required for the manifest to reference them. See: https://github.com/goreleaser/goreleaser/issues/2606 Note: We have a migration path here, if someday we stop publishing intermediate images, we can simply tag the "multi-arch" image as both `latest-amd64` and `latest-arm64`. For now, these are separate images. see: https://github.com/databricks/cli/pkgs/container/cli 2. `docker manifest` is technically an experimental command. Though it's been out for multiple years now and the indirect dependency by `goreleaser` should be fine. In any case, we can migrate by moving our docker build process off goreleaser if we need to. ## Tests Tested manually by publishing a new release for `v0.0.0-docker` in ghcr.io. 1. Package: https://github.com/databricks/cli/pkgs/container/cli 2. Release workflow: https://github.com/databricks/cli/actions/runs/8689359851 Tests the image itself by running it manually: ``` ➜ cli git:(feature/multi-arch-docker) docker pull ghcr.io/databricks/cli:latest latest: Pulling from databricks/cli bca4290a9639: Already exists 6d445556910d: Already exists Digest: sha256:82eabc500b541a89182aed4d3158c955e57c1e84d9616b76510aceb1d9024425 Status: Downloaded newer image for ghcr.io/databricks/cli:latest ghcr.io/databricks/cli:latest What's Next? View a summary of image vulnerabilities and recommendations → docker scout quickview ghcr.io/databricks/cli:latest ➜ cli git:(feature/multi-arch-docker) docker run ghcr.io/databricks/cli --version Databricks CLI v0.0.0-docker ``` |
||
---|---|---|
.codegen | ||
.github | ||
.vscode | ||
bundle | ||
cmd | ||
docker | ||
docs | ||
internal | ||
libs | ||
.codegen.json | ||
.gitattributes | ||
.gitignore | ||
.goreleaser.yaml | ||
.mockery.yaml | ||
CHANGELOG.md | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
NOTICE | ||
README.md | ||
go.mod | ||
go.sum | ||
main.go | ||
main_test.go |
README.md
Databricks CLI
This project is in Public Preview.
Documentation about the full REST API coverage is available in the docs folder.
Documentation is available at https://docs.databricks.com/dev-tools/cli/databricks-cli.html.
Installation
This CLI is packaged as a dependency-free binary executable and may be located in any directory. See https://github.com/databricks/cli/releases for releases and the docs pages for installation instructions.
Authentication
This CLI follows the Databricks Unified Authentication principles.
You can find a detailed description at https://github.com/databricks/databricks-sdk-go#authentication.