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

New Resource: aws_emr_instance_fleet #1475

Closed
wants to merge 1 commit into from

Conversation

jmsantorum
Copy link
Contributor

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

@Ninir Ninir added the enhancement Requests to existing resources that expand the functionality or scope. label Aug 28, 2017
@jmsantorum jmsantorum changed the title [WIP] issue 1146 - Added instance fleet resource for AWS EMR issue 1146 - Added instance fleet resource for AWS EMR Sep 1, 2017
@radeksimko radeksimko added the new-resource Introduces a new resource. label Oct 11, 2017
@radeksimko radeksimko added the size/XXL Managed by automation to categorize the size of a PR. label Nov 15, 2017
ForceNew: true,
Elem: configurationSchema(),
},
"ebs_configuration": {
Copy link

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.

Copy link
Contributor Author

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 ;)

@jmsantorum
Copy link
Contributor Author

Fixed some issues that I found & rebased

Type: schema.TypeInt,
Optional: true,
ForceNew: true,
Default: 60,
Copy link

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.

Copy link
Contributor Author

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!

@stekiri
Copy link

stekiri commented Dec 4, 2017

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 ec2_attributes object?

Type: schema.TypeString,
Optional: true,
},
//"configurations": {
Copy link

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?

Copy link
Contributor Author

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.

Copy link

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.

@jmsantorum
Copy link
Contributor Author

Updated!

@@ -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": {},
Copy link

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 {
Copy link

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?

@stekiri
Copy link

stekiri commented Dec 5, 2017

You should document this feature also in the emr_cluster.html.md. It would be a pity if only the usage with the emr_instance_fleet resource was documented.


* `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
Copy link

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.
Copy link

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.
Copy link

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
Copy link

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
Copy link

Choose a reason for hiding this comment

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

Just a bad alignment.

ebs_configuration {
ebs_block_device_configs = [
{
volume_specification {
Copy link

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.

@jmsantorum jmsantorum force-pushed the issue-1146 branch 5 times, most recently from 6cf7469 to 8007872 Compare December 9, 2017 13:19
@peay
Copy link

peay commented Jul 3, 2018

@stekiri @radeksimko any chance this would get merged in, if we fix the conflicts?

@krish7919
Copy link

Is this going to be merged anytime soon?

@copumpkin
Copy link

Another vote for merging (or otherwise explaining what needs to be done) cc @bflad

@dthauvin
Copy link

dthauvin commented Aug 2, 2018

Another vote

@peay
Copy link

peay commented Sep 3, 2018

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 {
Copy link

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{}))
Copy link

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?

@marcelocorreia
Copy link

is this one parked?

@david-wells-1
Copy link
Contributor

This is a really useful addition - any progress with its release?

@david-wells-1
Copy link
Contributor

david-wells-1 commented Jan 31, 2019

@stekiri @radeksimko @bflad any chance this would get merged in?

@dmitriy-lukyanchikov
Copy link

emr instance fleet is really useful, we need it badly

@plejik
Copy link

plejik commented Feb 28, 2019

If somebody has the opportunity to fix conflict here?

@bflad
Copy link
Contributor

bflad commented Mar 5, 2019

Hi @jmsantorum 👋 Can you please have this PR only handle the aws_emr_instance_fleet resource creation for now? We would like to get that in and address the other aws_emr_cluster and aws_emr_instance_group changes separately. Thanks.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 5, 2019
@jmsantorum
Copy link
Contributor Author

Hi @bflad 👋! Give me a couple of days. I'll update the PR with only the aws_emr_instance_fleet resource creation.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Mar 20, 2019
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 20, 2019
@abhivijay89
Copy link

Any idea when this would get picked up?

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label May 13, 2019
@sanoojm
Copy link

sanoojm commented May 23, 2019

@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.

@jmsantorum
Copy link
Contributor Author

@sanoojm just added as collaborator to my repo

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 7, 2019
@aeschright aeschright requested a review from a team June 25, 2019 18:43
@bflad
Copy link
Contributor

bflad commented Jun 26, 2019

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!

@ghost
Copy link

ghost commented Nov 3, 2019

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!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/emr Issues and PRs that pertain to the emr service. size/XXL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.