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

vertex_ai: add google_vertex_ai_index_endpoint_deployed_index resource #11039

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Jun 25, 2024

Resolves hashicorp/terraform-provider-google#12818

Checklist:

  • YAML completion
    • successful provider generation and build
  • manual testing of crud functions
    • Create
    • Read - WIP
    • Update
    • Delete
  • *_test.go.erb files added

Release Note Template for Downstream PRs (will be copied)

`google_vertex_ai_index_endpoint_deployed_index`

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

google provider: Diff ( 4 files changed, 1616 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 1616 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 345 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_index_endpoint_deployed_index" "primary" {
  automatic_resources {
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  dedicated_resources {
    autoscaling_metric_specs {
      metric_name = # value needed
      target      = # value needed
    }
    machine_spec {
      accelerator_count = # value needed
      accelerator_type  = # value needed
      machine_type      = # value needed
      tpu_topology      = # value needed
    }
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  display_name          = # value needed
  enable_access_logging = # value needed
  index                 = # value needed
  region                = # value needed
  reserved_ip_ranges    = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 46
Passed tests: 46
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • vertexai

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@BBBmau
Copy link
Collaborator Author

BBBmau commented Jun 28, 2024

currently it's able to send a request to GCP but returns a 404. This is due to the request wanting an index, which is then used as the indexEndpoint. An index can exist but that same index cannot exist as an endpoint. Resulting in this error:

2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: POST /v1/projects/hc-terraform-testing/locations/us-central1/indexEndpoints/3623695656033452032:deployIndex?alt=json HTTP/1.1
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Host: us-central1-aiplatform.googleapis.com
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: User-Agent: Terraform/1.8.0-alpha20240131 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google/dev
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Content-Length: 136
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Content-Type: application/json
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Accept-Encoding: gzip
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: {
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:  "deployedIndex": {
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:   "id": "test_index_public1",
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:   "index": "projects/hc-terraform-testing/locations/us-central1/indexes/3623695656033452032"
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:  }
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: }
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64
2024-06-27T16:54:14.486-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: -----------------------------------------------------
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: 2024/06/27 16:54:15 [DEBUG] Google API Response Details:
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: ---[ RESPONSE ]--------------------------------------
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: HTTP/2.0 404 Not Found
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Cache-Control: private
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Content-Type: application/json; charset=UTF-8
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Date: Thu, 27 Jun 2024 23:54:14 GMT
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Server: ESF
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Vary: Origin
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Vary: X-Origin
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: Vary: Referer
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: X-Content-Type-Options: nosniff
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: X-Frame-Options: SAMEORIGIN
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: X-Xss-Protection: 0
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: {
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:   "error": {
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:     "code": 404,
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:     "message": "IndexEndpoint `projects/hc-terraform-testing/locations/us-central1/indexEndpoints/3623695656033452032` is not found.",
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:     "status": "NOT_FOUND"
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64:   }
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: }
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64
2024-06-27T16:54:15.052-0700 [DEBUG] provider.terraform-provider-google_9.9.9_darwin_arm64: 

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

google provider: Diff ( 3 files changed, 1595 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 1595 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 367 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_index_endpoint_deployed_index" "primary" {
  automatic_resources {
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  dedicated_resources {
    autoscaling_metric_specs {
      metric_name = # value needed
      target      = # value needed
    }
    machine_spec {
      accelerator_count = # value needed
      accelerator_type  = # value needed
      machine_type      = # value needed
      tpu_topology      = # value needed
    }
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  display_name          = # value needed
  enable_access_logging = # value needed
  index                 = # value needed
  name                  = # value needed
  region                = # value needed
  reserved_ip_ranges    = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 46
Passed tests: 46
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • vertexai

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@BBBmau
Copy link
Collaborator Author

BBBmau commented Jun 28, 2024

latest commit supports interaction with GCP through after some url fixes.
image

seems like there's some issues in regards to index deployment. I don't think it should be taking this long for deploying an index on an endpoint. After looking at the docs. the initial deployment will take 20-30 minutes:

Important: Initial deployment of an index to an endpoint typically takes between 20 and 30 minutes. A maximum of 20 indexes can be deployed on a single endpoint.

Reference: https://cloud.google.com/vertex-ai/docs/vector-search/deploy-index-public#deploy-index

latest commit produced a successful deployment 🥳

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

google provider: Diff ( 3 files changed, 1633 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 3 files changed, 1633 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 378 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_index_endpoint_deployed_index" "primary" {
  automatic_resources {
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  dedicated_resources {
    autoscaling_metric_specs {
      metric_name = # value needed
      target      = # value needed
    }
    machine_spec {
      accelerator_count = # value needed
      accelerator_type  = # value needed
      machine_type      = # value needed
      tpu_topology      = # value needed
    }
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  display_name          = # value needed
  enable_access_logging = # value needed
  index                 = # value needed
  index_endpoint        = # value needed
  name                  = # value needed
  region                = # value needed
  reserved_ip_ranges    = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 46
Passed tests: 46
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • vertexai

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@BBBmau
Copy link
Collaborator Author

BBBmau commented Jun 28, 2024

recent commit was getting Read method to work which includes how users will import already existing deployedIndexes into terraform. The method of creating deployed index resources in terraform is a bit tricky since the url path is the same as the index endpoint with the only difference being :deployIndex

The import path may fall along the lines of projects/hc-terraform-testing/locations/us-central1/indexEndpoints/7127777641104408576/deployedIndex/test_index_public1

image

Some changes were also necessary in order to make the import work such as replacing name with deploy_index_id. The name will be a resource reference to the indexEndpoint being used.

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

google provider: Diff ( 4 files changed, 1753 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 1753 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 364 insertions(+))

Missing test report

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

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

resource "google_vertex_ai_index_endpoint_deployed_index" "primary" {
  automatic_resources {
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  dedicated_resources {
    autoscaling_metric_specs {
      metric_name = # value needed
      target      = # value needed
    }
    machine_spec {
      accelerator_count = # value needed
      accelerator_type  = # value needed
      machine_type      = # value needed
      tpu_topology      = # value needed
    }
    max_replica_count = # value needed
    min_replica_count = # value needed
  }
  deployed_index_id     = # value needed
  display_name          = # value needed
  enable_access_logging = # value needed
  index                 = # value needed
  index_endpoint        = # value needed
  region                = # value needed
  reserved_ip_ranges    = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 46
Passed tests: 46
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • vertexai

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

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