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

feat(vertexai): add google_vertex_ai_index for Vertex AI Matching Engine #6728

Merged
merged 20 commits into from Nov 28, 2022

Conversation

shotarok
Copy link
Contributor

@shotarok shotarok commented Oct 21, 2022

Part of hashicorp/terraform-provider-google#12818
Part of hashicorp/terraform-provider-google#9298

Add google_vertex_ai_index to create an index for Vertex AI Matching Engine.

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_index

@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 ( 5 files changed, 1447 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1447 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 277 insertions(+), 3 deletions(-))

@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, 1447 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1447 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 277 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2201
Passed tests 1960
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
TestAccVertexAIIndex_vertexAiIndexExample|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]

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

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

@shotarok
Copy link
Contributor Author

shotarok commented Oct 21, 2022

A local unit test run failed due to ~ name = "1299552375287054336" -> "terraformn00mrw8m9i" # forces replacement. I guess VCR-test also fails due to the same error. I'd appreciate it if I could know when VCR-test failed because of another error. I'll check how to manage index_id and name in a good manner.

logs
2022-10-20T23:30:42.955-0700 [ERROR] sdk.helper_resource: Unexpected error: test_name=TestAccVertexAIIndex_vertexAiIndexExample test_step_number=1 test_terraform_path=/opt/homebrew/bin/terraform test_working_directory=/var/folders/kd/2mm1sqn16s96zq819f1504r80000gp/T/plugintest2392748359
  error=
  | 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:
  | -/+ destroy and then create replacement
  |
  | Terraform will perform the following actions:
  |
  |   # google_vertex_ai_index.index must be replaced
  | -/+ resource "google_vertex_ai_index" "index" {
  |       ~ create_time         = "2022-10-21T05:39:21.900880Z" -> (known after apply)
  |       ~ deployed_indexes    = [] -> (known after apply)
  |       ~ etag                = "AMEw9yPr9AaH6zIFf4fVKHE4-pdjDx1kYROQsHq3C-D4E22idlSiDQS0213sOLP9TwWb" -> (known after apply)
  |       ~ id                  = "projects/kouzoh-p-kohama/locations/us-central1/indexes/1299552375287054336" -> (known after apply)
  |       ~ metadata_schema_uri = "gs://google-cloud-aiplatform/schema/matchingengine/metadata/nearest_neighbor_search_1.0.0.yaml" -> (known after apply)
  |       ~ name                = "1299552375287054336" -> "terraformn00mrw8m9i" # forces replacement
  |       ~ project             = "kouzoh-p-kohama" -> (known after apply)
  |       ~ update_time         = "2022-10-21T06:20:16.414646Z" -> (known after apply)
  |         # (4 unchanged attributes hidden)
  |
  |       ~ metadata {
  |           + contents_delta_uri    = "gs://kouzoh-p-kohama-tf-test-vertex-ai-index-testn00mrw8m9i/contents"
  |             # (1 unchanged attribute hidden)
  |
  |           ~ config {
  |                 # (4 unchanged attributes hidden)
  |
  |               ~ algorithm_config {
  |                     # (1 unchanged block hidden)
  |                 }
  |             }
  |         }
  |     }
  |
  | Plan: 1 to add, 0 to change, 1 to destroy.

    provider_test.go:315: Step 1/2 error: After applying this test step, the plan was not empty

@shotarok
Copy link
Contributor Author

Hello @melinath, I could fix the above error, but I faced another error like below. I'm not sure why only contents_delta_uri was not stored in the terraform state. I'd appreciate it if I could get some advice on that if you've seen a similar error before. Thank you.

