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

Allow init scripts on ADLS in databricks_cluster and related resources #1845

Merged
merged 1 commit into from
Dec 14, 2022
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
14 changes: 10 additions & 4 deletions clusters/clusters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ type GcsStorageInfo struct {
Destination string `json:"destination,omitempty"`
}

// AbfssStorageInfo contains the struct for when storing files in ADLS
type AbfssStorageInfo struct {
Destination string `json:"destination,omitempty"`
}

// LocalFileInfo represents a local file on disk, e.g. in a customer's container.
type LocalFileInfo struct {
Destination string `json:"destination,omitempty"`
Expand All @@ -204,10 +209,11 @@ type StorageInfo struct {

// InitScriptStorageInfo captures the allowed sources of init scripts.
type InitScriptStorageInfo struct {
Dbfs *DbfsStorageInfo `json:"dbfs,omitempty" tf:"group:storage"`
Gcs *GcsStorageInfo `json:"gcs,omitempty" tf:"group:storage"`
S3 *S3StorageInfo `json:"s3,omitempty" tf:"group:storage"`
File *LocalFileInfo `json:"file,omitempty"`
Dbfs *DbfsStorageInfo `json:"dbfs,omitempty" tf:"group:storage"`
Gcs *GcsStorageInfo `json:"gcs,omitempty" tf:"group:storage"`
S3 *S3StorageInfo `json:"s3,omitempty" tf:"group:storage"`
Abfss *AbfssStorageInfo `json:"abfss,omitempty" tf:"group:storage"`
File *LocalFileInfo `json:"file,omitempty"`
}

// SparkNodeAwsAttributes is the struct that determines if the node is a spot instance or not
Expand Down
14 changes: 13 additions & 1 deletion docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,19 @@ init_scripts {
}
```

Clusters with [custom Docker containers](https://docs.databricks.com/clusters/custom-containers.html) also allow a local file location for init scripts as follows:
Similarly, for an init script stored in ADLS:

```hcl
init_scripts {
abfss {
destination = "abfss://container@storage.dfs.core.windows.net/install-elk.sh"
}
}
```

Please note that you need to provide Spark Hadoop configuration (`spark.hadoop.fs.azure...`) to authenticate to ADLS to get access to the init script.

Clusters with [custom Docker containers](https://docs.databricks.com/clusters/custom-containers.html) also allow a local file location for init scripts as follows:

```hcl
init_scripts {
Expand Down