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

Support for spot instances on Azure #571

Merged
merged 4 commits into from
Mar 24, 2021
Merged

Support for spot instances on Azure #571

merged 4 commits into from
Mar 24, 2021

Conversation

alexott
Copy link
Contributor

@alexott alexott commented Mar 23, 2021

This PR adds support for Azure spot instances for clusters & instance pools. It also adds an additional support for preemptible executors on GCP (only for clsuters)

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #571 (2e2a2f6) into master (a9961bd) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #571      +/-   ##
==========================================
+ Coverage   81.61%   81.65%   +0.04%     
==========================================
  Files          77       77              
  Lines        6663     6678      +15     
==========================================
+ Hits         5438     5453      +15     
  Misses        815      815              
  Partials      410      410              
Impacted Files Coverage Δ
compute/model.go 76.31% <ø> (ø)
compute/resource_cluster.go 77.72% <100.00%> (+0.95%) ⬆️
compute/resource_instance_pool.go 94.28% <100.00%> (+0.53%) ⬆️

@@ -321,6 +324,12 @@ func modifyClusterRequest(clusterModel *Cluster) {
}
clusterModel.AwsAttributes = &awsAttributes
}
if clusterModel.AzureAttributes != nil {
clusterModel.AzureAttributes = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we add a unit test here

Copy link
Contributor

Choose a reason for hiding this comment

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

But does it make sense to nil the field if it's not nil?..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all Azure attributes now are related to the Spot instances only, and if we're using instance pools, then we shouldn't override instance types?

clusterModel.AzureAttributes = nil
}
if clusterModel.GcpAttributes != nil {
clusterModel.GcpAttributes = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we add a unit test here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me add it...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@@ -61,6 +61,8 @@ func ResourceInstancePool() *schema.Resource {
s["custom_tags"].ForceNew = true
s["enable_elastic_disk"].ForceNew = true
s["enable_elastic_disk"].Default = true
s["aws_attributes"].ConflictsWith = []string{"azure_attributes"}
s["azure_attributes"].ConflictsWith = []string{"aws_attributes"}
Copy link
Contributor

Choose a reason for hiding this comment

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

no gcp attributes for instance pools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no instance pools support yet, so I can't test it - will add later

@alexott alexott added this to the v0.3.2 milestone Mar 23, 2021
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