2022-10-21T20:00:55.405-0700 [ERROR] sdk.helper_resource: Unexpected error: test_name=TestAccVertexAIIndex_vertexAiIndexExample test_step_number=1 test_terraform_path=/opt/homebrew/bin/terraform test_working_directory=/var/folders/kd/2mm1sqn16s96zq819f1504r80000gp/T/plugintest3149284593
  error=
  | 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:
  | -/+ destroy and then create replacement
  |
  | Terraform will perform the following actions:
  |
  |   # google_vertex_ai_index.index must be replaced
  | -/+ resource "google_vertex_ai_index" "index" {
  |       ~ create_time         = "2022-10-22T02:22:21.037842Z" -> (known after apply)
  |       ~ deployed_indexes    = [] -> (known after apply)
  |       ~ etag                = "AMEw9yPzsv8NH0FArDXXpRqdJAZHhUuWGXuz81l_3_7q1BDfKh0lLHoQS45HmiwKoknu" -> (known after apply)
  |       ~ id                  = "projects/kouzoh-p-kohama/locations/us-central1/indexes/1063676344803524608" -> (known after apply)
  |       ~ metadata_schema_uri = "gs://google-cloud-aiplatform/schema/matchingengine/metadata/nearest_neighbor_search_1.0.0.yaml" -> (known after apply)
  |       ~ name                = "1063676344803524608" -> (known after apply)
  |       ~ project             = "kouzoh-p-kohama" -> (known after apply)
  |       ~ update_time         = "2022-10-22T03:00:45.812169Z" -> (known after apply)
  |         # (4 unchanged attributes hidden)
  |
  |       ~ metadata {
  |           + contents_delta_uri    = "gs://kouzoh-p-kohama-tf-test-vertex-ai-index-testfp0bnw3p68/contents" # forces replacement
  |             # (1 unchanged attribute hidden)
  |
  |           ~ config {
  |                 # (4 unchanged attributes hidden)
  |
  |               ~ algorithm_config {
  |                     # (1 unchanged block hidden)
  |                 }
  |             }
  |         }
  |     }
  |
  | Plan: 1 to add, 0 to change, 1 to destroy.

    provider_test.go:307: Step 1/2 error: After applying this test step, the plan was not empty.

@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, 1434 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1434 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 267 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2204
Passed tests 1964
Skipped tests: 239
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
TestAccVertexAIIndex_vertexAiIndexExample

@modular-magician
Copy link
Collaborator

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

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

@shotarok
Copy link
Contributor Author

shotarok commented Oct 22, 2022

It turns out projects.locations.endpoints.get doesn't respond metadata.contents_delta_uri as of now. I confirmed the other index also didn't return content_delta_uri in another project. So I think it's not a project-specific problem. I'll use ignore_read: true for now.

---[ REQUEST ]---------------------------------------
GET /v1/projects/kouzoh-p-kohama/locations/us-central1/indexes/1063676344803524608?alt=json HTTP/1.1
Host: us-central1-aiplatform.googleapis.com
User-Agent: Terraform/1.1.7 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2022/10/21 20:00:50 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Sat, 22 Oct 2022 03:00:50 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "name": "projects/415528280434/locations/us-central1/indexes/1063676344803524608",
  "displayName": "tf-test-test-indexfp0bnw3p68",
  "description": "index for test",
  "metadataSchemaUri": "gs://google-cloud-aiplatform/schema/matchingengine/metadata/nearest_neighbor_search_1.0.0.yaml",
  "metadata": {
    "config": {
      "dimensions": 2,
      "approximateNeighborsCount": 150,
      "distanceMeasureType": "DOT_PRODUCT_DISTANCE",
      "featureNormType": "NONE",
      "algorithmConfig": {
        "treeAhConfig": {
          "leafNodeEmbeddingCount": "500",
          "leafNodesToSearchPercent": 7
        }
      },
      "shardSize": "SHARD_SIZE_MEDIUM"
    }
  },
  "etag": "AMEw9yPzsv8NH0FArDXXpRqdJAZHhUuWGXuz81l_3_7q1BDfKh0lLHoQS45HmiwKoknu",
  "labels": {
    "foo": "bar"
  },
  "createTime": "2022-10-22T02:22:21.037842Z",
  "updateTime": "2022-10-22T03:00:45.812169Z",
  "indexStats": {
    "vectorsCount": "2",
    "shardsCount": 1
  },
  "indexUpdateMethod": "BATCH_UPDATE"
}

-----------------------------------------------------

@shotarok
Copy link
Contributor Author

I wanted to use ignore_read: true for metadata.contentsDeltaUri, but it seems ignore_read doesn't work for a nested field yet. I'll take the same strategy as #4304.

@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, 1435 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1435 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 267 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2204
Passed tests 1963
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|TestAccVertexAIIndex_vertexAiIndexExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]

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

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

@shotarok
Copy link
Contributor Author

shotarok commented Oct 23, 2022

Hi @melinath, could you help me see the error messages in the VCR tests?

The custom_flatten function fixed the drift regarding metadata.contents_delta_uri. On my local test, it seems the CRUD operations of google_vertex_ai_index succeeded but the test result was a failure without any error-level logs. The only suspicious point was that the cloud storage API returned 204 No Content. I'm wondering if the response codes were related to the failure status. Thank you.

