-
Notifications
You must be signed in to change notification settings - Fork 426
feat: Add PrivateEndpoint class and HTTP methods #1033
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
Merged
Merged
Changes from all commits
Commits
Show all changes
176 commits
Select commit
Hold shift + click to select a range
a1dd1fc
Add `network` to SDK initializer
vinnysenthil 1a3e1c8
Merge branch 'main' into private-ep
vinnysenthil 0f597e0
Add urllib3 to library requirements
vinnysenthil bbb56fd
Fix network init() docstrings
vinnysenthil 27e7ac6
Merge branch 'main' into private-ep
vinnysenthil e78e5e5
Merge branch 'main' into private-ep
vinnysenthil 7476c10
Update Model/Endpoint docs to use top namespace
vinnysenthil 6ad46dd
Add core Private Endpoint wrapper
vinnysenthil b8126e0
Drop logs, add URI props
vinnysenthil f43ab4e
Lint, update typing for Prediction class
vinnysenthil 7c150d4
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] e84761a
Add bug refs, test stubs, minor fixes
vinnysenthil 31ac84e
Merge branch 'private-ep' of github.com:googleapis/python-aiplatform …
vinnysenthil 4dc3c6e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] c14c5f6
Merge branch 'main' into private-ep
nayaknishant db589c4
test commit
nayaknishant f598f02
adding examples, slight changes
nayaknishant dfc897d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 80714b6
adding deployed model check:
nayaknishant 2ab5ad5
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 2425261
adding deployed model check
nayaknishant a5bec23
minor changes, adding error catching for explanations
nayaknishant ddb8cce
testing to get other fields
nayaknishant 9c44b1c
removing edge case
nayaknishant 7c8687a
adding print statement for debugging explain
nayaknishant 4f2b0a1
using GET instead of POST for explain
nayaknishant fe1e452
using GET instead of POST for explain
nayaknishant 07e6bfd
using GET instead of POST for explain
nayaknishant fc47135
removing explain for now, adding model id
nayaknishant 8b59894
removing explain for now, adding model id
nayaknishant 6b96c2a
removing explain for now, adding model id
nayaknishant 160c499
cleaned and added docstrings
nayaknishant c7034ed
Merge branch 'main' into private-ep
nayaknishant bc9cc8d
Merge branch 'main' into private-ep
nayaknishant e1ce3a4
adding explain back
nayaknishant 9f2d478
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] f46a555
removing explain until working
nayaknishant a552c36
removing explain until working
nayaknishant 9c47d74
cleaning up docstrings
nayaknishant 6d80cf0
create test done, working on predict
nayaknishant f95cd29
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] f3c77e5
added unit tests for PrivateEndpoint
nayaknishant 4aad876
added unit tests for PrivateEndpoint
nayaknishant 2a17700
Merge branch 'main' into private-ep
nayaknishant ee1102a
test debugging
nayaknishant 7413bf8
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant ce11faf
fixing unit tests
nayaknishant 5639ed7
adding fixes
nayaknishant c50954f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] fe737d8
formatting encryption_spec_key_name
nayaknishant 107c23e
formatting encryption_spec_key_name
nayaknishant 547aba9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] e69176a
Merge branch 'main' into private-ep
nayaknishant a2c8387
fixing comments
nayaknishant a23523c
adjusting traffic for private endpoint
nayaknishant af4eabb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 6e7fd56
adjusting traffic for private endpoint
nayaknishant 7bfc060
adjusting traffic for private endpoint
nayaknishant dfe532d
adjusting traffic for private endpoint
nayaknishant 4f42cc6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 0b81035
Merge branch 'main' into private-ep
nayaknishant f7e64f5
adding fixes
nayaknishant 3ac68ec
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant c8b142a
Merge branch 'main' into private-ep
nayaknishant 7522b7a
added delete for private Endpoint
nayaknishant c6dcfca
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 5cc299f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] a5dc678
Merge branch 'main' into private-ep
nayaknishant d1c3293
fixing traffic percentage
nayaknishant e40e53d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] c26363e
using network instead of class, moving exceptions
nayaknishant 0876b0d
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant ade4817
Merge branch 'main' into private-ep
nayaknishant 45c6794
cleaning up docstrings
nayaknishant 1aab058
adding fixes, delete testing
nayaknishant d59a922
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant b8185ae
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 05ff612
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 4b5bc05
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] b177cfd
adding fixes
nayaknishant daeb49c
adding fixes
nayaknishant f5b51ac
adding Raises section to private Endpoint docstrings
nayaknishant 7151277
added private Endpoint check in init, added to testing
nayaknishant b0df987
added private Endpoint check in init, added to testing
nayaknishant 9ac1aec
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 67ee082
adding try/except inside functions, fixing tests, misc fixes
nayaknishant a05018b
adding try/except inside functions, fixing tests, misc fixes
nayaknishant d822781
Merge branch 'main' into private-ep
nayaknishant 8de58a9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 8f58616
fixes to setup.py
nayaknishant d54d8a0
fixes to setup.py
nayaknishant 80f5f92
Merge branch 'main' into private-ep
nayaknishant 881d7b7
reverting _validate_deploy_args method
nayaknishant b6977f2
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant bceef11
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 90aa205
fixed type hint
nayaknishant eb76531
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 90cc453
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] f8bf846
lint issue
nayaknishant 7e93bab
lint issue
nayaknishant 1cd43ba
lint issue
nayaknishant d626b15
Merge branch 'main' into private-ep
nayaknishant 849189f
merging in main
nayaknishant ce90514
adding system tests
nayaknishant fa40d4d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] dd9d5f8
merging in changes
nayaknishant 3119032
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 24f3f74
adding system test changes
nayaknishant f1be948
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 4abb639
adding shared_state to system test
nayaknishant bd84969
adding shared_state to system test
nayaknishant 0287e22
adding changes from main in __init__
nayaknishant 66a02d6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 162eefd
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] 356c194
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 33cfa55
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] ba62506
trying outside import
nayaknishant 055d626
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant add3ec1
putting imports back inside
nayaknishant ebd8710
added system test changes
nayaknishant d1f3e95
added system test changes
nayaknishant 54e12cd
Merge branch 'main' into private-ep
nayaknishant 0e72808
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant ca85cb5
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 29dd677
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant 595407a
adding fixes
nayaknishant e3f2686
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 6a00212
fixing system test and init fixes
nayaknishant 5b2fae0
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 91c0d7c
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] a9b5ec6
Merge branch 'main' into private-ep
nayaknishant ef05242
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 8106652
adding fixes
nayaknishant 71de56d
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 3db7c64
adding fixes
nayaknishant 91b81b4
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 4b3de6e
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] 2a7991b
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 45f5348
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] e96c2cd
adding fixes
nayaknishant 44818ad
adding fixes
nayaknishant 997a97b
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 0e646dc
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 74ceab7
added global network arg to associated classes
nayaknishant 1e3f921
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant b7e2168
style formatting
nayaknishant 8de7d06
docstring fixes
nayaknishant 6a5fabe
adding extra info to network arg docstring
nayaknishant 15cdb50
adding extra info to network arg docstring
nayaknishant 4e12d49
Merge branch 'main' into private-ep
nayaknishant 64f5ee9
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant d303e6d
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 2e6325e
removing changes to noxfile
nayaknishant f9253d5
reverting noxfile
nayaknishant 75fa4d7
reverting noxfile
nayaknishant ffa3a40
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] d5c0980
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] 63cdee3
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 46cb018
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
gcf-owl-bot[bot] 75713d8
reverting job files to not include global network
nayaknishant f699f1d
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant dbdd705
reverting initalizer to not include global network config
nayaknishant 1566b61
removing global network config
nayaknishant b28f8b1
Merge branch 'main' into private-ep
sasha-gitg fcda7bb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 2f734ba
Merge branch 'main' into private-ep
nayaknishant ed00745
Merge branch 'main' into private-ep
nayaknishant b3eabc7
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant 0974ef5
added fix and test to models
nayaknishant 6e2252c
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 220277f
added fix and test to models
nayaknishant 9331d83
Merge branch 'main' into private-ep
nayaknishant 66dc001
Merge branch 'main' into private-ep
nayaknishant ce337f6
simplifying delete method
nayaknishant 10e1d81
Merge branch 'private-ep' of https://github.com/googleapis/python-aip…
nayaknishant 1464d24
Merge branch 'main' into private-ep
nayaknishant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| # Copyright 2022 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| import pytest | ||
|
|
||
| from google.cloud import aiplatform | ||
|
|
||
| from tests.system.aiplatform import e2e_base | ||
|
|
||
| # permanent_custom_mnist_model | ||
| _MODEL_ID = "6430031960164270080" | ||
| _PRIVATE_ENDPOINT_NETWORK = "projects/580378083368/global/networks/private-endpoint-vpc" | ||
|
|
||
|
|
||
| @pytest.mark.usefixtures("tear_down_resources") | ||
| class TestPrivateEndpoint(e2e_base.TestEndToEnd): | ||
|
|
||
| _temp_prefix = "temp_vertex_sdk_e2e" | ||
|
|
||
| def test_create_deploy_delete_private_endpoint(self, shared_state): | ||
| # Collection of resources generated by this test, to be deleted during teardown | ||
| shared_state["resources"] = [] | ||
|
|
||
| aiplatform.init( | ||
| project=e2e_base._PROJECT, | ||
| location=e2e_base._LOCATION, | ||
| ) | ||
|
|
||
| private_endpoint = aiplatform.PrivateEndpoint.create( | ||
| display_name=self._make_display_name("private_endpoint_test"), | ||
| network=_PRIVATE_ENDPOINT_NETWORK, | ||
| ) | ||
| shared_state["resources"].append(private_endpoint) | ||
|
|
||
| # Verify that the retrieved private Endpoint is the same | ||
| my_private_endpoint = aiplatform.PrivateEndpoint( | ||
| endpoint_name=private_endpoint.resource_name | ||
| ) | ||
| assert private_endpoint.resource_name == my_private_endpoint.resource_name | ||
| assert private_endpoint.display_name == my_private_endpoint.display_name | ||
|
|
||
| # Verify the endpoint is in the private Endpoint list | ||
| list_private_endpoint = aiplatform.PrivateEndpoint.list() | ||
| assert private_endpoint.resource_name in [ | ||
| private_endpoint.resource_name for private_endpoint in list_private_endpoint | ||
| ] | ||
|
|
||
| # Retrieve permanent model, deploy to private Endpoint, then undeploy | ||
| my_model = aiplatform.Model(model_name=_MODEL_ID) | ||
|
|
||
| my_private_endpoint.deploy(model=my_model) | ||
| assert my_private_endpoint._gca_resource.deployed_models | ||
|
|
||
| deployed_model_id = my_private_endpoint.list_models()[0].id | ||
| my_private_endpoint.undeploy(deployed_model_id=deployed_model_id) | ||
| assert not my_private_endpoint._gca_resource.deployed_models |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.