-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New Resource: aws_emr_instance_fleet #1475
Conversation
3475ee3
to
2ee6156
Compare
2ee6156
to
a239bd5
Compare
ForceNew: true, | ||
Elem: configurationSchema(), | ||
}, | ||
"ebs_configuration": { |
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.
What do you think about reusing the schema for ebs_config
that is already used in the instance_group
? In that case, you could add the ebs_optimized
variable on this hierarchy level.
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.
makes sense! I tried to maintain the same hierarchy used in EMR but the schema used on instace_group
is easier ;)
a239bd5
to
a73d4aa
Compare
Fixed some issues that I found & rebased |
Type: schema.TypeInt, | ||
Optional: true, | ||
ForceNew: true, | ||
Default: 60, |
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.
I think the default should be 0. See Amazon doc (http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html):
If you don't specify a defined duration, instances terminate as soon as the Spot price exceeds the maximum Spot price.
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.
Right! The problem was a misunderstood reading the valid values for that parameter where it says (60, 120, ...). But it is not a mandatory parameter, so, default value setted to 0.
Thanks!
When using instance fleets, it is possible to define a list of Subnets (RequestedEc2SubnetIds) or Availability Zones (RequestedEc2AvailabilityZones) to specify where to launch the cluster (see http://docs.aws.amazon.com/emr/latest/APIReference/API_Ec2InstanceAttributes.html). Can these two attributes be integrated in the |
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
//"configurations": { |
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.
Did it resolve in a loop issue or why did you comment out these lines?
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.
yes! checking the documentation here we can define configurations inside configurations but when I defined it, it resolves in a loop issue trying to "compile" the schema. Any idea on how to fix this? Because I was looking in the code and I didn't find any alternative/solution.
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.
The doc is not really clear, but it seems that no real recursion is required here. Limiting the nesting to one level should be enough. So, you could use a new schema (e.g. additionalConfigurationSchema) that only has a "classification" and "properties" attribute.
d2bd180
to
b280ba4
Compare
Updated! |
aws/validators.go
Outdated
@@ -916,6 +916,84 @@ func validateAwsEmrInstanceGroupRole(v interface{}, k string) (ws []string, erro | |||
return | |||
} | |||
|
|||
func validateAwsEmrSpotProvisioningTimeOutAction(v interface{}, k string) (ws []string, errors []error) { | |||
validTypes := map[string]struct{}{ | |||
"SWITCH_TO_ON_DEMAND": {}, |
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.
You could use the constant emr.SpotProvisioningTimeoutActionSwitchToOnDemand
here and there are a couple of more places in this file and other files of this PR where you could use constants.
} | ||
} | ||
|
||
func ebsConfigurationSchema() *schema.Resource { |
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.
Shouldn't this schema be used by the instance group to avoid redundancy?
You should document this feature also in the |
13962dd
to
5278ded
Compare
|
||
* `timeout_action` - (Required) The action to take when `target_spot_capacity` has not been fulfilled when the | ||
`timeout_durataion_minutes` has expired. Spot instances are not uprovisioned within the Spot provisioining timeout. | ||
Valid values are `TERMINATE_CLUSTER` and `SWITCH_TO_ON_DEMAND`. `SWITCH_TO_ON_DEMAND specifies that if no Spot |
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.
Missing a backtick after the second SWITCH_TO_ON_DEMAND.
Changing this forces a new resource to be created. | ||
|
||
* `instance_type_configs` - (Optional) The instance type configurations that define the EC2 instances in the instance fleet. | ||
Array of `instance_type_config` blocks. |
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.
Same here, no new line?
* `cluster_id` - (Required) ID of the EMR Cluster to attach to. Changing this forces a new resource to be created. | ||
|
||
* `instance_fleet_type` - (Required) The node type that the instance fleet hosts. Valid values are `MASTER`, `CORE`, and `TASK`. | ||
Changing this forces a new resource to be created. |
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.
No new line necessary?
ebs_optimized = true | ||
ebs_config = [ | ||
{ | ||
size = 10 |
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.
The formatting of the resources seems to be muddled in some of the tests. It would be nice to fix this to improve readability.
{ | ||
size = 100 | ||
type = "gp2" | ||
volumes_per_instance = 1 |
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.
Just a bad alignment.
aws/resource_aws_emr_cluster_test.go
Outdated
ebs_configuration { | ||
ebs_block_device_configs = [ | ||
{ | ||
volume_specification { |
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.
The EBS config definition used here is the old one. I'm surprised that this test still passes.
6cf7469
to
8007872
Compare
@stekiri @radeksimko any chance this would get merged in, if we fix the conflicts? |
Is this going to be merged anytime soon? |
Another vote for merging (or otherwise explaining what needs to be done) cc @bflad |
Another vote |
One more month has passed without any news that this could eventually get merged, this sends a worrying message. Trying one last round of mentions - @radeksimko @bflad what do you think? |
ebsBlockDeviceConfigs = append(ebsBlockDeviceConfigs, ebsBlockDeviceConfig) | ||
} | ||
ebsConfig.EbsBlockDeviceConfigs = ebsBlockDeviceConfigs | ||
if v, ok := configAttributes["ebs_config"].(*schema.Set); ok && v.Len() == 1 { |
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 silently ignore EBS configs with more than one volume with v.Len() == 1
?
} | ||
|
||
if rawConfig, ok := configAttributes["configurations"]; ok { | ||
config.Configurations = expandConfigurations(rawConfig.([]interface{})) |
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.
Should the cast be rawConfig.(*schema.Set).List()
instead?
is this one parked? |
This is a really useful addition - any progress with its release? |
@stekiri @radeksimko @bflad any chance this would get merged in? |
emr instance fleet is really useful, we need it badly |
If somebody has the opportunity to fix conflict here? |
Hi @jmsantorum 👋 Can you please have this PR only handle the |
Hi @bflad 👋! Give me a couple of days. I'll update the PR with only the |
Any idea when this would get picked up? |
@darrenhaken @copumpkin @jmsantorum I have all the conflicts fixed and I have synced with the latest master. I am using it in my preprod environment as well. How do I proceed to update this PR? @jmsantorum, can you give me access to push a new branch to your repo? If anyone knows a better way, please suggest. |
@sanoojm just added as collaborator to my repo |
Closing this conflicted pull request as there has been no movement. Please feel free to submit a new one and we'll take a look. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
I'm not sure it the acceptance tests are done in the best way.
It's my first PR on this project and any feedback is welcome