-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
launch
command and release pipeline
- Loading branch information
Showing
9 changed files
with
159 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
# - name: Import GPG key | ||
# id: import_gpg | ||
# uses: hashicorp/[email protected] | ||
# env: | ||
# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
# PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ bricks | |
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- '-s -w' | ||
goos: | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: '{{ .ProjectName }}_v{{ .Version }}' | ||
archives: | ||
- format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
snapshot: | ||
name_template: '{{ incpatch .Version }}-devel' | ||
# signs: | ||
# - artifacts: checksum | ||
# args: | ||
# - "--local-user" | ||
# - "{{ .Env.GPG_FINGERPRINT }}" | ||
# - "--output" | ||
# - "${signature}" | ||
# - "--detach-sign" | ||
# - "${artifact}" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
# Bricks! | ||
|
||
`make build` | ||
This is an early PoC at this stage! | ||
|
||
`./bricks test` | ||
`make build` (or download artifacts) | ||
|
||
the rest will follow someday. | ||
Reuses authentication from Databricks CLI. And terraform provider. See details here: https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs#environment-variables | ||
|
||
Supports: | ||
* Databricks CLI | ||
* Databricks CLI Profiles | ||
* Azure CLI Auth | ||
* Azure MSI Auth | ||
* Azure SPN Auth | ||
* Google OIDC Auth | ||
* Direct `DATABRICKS_HOST`, `DATABRICKS_TOKEN` or `DATABRICKS_USERNAME` + `DATABRICKS_PASSWORD` variables. | ||
|
||
What works: | ||
|
||
* `./bricks fs ls /` | ||
* `./bricks test` | ||
* `./bricks run test.py` | ||
|
||
What doesn't work: | ||
|
||
* Everything else. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/databricks/bricks/project" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// launchCmd represents the launch command | ||
var launchCmd = &cobra.Command{ | ||
Use: "launch", | ||
Short: "Launches a notebook on development cluster", | ||
Long: `Reads a file and executes it on dev cluster`, | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
contents, err := os.ReadFile(args[0]) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
results := project.RunPythonOnDev(cmd.Context(), string(contents)) | ||
if results.Failed() { | ||
log.Fatal(results.Error()) | ||
} | ||
fmt.Println(results.Text()) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(launchCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
spark.sql('show tables').show() |