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

Updated optional component List to possible values #5136

Merged
merged 4 commits into from
Sep 17, 2021

Conversation

sehgalnamit
Copy link
Contributor

@sehgalnamit sehgalnamit commented Aug 25, 2021

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
    -[X] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
    -[X] Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

@google-cla google-cla bot added the cla: yes label Aug 25, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@c2thorn, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 2 files changed, 5 insertions(+), 4 deletions(-))

@sehgalnamit
Copy link
Contributor Author

@c2thorn
Many Thanks for getting this request reviewed.
May I know what this check failure is and any actions I need to do ?

TerraformVCRCommunity

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

Hi @sehgalnamit, just so we're on the same page, the logic you are updating only affects tests correct?
The schema for the actual resource appears in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/third_party/terraform/resources/resource_dataproc_cluster.go.erb#L542

@sehgalnamit
Copy link
Contributor Author

@c2thorn
I already checked that code you have pointed already has the FLINK component and it does not work when we use terraform resource with optional component FLINK.
There is also a feature request raised for this 1173452908414427

This is my actual issue
hashicorp/terraform-provider-google#9766

I was guided to use different codes and also I got another update with below:-

#5129

Possibly https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/third_party/terraform/tests/resource_dataproc_cluster_test.go.erb

Thanks

@sehgalnamit
Copy link
Contributor Author

@c2thorn Can you please advise on this?
I am not sure where do I need to commit to make this change work?

Thanks

@c2thorn
Copy link
Member

c2thorn commented Sep 2, 2021

@sehgalnamit
Ah I think I see what's going on here. regarding #5129 (review), they were stating that you'll want to make changes in all 3 of those files in the same pull request. You've done 1/3 here by changing the test file

@sehgalnamit
Copy link
Contributor Author

@c2thorn
Many Thanks for your reply, it is great that you guys reply on community so fast.
If you see all those 3 files, we already have the FLINK component added and the only file which was missing, I added it there.

My goal is to get FLINK component added in the provider:-
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataproc_cluster

optional_components -

@c2thorn
Copy link
Member

c2thorn commented Sep 7, 2021

@sehgalnamit I see, that makes sense. I still do not see FLINK added as an option to the documentation: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/third_party/terraform/website/docs/r/dataproc_cluster.html.markdown?plain=1#L487

We could add that in this PR?

@sehgalnamit
Copy link
Contributor Author

@c2thorn
Yes, please

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 3 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 4 insertions(+), 3 deletions(-))

@c2thorn
Copy link
Member

c2thorn commented Sep 8, 2021

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 3 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 4 insertions(+), 3 deletions(-))

@modular-magician

This comment has been minimized.

@c2thorn
Copy link
Member

c2thorn commented Sep 8, 2021

Hi @sehgalnamit
Running the tests and then looking at it manually, there are a few further issues.

ANACONDA, KERBEROS, and RANGER optional components all seem to have additional requirements needed to be valid values, and cause the API to return a 400 error.

Even after removing these, the test check to verify optional components list does not do an un-ordered comparison:

if !reflect.DeepEqual(components, cluster.Config.SoftwareConfig.OptionalComponents) {

If the list is given in any order not specified in

testAccCheckDataprocClusterHasOptionalComponents(&cluster, "ZOOKEEPER", "DOCKER", "ANACONDA", "DRUID", "HBASE", "FLINK", "SOLR", "ZEPPELIN", "HIVE_WEBHCAT", "JUPYTER", "KERBEROS", "PRESTO", "RANGER"),
, it will fail the test.

Given these issues, I don't think it is worth actually testing every possible value for optional components. It isn't something we do for other fields, and given the number of possible values it should be fine to just test DOCKER and ZOOKEEPER (the original values in the test). What do you think? If you agree, we can just keep the HTML change, revert the test changes, and merge the PR.

@sehgalnamit
Copy link
Contributor Author

@c2thorn
Really appreciate your help on this case.
I am fine to have HTML changes but is it possible for you to test atleast FLINK as component as when I use the provider in my environment, it does not work.

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dataproc_cluster

terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "3.82.0"
}
}
}

provider "google" {

Configuration options

}

It could be Google API issue with Flink which I can go to Google Product team and ask. If you get similar issue for FLINK as an optional component not working while spinning of dataproc using this provider, I do not think it is worth to update HTML.
There is a feature request I have raised with heshicorp but I think they also depend on open source community.

My original issue
hashicorp/terraform-provider-google#9766

@c2thorn
Copy link
Member

c2thorn commented Sep 9, 2021

Hi @sehgalnamit, this makes sense I agree with at least adding FLINK to one of the tested values.

Trying it out myself very quickly, I see success. If you are having problems, can you post your config and Debug log?

@sehgalnamit
Copy link
Contributor Author

@c2thorn
Thanks for your reply.
I managed to add FLINK as addental component
dataproc_clusters = {
"welltuned" : {
software_config_optional_components = ["ZOOKEEPER", "JUPYTER", "FLINK"]
}
}


So you can just update HTML for the PR.

I found further issues with though:-

  1. If you get time, please have a look at this
    https://github.com/GoogleCloudDataproc/initialization-actions/tree/master/flink

NOTE: The Flink initialization action has been deprecated. Please use the Flink Component
Even though we have an option to add FLINK as additional component, we do not have a way to start the FLINK session, something we have in gcloud command

flink-start-yarn-session=true
https://cloud.google.com/dataproc/docs/concepts/components/flink

  1. If we rerun the code,
    IP of the nodes and master will not preserved

Meaning I get new IPs even though in my plan, I see no change in the resource.

@c2thorn
Copy link
Member

c2thorn commented Sep 14, 2021

So you can just update HTML for the PR.

Do you mind reverting the change to the test file in this PR, then I'll merge

Even though we have an option to add FLINK as additional component, we do not have a way to start the FLINK session, something we have in gcloud command

flink-start-yarn-session=true
cloud.google.com/dataproc/docs/concepts/components/flink

We are limited by the API in what we can do, and there is not always parity with gcloud. I cannot find anything here: https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters

Meaning I get new IPs even though in my plan, I see no change in the resource.

Is this a current bug in the resource? It may be appropriate to open a new issue with the steps involved so we can solve it. I believe this is falling out of the scope of this PR.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 1 insertion(+))
Terraform Beta: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))

@sehgalnamit
Copy link
Contributor Author

@c2thorn
I have raised an issue for the IPs issue
hashicorp/terraform-provider-google#10074

Also, I have raised a Case with Google for REST API issue

Updated my current PR.

@c2thorn
Copy link
Member

c2thorn commented Sep 15, 2021

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 1 insertion(+))
Terraform Beta: Diff ( 1 file changed, 1 insertion(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccComputeForwardingRule_internalHttpLbWithMigBackendExample|TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample|TestAccComputeForwardingRule_forwardingRuleExternallbExample|TestAccComputeForwardingRule_forwardingRuleGlobalInternallbExample|TestAccComputeForwardingRule_forwardingRuleL3DefaultExample|TestAccComputeForwardingRule_forwardingRuleInternallbExample|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccComputePacketMirroring_computePacketMirroringFullExample|TestAccComputeRoute_routeIlbExample|TestAccComputeServiceAttachment_serviceAttachmentBasicExample|TestAccComputeServiceAttachment_serviceAttachmentExplicitProjectsExample You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=205931

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccComputeServiceAttachment_serviceAttachmentBasicExample Please fix these to complete your PR

@sehgalnamit
Copy link
Contributor Author

@c2thorn

You can merge the HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants