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

Added support for google_vertex_ai_tensorboard resource #6759

Merged

Conversation

AlfatahB
Copy link
Contributor

@AlfatahB AlfatahB commented Nov 1, 2022

Added support for google_vertex_ai_tensorboard resource.
fixes hashicorp/terraform-provider-google#12711

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.
  • 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).
  • 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_vertex_ai_tensorboard`

@modular-magician
Copy link
Collaborator

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

I've detected that you're a community contributor. @melinath, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 718 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 4 files changed, 718 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2211
Passed tests 1970
Skipped tests: 239
Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccVertexAITensorboard_vertexAiTensorboardExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccVertexAITensorboard_vertexAiTensorboardExample[Debug log]

All tests passed
View the build log or the debug log for each test

@AlfatahB AlfatahB marked this pull request as ready for review November 2, 2022 06:08
@mitj04
Copy link
Contributor

mitj04 commented Nov 2, 2022

LGTM

@AlfatahB
Copy link
Contributor Author

AlfatahB commented Nov 8, 2022

@melinath Could you please review this PR?

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

This looks pretty good; however, it needs to have:

  • a "full" test that exercises as many settable fields as possible - in particular it should definitely set the encrypionSpec field, which probably means it will need to be handwritten.
  • an "update" test that exercises the update behavior; this will need to be handwritten.

I also have one question below.

mmv1/products/vertexai/terraform.yaml Outdated Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 795 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 795 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2244
Passed tests 2002
Skipped tests: 241
Failed tests: 1

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAITensorboard_Full

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode:
TestAccVertexAITensorboard_Full[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 907 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 907 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2245
Passed tests 2002
Skipped tests: 241
Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAITensorboard_Update|TestAccVertexAITensorboard_Full

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccVertexAITensorboard_Update[Debug log]

Tests failed during RECORDING mode:
TestAccVertexAITensorboard_Full[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@melinath
Copy link
Member

It looks like the "timeout" error is a misleading error; the reason there's a timeout is:

{
  "error": {
    "code": 429,
    "message": "The following quota metrics exceed quota limits: aiplatform.googleapis.com/in_use_customer_managed_encryption_keys",
    "status": "RESOURCE_EXHAUSTED"
  }
}

@melinath
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 907 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 907 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 110 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2250
Passed tests 2007
Skipped tests: 241
Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccVertexAITensorboard_Full

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccVertexAITensorboard_Full[Debug log]

All tests passed
View the build log or the debug log for each test

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

this is looking really good - I realized there's a better way to handle the kms crypto key

name = "keyring-%s"
location = "us-central1"
}
resource "google_kms_crypto_key" "example-key" {
Copy link
Member

Choose a reason for hiding this comment

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

Please switch this test to use BootstrapKMSKeyInLocation - it looks like this might even let you switch to generating the test using an example. For example:

- !ruby/object:Provider::Terraform::Examples
(I forgot this was an option previously :-) )

Using the bootstrapped crypto keys lets us limit the number of crypto keys created, which is important since they can't be deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the test to use BootstrapKMSKeyInLocation.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 921 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 921 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 232 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2267
Passed tests 2025
Skipped tests: 241
Failed tests: 1

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccVertexAITensorboard_vertexAiTensorboardFullExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccVertexAITensorboard_vertexAiTensorboardFullExample[Debug log]

All tests passed
View the build log or the debug log for each test

display_name: "terraform"
- !ruby/object:Provider::Terraform::Examples
name: "vertex_ai_tensorboard_full"
skip_import_test: true
Copy link
Member

Choose a reason for hiding this comment

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

Why do these tests use skip_import_test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because we need to use ImportStateVerifyIgnore: []string{"region", "project"} instead of ImportStateVerifyIgnore: []string{"region"}. There is a difference in the name field (projects/{project}/locations/{location}/tensorboards/{tensorboard}) of imported resources where instead of project_id we are getting project_number. Hence, I've used skip_import_test

Copy link
Member

Choose a reason for hiding this comment

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

I think that should be fine, since name is an output-only field.

You can use ignore_read_extra here & above instead of skip_import_test to just ignore the one additional field:

Suggested change
skip_import_test: true
ignore_read_extra:
- project

If the API returns project numbers - will users get a permadiff if they try to set the project field using a project id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, User won't face state drift if the project field is set to project id. It's just that import is forming the name field using the replaceVars function which takes the project_id and this gets changed when the resource is successfully imported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated examples to include ignore_read_extra for the tests.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 933 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 933 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 122 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 232 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2270
Passed tests 2025
Skipped tests: 241
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeForwardingRule_update|TestAccVertexAITensorboard_vertexAiTensorboardExample|TestAccVertexAITensorboard_vertexAiTensorboardFullExample|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputeForwardingRule_update[Debug log]
TestAccVertexAITensorboard_vertexAiTensorboardExample[Debug log]
TestAccVertexAITensorboard_vertexAiTensorboardFullExample[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]

All tests passed
View the build log or the debug log for each test

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

LGTM

@melinath melinath merged commit 67c3250 into GoogleCloudPlatform:main Nov 17, 2022
googlerjk pushed a commit to googlerjk/magic-modules that referenced this pull request Nov 22, 2022
…latform#6759)

* Added support for  google_vertex_ai_tensorboard resource

* Added full test case for google_vertex_ai_tensorboard resource

* Added import support for google_vertex_ai_tensorboard

* Added Full and Update test cases for google_vertex_ai_tensorboard

* Updated the full test of google_vertex_ai_tensorboard

* Updated examples to include import test for vertex_ai_tensorboard
googlerjk pushed a commit to googlerjk/magic-modules that referenced this pull request Nov 25, 2022
…latform#6759)

* Added support for  google_vertex_ai_tensorboard resource

* Added full test case for google_vertex_ai_tensorboard resource

* Added import support for google_vertex_ai_tensorboard

* Added Full and Update test cases for google_vertex_ai_tensorboard

* Updated the full test of google_vertex_ai_tensorboard

* Updated examples to include import test for vertex_ai_tensorboard
kimihrr pushed a commit to kimihrr/kimiah-magic-modules that referenced this pull request Dec 6, 2022
…latform#6759)

* Added support for  google_vertex_ai_tensorboard resource

* Added full test case for google_vertex_ai_tensorboard resource

* Added import support for google_vertex_ai_tensorboard

* Added Full and Update test cases for google_vertex_ai_tensorboard

* Updated the full test of google_vertex_ai_tensorboard

* Updated examples to include import test for vertex_ai_tensorboard
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Dec 6, 2022
…latform#6759)

* Added support for  google_vertex_ai_tensorboard resource

* Added full test case for google_vertex_ai_tensorboard resource

* Added import support for google_vertex_ai_tensorboard

* Added Full and Update test cases for google_vertex_ai_tensorboard

* Updated the full test of google_vertex_ai_tensorboard

* Updated examples to include import test for vertex_ai_tensorboard
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.

Add a terraform resource to set up a managed Tensorboard instance
4 participants