-
Notifications
You must be signed in to change notification settings - Fork 409
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
Support for Single Node Clusters (issue 411) #454
Conversation
@alexott could you attach the output of |
Codecov Report
@@ Coverage Diff @@
## master #454 +/- ##
==========================================
+ Coverage 81.20% 81.26% +0.05%
==========================================
Files 68 68
Lines 5193 5236 +43
==========================================
+ Hits 4217 4255 +38
- Misses 655 660 +5
Partials 321 321
|
Running the tests again (this will take some time) - there are failures that aren't directly related to this PR... |
Terraform 0.14 produces the warning ``` Terraform 0.13 and earlier allowed provider version constraints inside the provider configuration block, but that is now deprecated and will be removed in a future version of Terraform. To silence this warning, move the provider version constraint into the required_providers block. ``` the change should work on Terraform 0.12 as well
One thing is that with current design, the numWorkers := int32(X)
Cluster{NumWorkers: &numWorkers....} @nfx WDYT? |
@@ -1,5 +1,10 @@ | |||
terraform { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work with terraform 0.12? :) plenty of customers still use two-release old version.
it should ideally be handled with @alexott , there are two options available
if you decide to change it to int pointer, besides of changing 17 direct invocation places, you'd need add special handling in:
|
@nfx Looking at the Go tests, |
@nfx it works as designed - if it's 0, then it's omitted, but it's not what we want - we need to output 0 if |
@alexott i trust your years of C++ programming to make the best decision on int pointer vs custom marshaller for those structs :) it's equal amount of code, as far as i see it. |
@nfx comments are addressed. I went with custom serialization of JSON for |
Makefile
Outdated
|
||
install-tf-0.12: build | ||
@echo "✓ Installing provider for Terraform 0.12 ..." | ||
@mkdir -p '$(HOME)/.terraform.d/plugins/$(shell go version | awk '{print $$4}' | sed 's#/#_#')/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tf12 doesn't actually need any dir version prefix. look at installation instructions:
curl https://raw.githubusercontent.com/databrickslabs/databricks-terraform/master/godownloader-databricks-provider.sh | bash -s -- -b $HOME/.terraform.d/plugins
my testing setup is: $PATH
has 0.12 binary, terraform13 and terraform14 for other version as well.
Makefile
Outdated
@echo "✓ Use the following configuration for Terraform 0.12 to enable the version you've built" | ||
@echo "" | ||
@echo 'provider "databricks" {' | ||
@echo ' version = "0.3.0"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version pinning is not really needed for 0.12, 🤷 . it's going against installer script we provide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with current make install
it doesn't fine provider, unfortunately...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even after removing ~/.terraform.d ?...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it works if I do install like our install script, and remove the version. I'll remove this target completely...
repo = "https://mavencentral.org" | ||
exclusions = ["slf4j:slf4j"] | ||
library { | ||
maven { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing this :)
compute/clusters.go
Outdated
"sort" | ||
"strings" | ||
"time" | ||
|
||
"github.com/databrickslabs/databricks-terraform/common" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
"github.com/ulule/deepcopier" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need external dependency? can we do without it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copying of the data using reflection is kind of black magic (for me), I've tried to implement it myself, but gave up after several tries - maybe if I spend more time, I could do it, but not sure that this is a best use of the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly speaking, it works without this custom marshaling - it simply sends both num_workers
& autoscale
if both present, and control plane always prefer autoscale
. I simply afraid that it may stop this way at some point of time, and we'll need to do hotfix release...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single node clusters aren’t major dbu bringers, so I’m okay with that risk.
Additional libraries just require more processes and adding it just to use in one place might be an overkill :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main concern around this marshalling - if API stop accept both num_worker
& autoscale
, this will affect everything, not just single node. If you're ok, I'll revert that commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will merge after running acceptance tests locally :)
this should fix #411
azcli status
TestAccDatabricksDBFSFile_CreateViaSource(0.57s) <= can be ignoredTestAccDatabricksPermissionsResourceFullLifecycle (0.80s)<= can be ignoredTestAccDeleteInvalidMountFails
(11.86s) <= could you test if we can make mounts from single node clusters?...TestAccGroupMemberResource (17.73s)TestAccSecretAclResourceDefaultPrincipal (63.33s)TestAccSecretResource (18.47s)TestAccServicePrincipalResource (10.71s)TestAccTokenResource (7.59s)