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 Vertex AI Featurestores #4906

Merged
merged 8 commits into from
Jul 9, 2021

Conversation

upodroid
Copy link
Contributor

Fixes: hashicorp/terraform-provider-google#9264
Part of: hashicorp/terraform-provider-google#9298

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_featurestore`
`google_vertex_ai_featurestore_entitytype`

Co-authored-by: upodroid <[email protected]>
@google-cla google-cla bot added the cla: yes label Jun 22, 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.

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

@upodroid
Copy link
Contributor Author

Is there an easy way of inferring project and region from a self_link style field such as featurestore?

Instead of

resource "google_vertex_ai_featurestore_entitytype" "featurestore" {
  provider = google-beta
  region = "us-central1"
  project = "foo"
  name     = "terraform%{random_suffix}"
  labels = {
    foo = "bar"
  }
  featurestore = "foobar"
  monitoring_config {
    snapshot_analysis {
      disabled = false
      monitoring_interval = "86400s"
    }
  }
}

it becomes

resource "google_vertex_ai_featurestore_entitytype" "featurestore" {
  provider = google-beta
  name     = "terraform%{random_suffix}"
  labels = {
    foo = "bar"
  }
  featurestore = "projects/{{project}}/locations/{{region}}/featurestores/{{featurestore}}/entityTypes/{{name}}"
  monitoring_config {
    snapshot_analysis {
      disabled = false
      monitoring_interval = "86400s"
    }
  }
}

If this was handwritten, it would be easy to do but this requires resource.erb modifications and my last major change to it didn't go so well.

@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 ( 5 files changed, 311 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 11 files changed, 1470 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 8 files changed, 239 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=193198"

@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 ( 5 files changed, 311 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 10 files changed, 1469 insertions(+), 6 deletions(-))
TF OiCS: Diff ( 8 files changed, 239 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=193198"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample|TestAccVertexAIFeaturestore_vertexAiFeaturestoreExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=193209"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccVertexAIFeaturestoreEntitytype_vertexAiFeaturestoreEntitytypeExample|TestAccVertexAIFeaturestore_vertexAiFeaturestoreExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=193210"

@melinath melinath requested review from a team, melinath and c2thorn and removed request for melinath and a team June 23, 2021 23:28
@c2thorn
Copy link
Member

c2thorn commented Jun 28, 2021

Is there an easy way of inferring project and region from a self_link style field such as featurestore?

You should be able to do so by adding an encoder override which does the logic. See resourcePubsubLiteSubscriptionEncoder derived from https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/products/pubsublite/terraform.yaml#L30

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.

Looks good as it is now. I'll wait for your response on whether or not you want to add the encoder before merging. Otherwise, I'll merge tomorrow.

@upodroid
Copy link
Contributor Author

upodroid commented Jul 1, 2021

This is ready to be merged now.

Came across this while cleaning up Featurestores, which is fixed in the last commit:

 REDACTED  MCW0CDP3YY  ~  $  http DELETE https://us-central1-aiplatform.googleapis.com/v1beta1/projects/REDACTED/locations/us-central1/featurestores/terraformxl34nkqltq "Authorization: Bearer $(gcloud auth print-access-token)"
HTTP/1.1 400 Bad Request
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":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-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Date: Thu, 01 Jul 2021 21:32:03 GMT
Server: ESF
Transfer-Encoding: chunked
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0

{
    "error": {
        "code": 400,
        "message": "There are entity types in the featurestore. Please delete the child entity types or set `force` in the request to explicitly cascade delete.",
        "status": "FAILED_PRECONDITION"
    }
}

@c2thorn
Copy link
Member

c2thorn commented Jul 1, 2021

Came across this while cleaning up Featurestores, which is fixed in the last commit:

I see, so you added force_destroy as a virtual field. Makes sense.

mmv1/api/async.rb Outdated Show resolved Hide resolved
@upodroid
Copy link
Contributor Author

upodroid commented Jul 5, 2021

Not sure what is wrong with generate-diffs but i'm able to generate the beta provider locally.

@c2thorn
Copy link
Member

c2thorn commented Jul 8, 2021

@upodroid I believe it just needs to be rebased

@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 ( 5 files changed, 299 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 11 files changed, 1469 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 8 files changed, 239 insertions(+))

@c2thorn
Copy link
Member

c2thorn commented Jul 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 ( 5 files changed, 299 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 10 files changed, 1467 insertions(+), 6 deletions(-))
TF OiCS: Diff ( 8 files changed, 239 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccContainerNodePool_withGPU You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=195677

@modular-magician
Copy link
Collaborator

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

@c2thorn c2thorn merged commit 3b70e4d into GoogleCloudPlatform:master Jul 9, 2021
@c2thorn c2thorn deleted the featurestores branch July 9, 2021 15:54
khajduczenia pushed a commit to khajduczenia/magic-modules that referenced this pull request Oct 12, 2021
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.

Support for Feature Store please
3 participants