@shotarok shotarok changed the title feat: add google_vertex_ai_index for Vertex AI Matching Engine feat(vertexai): add google_vertex_ai_index for Vertex AI Matching Engine Oct 23, 2022
@melinath
Copy link
Member

Error is:

  provider_test.go:315: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) (len=2) {
         (string) (len=4) "etag": (string) (len=68) "AMEw9yNLBBuycPQG718bpuTz_IRjs7EmDTrhXZt6-lDRfdVTYtjNnNLdf08TMc0W-iqA",
         (string) (len=29) "metadata.0.contents_delta_uri": (string) ""
        }
        
        
        (map[string]string) (len=2) {
         (string) (len=4) "etag": (string) (len=68) "AMEw9yPoiLgJ3R1ndLU_avz859dbsER3krtMK_hMXMvYltdEQqBgfK7WPKUzpHM8Q8Q5",
         (string) (len=29) "metadata.0.contents_delta_uri": (string) (len=75) "gs://project-id-tf-test-vertex-ai-index-testjuc17g6te2/contents"

@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, 1535 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1535 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 267 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2209
Passed tests 1968
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
TestAccVertexAIIndex_basic|TestAccVertexAIIndex_vertexAiIndexExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccVertexAIIndex_basic[Debug log]
TestAccVertexAIIndex_vertexAiIndexExample[Debug log]

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

@shotarok
Copy link
Contributor Author

shotarok commented Oct 25, 2022

@melinath Thank you for your comment. I figured out what made it a failure.

Because projects.locations.endpoints.get doesn't respond metadata.contents_delta_uri, I added two tests. One is auto-generated, but it doesn't check import. Another one is a hand-written test because I wanted to put metadata.0.contents_delta_uri in ImportStateVerifyIgnore.

All tests passed. Could you please review this PR when you have time? Thanks

@shotarok shotarok marked this pull request as ready for review October 25, 2022 20:52
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.

great, it looks like the test is now passing after ~40 minutes (which is the time it takes to create the resource) so that means the patch is probably basically instant if you just change the description. It sounds like you're already planning to take a look at whether the nested fields already work 💯

@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, 1895 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1895 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 288 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2280
Passed tests 2025
Skipped tests: 244
Failed tests: 11

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample|TestAccComputeForwardingRule_forwardingRuleRegionalHttpXlbExample|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccComputeGlobalForwardingRule_externalHttpLbMigBackendCustomHeaderExample|TestAccComputeGlobalForwardingRule_externalTcpProxyLbMigBackendExample|TestAccComputeForwardingRule_internalHttpLbWithMigBackendExample|TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccLoggingBucketConfigProject_cmekSettings|TestAccVertexAIIndex_updated

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample[Debug log]
TestAccComputeForwardingRule_forwardingRuleRegionalHttpXlbExample[Debug log]
TestAccComputeForwardingRule_forwardingRuleHttpLbExample[Debug log]
TestAccComputeGlobalForwardingRule_externalHttpLbMigBackendCustomHeaderExample[Debug log]
TestAccComputeGlobalForwardingRule_externalTcpProxyLbMigBackendExample[Debug log]
TestAccComputeForwardingRule_internalHttpLbWithMigBackendExample[Debug log]
TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample[Debug log]
TestAccComputeGlobalForwardingRule_internalLoadBalancing[Debug log]
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]

Tests failed during RECORDING mode:
TestAccVertexAIIndex_updated[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 ( 6 files changed, 1896 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1896 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 288 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2284
Passed tests 2037
Skipped tests: 244
Failed tests: 3

Action taken

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

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccLoggingBucketConfigProject_cmekSettings[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccVertexAIIndex_updated[Debug log]

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

@shotarok
Copy link
Contributor Author

@melinath OK, all tests passed again. Could you please review the updates when you have time? Happy holidays 🦃

@melinath
Copy link
Member

@melinath
Copy link
Member

LGTM assuming the manual test run passes; I'll let you know if there are any issues.

@melinath melinath merged commit 5dd9723 into GoogleCloudPlatform:main Nov 28, 2022
@shotarok shotarok deleted the vertex-ai-index branch November 28, 2022 23:46
@melinath
Copy link
Member

Approved & merged, thanks!

@shotarok
Copy link
Contributor Author

Thank you for reviewing this PR! I learned a lot from your concise advice!

5fff pushed a commit to 5fff/magic-modules that referenced this pull request Dec 5, 2022
…ine (GoogleCloudPlatform#6728)

* feat: add google_vertex_ai_index for Vertex AI Matching Engine

* fix: increase timeouts to 60 min because 20 wasn't enough for creation

* fix: change coe to make name computed instead of an input

* fix: use costom flatten code to ignore_read a nested property's field

* fix: add skip_import_test: true to the auto-gen test

* feat: add a test with a manually updated ImportStateVerifyIgnore

* Apply suggestions from code review [ci skip]

Update descriptions based on the suggestions

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* refactor: use ignore_read_extra instead of a manual test

* fix: use an empty object for bruteForceConfig

* feat: define additional fields to api.yaml

* feat: add an example to increase test coverage

* feat: deal with contentsDeltaUri as an updatable field

* fix: fix the error because the cosine distance type only supports unit l2 norm type

This is the error message from the endpoint:
"Index with `COSINE_DISTANCE` distanceMeasureType currently only supports `UNIT_L2_NORM` featureNormType."

* feat: remove approximate_neighbors_count from an example with brute_force_config

approximate_neighbors_count is required if tree-AH algorithm is used.
from https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#brute-force-config

* test: add a handwritten test for patch

* fix: add update_mask: true to use the mask as a url param

* refactor: put 'input: true' on the fields patch couldn't update

* feat: use custom pre update code for a nested object

* fix: update the handwritten test accordingly

* feat: add custom flatten code for is_complete_overwrite

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
kimihrr pushed a commit to kimihrr/kimiah-magic-modules that referenced this pull request Dec 6, 2022
…ine (GoogleCloudPlatform#6728)

* feat: add google_vertex_ai_index for Vertex AI Matching Engine

* fix: increase timeouts to 60 min because 20 wasn't enough for creation

* fix: change coe to make name computed instead of an input

* fix: use costom flatten code to ignore_read a nested property's field

* fix: add skip_import_test: true to the auto-gen test

* feat: add a test with a manually updated ImportStateVerifyIgnore

* Apply suggestions from code review [ci skip]

Update descriptions based on the suggestions

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* refactor: use ignore_read_extra instead of a manual test

* fix: use an empty object for bruteForceConfig

* feat: define additional fields to api.yaml

* feat: add an example to increase test coverage

* feat: deal with contentsDeltaUri as an updatable field

* fix: fix the error because the cosine distance type only supports unit l2 norm type

This is the error message from the endpoint:
"Index with `COSINE_DISTANCE` distanceMeasureType currently only supports `UNIT_L2_NORM` featureNormType."

* feat: remove approximate_neighbors_count from an example with brute_force_config

approximate_neighbors_count is required if tree-AH algorithm is used.
from https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#brute-force-config

* test: add a handwritten test for patch

* fix: add update_mask: true to use the mask as a url param

* refactor: put 'input: true' on the fields patch couldn't update

* feat: use custom pre update code for a nested object

* fix: update the handwritten test accordingly

* feat: add custom flatten code for is_complete_overwrite

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Dec 6, 2022
…ine (GoogleCloudPlatform#6728)

* feat: add google_vertex_ai_index for Vertex AI Matching Engine

* fix: increase timeouts to 60 min because 20 wasn't enough for creation

* fix: change coe to make name computed instead of an input

* fix: use costom flatten code to ignore_read a nested property's field

* fix: add skip_import_test: true to the auto-gen test

* feat: add a test with a manually updated ImportStateVerifyIgnore

* Apply suggestions from code review [ci skip]

Update descriptions based on the suggestions

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* refactor: use ignore_read_extra instead of a manual test

* fix: use an empty object for bruteForceConfig

* feat: define additional fields to api.yaml

* feat: add an example to increase test coverage

* feat: deal with contentsDeltaUri as an updatable field

* fix: fix the error because the cosine distance type only supports unit l2 norm type

This is the error message from the endpoint:
"Index with `COSINE_DISTANCE` distanceMeasureType currently only supports `UNIT_L2_NORM` featureNormType."

* feat: remove approximate_neighbors_count from an example with brute_force_config

approximate_neighbors_count is required if tree-AH algorithm is used.
from https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#brute-force-config

* test: add a handwritten test for patch

* fix: add update_mask: true to use the mask as a url param

* refactor: put 'input: true' on the fields patch couldn't update

* feat: use custom pre update code for a nested object

* fix: update the handwritten test accordingly

* feat: add custom flatten code for is_complete_overwrite

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants