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

add vertexai/featureonlinestore resource #9632

Merged

Conversation

kkram01
Copy link
Contributor

@kkram01 kkram01 commented Dec 13, 2023

This PR aims to add support to vertex AI FeatureOnlineStore resource which is recently launched. hashicorp/terraform-provider-google#16507

vertexai: added `force_destroy` field to `google_vertex_ai_feature_online_store` resource
vertexai: added `optimized`, `dedicated_serving_endpoint` and `embedding_management` fields to `google_vertex_ai_feature_online_store` resource (beta)
vertexai: changed `region` field from required to optional in `google_vertex_ai_feature_online_store` resource

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@SarahFrench, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@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, 1170 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1596 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch 5 times, most recently from 6e85896 to cdea0f5 Compare December 13, 2023 15:31
@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, 1168 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1594 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from cdea0f5 to 6588ee1 Compare December 13, 2023 16:12
@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, 1168 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1594 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from 6588ee1 to c8b1d34 Compare December 13, 2023 16:47
@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, 1168 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1594 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from c8b1d34 to e3cd9e4 Compare December 13, 2023 17:26
@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, 1168 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1594 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3296
Passed tests 2953
Skipped tests: 338
Affected tests: 5

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccSpannerDatabaseIamPolicy|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBigtableExample|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBigtable_basic|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSpannerDatabaseIamPolicy[Debug log]
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBigtableExample[Debug log]
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBigtable_basic[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample[Error message] [Debug log]
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from e3cd9e4 to c538695 Compare December 13, 2023 20:07
Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

I'm at the end of my day so can review properly tomorrow, but wanted to share how to fix the test failure affecting the Beta-only field tests:

    vcr_utils.go:152: Step 1/2 error: Error running pre-apply refresh: 
        Error: Inconsistent dependency lock file
        
        The following dependency selections recorded in the lock file are
        inconsistent with the current configuration:
          - provider registry.terraform.io/hashicorp/google: required by this configuration but no version is selected
        
        To make the initial dependency selections that will initialize the dependency
        lock file, run:
          terraform init

When testing Beta features only the google-beta provider is available for use, so all resources etc need to use it. The data sources are defaulting to looking for the GA google provider but the test framework doesn't make it available.

@SarahFrench
Copy link
Contributor

SarahFrench commented Dec 13, 2023

We had good timing then! 😄 Glad it's sorted

@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, 1172 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1602 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3296
Passed tests 2956
Skipped tests: 338
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample[Error message] [Debug log]

$\textcolor{red}{\textsf{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 ( 6 files changed, 1177 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1602 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 277 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3296
Passed tests 2958
Skipped tests: 337
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

Copy link
Contributor

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

The error shown in this message is :

  | After applying this test step, the plan was not empty.
  | stdout:
  | 
  | 
  | Terraform used the selected providers to generate the following execution
  | plan. Resource actions are indicated with the following symbols:
  |   ~ update in-place
  | 
  | Terraform will perform the following actions:
  | 
  |   # google_vertex_ai_feature_online_store.featureonlinestore will be updated in-place
  |   ~ resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
  |         id               = "projects/PROJECT_ID/locations/us-central1/featureOnlineStores/terraform36zdh3a98t0"
  |         name             = "terraform36zdh3a98t0"
  |         # (8 unchanged attributes hidden)
  | 
  |       ~ dedicated_serving_endpoint {
  |             # (1 unchanged attribute hidden)
  | 
  |           + private_service_connect_config {
  |               + enable_private_service_connect = true
  |               + project_allowlist              = [
  |                   + "1234567890",
  |                 ]
  |             }
  |         }
  | 
  |         # (2 unchanged blocks hidden)
  |     }
  | 
  | Plan: 0 to add, 1 to change, 0 to destroy.

This is because, despite the POST request to create that resource including:

 "dedicatedServingEndpoint": {
  "privateServiceConnectConfig": {
   "enablePrivateServiceConnect": true,
   "projectAllowlist": [
    "1234567890"
   ]
  }
 },

the GET request to read the resource's information (after the create operation reported that it was done) includes this instead, and information from above is missing:

  "dedicatedServingEndpoint": {
    "publicEndpointDomainName": "523084585.us-central1-1051995038222.vdb.vertexai.goog"
  },

Do you know if this is expected behaviour from the Beta API?

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from 5a9c58a to a01ceb2 Compare December 14, 2023 12:34
@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from 3da0254 to 12c4de0 Compare December 20, 2023 10:18
@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, 241 insertions(+), 269 deletions(-))
Terraform Beta: Diff ( 5 files changed, 655 insertions(+), 261 deletions(-))
TF Conversion: Diff ( 1 file changed, 125 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3312
Passed tests 2976
Skipped tests: 336
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

Some initial comments that are largely cleanup or related to the rebase. Once those are resolved, I can take another pass with more focus on the specific field additions, but I expect those are probably in a good state based on previous review and passing 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, 184 insertions(+), 211 deletions(-))
Terraform Beta: Diff ( 5 files changed, 598 insertions(+), 209 deletions(-))
TF Conversion: Diff ( 1 file changed, 131 insertions(+), 10 deletions(-))
TF OiCS: Diff ( 1 file changed, 12 insertions(+), 13 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_vertex_ai_feature_online_store (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_vertex_ai_feature_online_store" "primary" {
  force_destroy = # value needed
}

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from db7805f to 4cb830c Compare December 20, 2023 19:36
@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, 185 insertions(+), 211 deletions(-))
Terraform Beta: Diff ( 5 files changed, 600 insertions(+), 209 deletions(-))
TF Conversion: Diff ( 1 file changed, 131 insertions(+), 10 deletions(-))
TF OiCS: Diff ( 1 file changed, 12 insertions(+), 13 deletions(-))

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

A couple more small suggestions, but the main remaining question I have is how these tests will behave in our test environment. Namely, do we need to do anything special to keep these resources from accumulating, or will the test properly clean them up?

immutable: true
required: true
url_param_only: true
Copy link
Contributor

Choose a reason for hiding this comment

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

The precedence for vertexai is a bit fragmented unfortunately, with Endpoint being the primary exception to the pattern you mention. However, since most of the other resources do use url_param_only and pattern, I think it makes sense to keep them here.

However, are you sure we should remove required? What happens if a name is not specified?

mmv1/products/vertexai/FeatureOnlineStore.yaml Outdated Show resolved Hide resolved
embedding_management {
enabled = true
}
force_destroy = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably be removed, this will show up in our docs.

Follow-up question to confirm: when this config is run in our tests, I assume it will still be deleted without force_destroy because it is not using any feature views or features. Is that correct, or will there be leftover resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow

  1. Can we have force_destroy = true as set for one of the examples ? This would also mean that we'd be addressing the missing test report that is getting generated for force_destroy field and also an example of the usage of the field too.
  2. Yes, It'll still be deleted. I've run the tests manually in my test env and the resources got deleted as expected at the end of the test in both force_destroy = true and false cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, if you feel it is better to include for this example I think that makes sense, and can always be adjusted later. Thanks for checking that resources get deleted!

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3313
Passed tests 2973
Skipped tests: 336
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVertexAIFeatureOnlineStore_updated|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureOnlineStoreExample|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample|TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureOnlineStoreExample[Debug log]
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsBigtableExample[Debug log]
TestAccVertexAIFeatureOnlineStore_vertexAiFeatureonlinestoreWithBetaFieldsOptimizedExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_updated[Error message] [Debug log]

$\textcolor{red}{\textsf{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, 176 insertions(+), 203 deletions(-))
Terraform Beta: Diff ( 5 files changed, 591 insertions(+), 201 deletions(-))
TF Conversion: Diff ( 1 file changed, 131 insertions(+), 10 deletions(-))
TF OiCS: Diff ( 1 file changed, 12 insertions(+), 13 deletions(-))

@kkram01 kkram01 force-pushed the feature/vertexai_featureonlinestore branch from b9c3210 to c75e76e Compare December 20, 2023 22:07
Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

LGTM pending test results

@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, 176 insertions(+), 202 deletions(-))
Terraform Beta: Diff ( 5 files changed, 591 insertions(+), 200 deletions(-))
TF Conversion: Diff ( 1 file changed, 131 insertions(+), 10 deletions(-))
TF OiCS: Diff ( 1 file changed, 12 insertions(+), 13 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3314
Passed tests 2976
Skipped tests: 337
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVertexAIFeatureOnlineStore_updated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccVertexAIFeatureOnlineStore_updated[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@roaks3
Copy link
Contributor

roaks3 commented Dec 21, 2023

Note: updated the release notes

@roaks3 roaks3 merged commit f6b6532 into GoogleCloudPlatform:main Dec 21, 2023
14 checks passed
kapreus pushed a commit to kapreus/magic-modules that referenced this pull request Jan 2, 2024
* rebase featureonlinestore based on merged changes

* rebase based on merged featureonlinestore pr

* fix pr suggestions featureonlinestore

* fix documentation and pr comments featureonlinestore
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
* rebase featureonlinestore based on merged changes

* rebase based on merged featureonlinestore pr

* fix pr suggestions featureonlinestore

* fix documentation and pr comments featureonlinestore
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
* rebase featureonlinestore based on merged changes

* rebase based on merged featureonlinestore pr

* fix pr suggestions featureonlinestore

* fix documentation and pr comments featureonlinestore
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.

4 participants