Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

feat(samples): add all feature samples #980

Merged
merged 8 commits into from
Aug 3, 2022

Conversation

sai-chaithu
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #945 ☕️

@sai-chaithu sai-chaithu requested a review from a team as a code owner June 28, 2022 08:20
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Jun 28, 2022
@snippet-bot
Copy link

snippet-bot bot commented Jun 28, 2022

Here is the summary of changes.

You are about to add 8 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: vertex-ai Issues related to the googleapis/java-aiplatform API. samples Issues that are directly related to samples. labels Jun 28, 2022
@kurtisvg kurtisvg added the blunderbuss: assign Instruct blunderbuss to assign someone label Jun 29, 2022
@blunderbuss-gcf blunderbuss-gcf bot removed the blunderbuss: assign Instruct blunderbuss to assign someone label Jun 29, 2022
@kurtisvg kurtisvg removed their assignment Jun 29, 2022
@junkourata junkourata self-requested a review July 8, 2022 01:02
@junkourata junkourata added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2022
}
}
}
// [END aiplatform_delete_Feature_sample]

Choose a reason for hiding this comment

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

aiplatform_delete_Feature_sample -> aiplatform_delete_feature_sample
both START and END

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, will update it


Feature feature = Feature.newBuilder().setDescription(description)
.setValueType(ValueType.valueOf(valueType))
// .setDisableMonitoring(disableMonitoring)

Choose a reason for hiding this comment

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

I think we can remove this unless you guys are asked to put this example explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, will remove it.

FeaturestoreServiceClient.create(featurestoreServiceSettings)) {

Feature feature = Feature.newBuilder().setDescription(description)
.setValueType(ValueType.valueOf(valueType))
Copy link

Choose a reason for hiding this comment

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

nit: can we use the ENUM directly. Applies to all occurrences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will pass the ENUM variable instead of String Variable as below

Suggested change
.setValueType(ValueType.valueOf(valueType))
ValueType valueType = ValueType.STRING;
...
.setValueType(valueType)

// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests. After completing all of your requests, call
// the "close" method on the client to safely clean up any remaining background resources.
try (FeaturestoreServiceClient featurestoreServiceClient =
Copy link

Choose a reason for hiding this comment

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

should we add the close to examples as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In other samples of GitHub close is not used, so we were following the same approach.
Should we add it for all the feature samples?

Copy link

Choose a reason for hiding this comment

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

Yeah I see it as a plus to have it be there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added for all feature API's

String valueType = "YOUR_FEATURE_VALUE_TYPE";
String location = "us-central1";
String endpoint = "us-central1-aiplatform.googleapis.com:443";
int timeout = 300;
Copy link

Choose a reason for hiding this comment

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

Should we follow the same timeout strategy as suggested in googleapis/nodejs-ai-platform#338

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was suggested for Featurestore API's, should follow the same timeouts as below for EntityType and Feature API's as well ?
15min for create
5min for delete
10min for update
5sec for list,get

Copy link

Choose a reason for hiding this comment

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

Lets do this instead, as Update on Feature/EntityType is syncronous, no long running operation i.e.

15min for create
5min for delete
1min for update
5sec for list,get

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated for create and delete feature API's with timeouts 15min and 5min respectively and for update, list, get timeout is not required.

@kolea2 kolea2 assigned alicejli and unassigned kolea2 Jul 13, 2022
@alicejli alicejli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 14, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 14, 2022
@alicejli alicejli added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 14, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 14, 2022
@sai-chaithu sai-chaithu requested a review from a team as a code owner July 14, 2022 15:04
@alicejli alicejli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 14, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 14, 2022
@alicejli
Copy link
Contributor

Looks like the CancelTrainingPipelineSampleTest is failing:

expected to contain:
    Message: CANCELED
but was:
    Create Training Pipeline Response

... at aiplatform.CancelTrainingPipelineSampleTest.cancelTrainingPipeline(CancelTrainingPipelineSampleTest.java:121)

Do you mind taking a look?

@junkourata junkourata requested a review from dizcology July 26, 2022 18:27
@junkourata junkourata added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 26, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 26, 2022
@junkourata junkourata added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 27, 2022
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 27, 2022
@meltsufin meltsufin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 28, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 28, 2022
@kweinmeister kweinmeister added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 1, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 1, 2022
Copy link
Contributor

@dizcology dizcology left a comment

Choose a reason for hiding this comment

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

Please make sure sample tests pass before merging.

@junkourata junkourata added the kokoro:run Add this label to force Kokoro to re-run the tests. label Aug 2, 2022
@diemtvu diemtvu added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 3, 2022
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 3, 2022
@junkourata junkourata merged commit a932cf8 into googleapis:main Aug 3, 2022
gcf-merge-on-green bot pushed a commit that referenced this pull request Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


## [3.2.0](v3.1.0...v3.2.0) (2022-08-09)


### Features

* add a DeploymentResourcePool API resource_definition ([#997](#997)) ([f3e6d4f](f3e6d4f))
* add DeploymentResourcePool in aiplatform v1beta1 deployment_resource_pool.proto ([#998](#998)) ([49fb069](49fb069))
* add DeploymentResourcePoolService in aiplatform v1beta1 deployment_resource_pool_service.proto ([49fb069](49fb069))
* add shared_resources for supported prediction_resources ([f3e6d4f](f3e6d4f))
* add SHARED_RESOURCES to DeploymentResourcesType in aiplatform v1beta1 model.proto ([49fb069](49fb069))
* added SHARED_RESOURCES enum to aiplatform v1 model.proto ([3935d8f](3935d8f))
* DeploymentResourcePool and DeployementResourcePoolService added to aiplatform v1beta1 model.proto (cl/463147866) ([3935d8f](3935d8f))
* making network arg optional in aiplatform v1 custom_job.proto ([#999](#999)) ([3935d8f](3935d8f))
* making network arg optional in aiplatform v1beta1 custom_job.proto ([3935d8f](3935d8f))
* **samples:** add all feature samples ([#980](#980)) ([a932cf8](a932cf8))
* **samples:** add all feature values samples ([#981](#981)) ([818acab](818acab))


### Bug Fixes

* declaring test-scope artifact as runtime ([#1014](#1014)) ([f90cc12](f90cc12))


### Documentation

* doc edits to aiplatform v1 dataset_service.proto, job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto ([3935d8f](3935d8f))
* doc edits to aiplatform v1beta1 job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto ([3935d8f](3935d8f))


### Dependencies

* update dependency com.google.api.grpc:proto-google-cloud-aiplatform-v1beta1 to v0.17.0 ([#1003](#1003)) ([c2b98d9](c2b98d9))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#1006](#1006)) ([2c959b9](2c959b9))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 ([#1009](#1009)) ([b170504](b170504))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1000](#1000)) ([6fb1534](6fb1534))
* update dependency com.google.cloud:google-cloud-storage to v2.10.0 ([#1004](#1004)) ([b6e2ab4](b6e2ab4))
* update dependency com.google.cloud:google-cloud-storage to v2.11.0 ([#1005](#1005)) ([26391a3](26391a3))
* update dependency com.google.cloud:google-cloud-storage to v2.11.1 ([#1008](#1008)) ([cba42d1](cba42d1))
* update dependency com.google.cloud:google-cloud-storage to v2.11.2 ([#1010](#1010)) ([4f35eed](4f35eed))
* update dependency com.google.code.gson:gson to v2.9.1 ([#1001](#1001)) ([f12c313](f12c313))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit to googleapis/google-cloud-java that referenced this pull request Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


## [3.2.0](googleapis/java-aiplatform@v3.1.0...v3.2.0) (2022-08-09)


### Features

* add a DeploymentResourcePool API resource_definition ([#997](googleapis/java-aiplatform#997)) ([82551d8](googleapis/java-aiplatform@82551d8))
* add DeploymentResourcePool in aiplatform v1beta1 deployment_resource_pool.proto ([#998](googleapis/java-aiplatform#998)) ([76dc64f](googleapis/java-aiplatform@76dc64f))
* add DeploymentResourcePoolService in aiplatform v1beta1 deployment_resource_pool_service.proto ([76dc64f](googleapis/java-aiplatform@76dc64f))
* add shared_resources for supported prediction_resources ([82551d8](googleapis/java-aiplatform@82551d8))
* add SHARED_RESOURCES to DeploymentResourcesType in aiplatform v1beta1 model.proto ([76dc64f](googleapis/java-aiplatform@76dc64f))
* added SHARED_RESOURCES enum to aiplatform v1 model.proto ([301cfb0](googleapis/java-aiplatform@301cfb0))
* DeploymentResourcePool and DeployementResourcePoolService added to aiplatform v1beta1 model.proto (cl/463147866) ([301cfb0](googleapis/java-aiplatform@301cfb0))
* making network arg optional in aiplatform v1 custom_job.proto ([#999](googleapis/java-aiplatform#999)) ([301cfb0](googleapis/java-aiplatform@301cfb0))
* making network arg optional in aiplatform v1beta1 custom_job.proto ([301cfb0](googleapis/java-aiplatform@301cfb0))
* **samples:** add all feature samples ([#980](googleapis/java-aiplatform#980)) ([8c2a485](googleapis/java-aiplatform@8c2a485))
* **samples:** add all feature values samples ([#981](googleapis/java-aiplatform#981)) ([2d4e6fe](googleapis/java-aiplatform@2d4e6fe))


### Bug Fixes

* declaring test-scope artifact as runtime ([#1014](googleapis/java-aiplatform#1014)) ([6c47c65](googleapis/java-aiplatform@6c47c65))


### Documentation

* doc edits to aiplatform v1 dataset_service.proto, job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto ([301cfb0](googleapis/java-aiplatform@301cfb0))
* doc edits to aiplatform v1beta1 job_service.proto, model_service.proto, pipeline_service.proto, saved_query.proto, study.proto, types.proto ([301cfb0](googleapis/java-aiplatform@301cfb0))


### Dependencies

* update dependency com.google.api.grpc:proto-google-cloud-aiplatform-v1beta1 to v0.17.0 ([#1003](googleapis/java-aiplatform#1003)) ([b793732](googleapis/java-aiplatform@b793732))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#1006](googleapis/java-aiplatform#1006)) ([6bb8982](googleapis/java-aiplatform@6bb8982))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 ([#1009](googleapis/java-aiplatform#1009)) ([8cca8b5](googleapis/java-aiplatform@8cca8b5))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1000](googleapis/java-aiplatform#1000)) ([c93de30](googleapis/java-aiplatform@c93de30))
* update dependency com.google.cloud:google-cloud-storage to v2.10.0 ([#1004](googleapis/java-aiplatform#1004)) ([dd52cad](googleapis/java-aiplatform@dd52cad))
* update dependency com.google.cloud:google-cloud-storage to v2.11.0 ([#1005](googleapis/java-aiplatform#1005)) ([60e2f76](googleapis/java-aiplatform@60e2f76))
* update dependency com.google.cloud:google-cloud-storage to v2.11.1 ([#1008](googleapis/java-aiplatform#1008)) ([9a2fe64](googleapis/java-aiplatform@9a2fe64))
* update dependency com.google.cloud:google-cloud-storage to v2.11.2 ([#1010](googleapis/java-aiplatform#1010)) ([3c2ac16](googleapis/java-aiplatform@3c2ac16))
* update dependency com.google.code.gson:gson to v2.9.1 ([#1001](googleapis/java-aiplatform#1001)) ([a6ffed4](googleapis/java-aiplatform@a6ffed4))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: vertex-ai Issues related to the googleapis/java-aiplatform API. samples Issues that are directly related to samples. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sample snippets for Vertex Feature Store