Skip to content

Commit f7c5132

Browse files
matthew29tangcopybara-github
authored andcommitted
feat: Release Ray on Vertex SDK to GA
PiperOrigin-RevId: 632239389
1 parent c528b6f commit f7c5132

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+226
-48
lines changed

google/cloud/aiplatform/preview/vertex_ray/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
#
1919
import sys
2020

21-
from google.cloud.aiplatform.preview.vertex_ray.bigquery_datasource import (
21+
from google.cloud.aiplatform.vertex_ray.bigquery_datasource import (
2222
BigQueryDatasource,
2323
)
24-
from google.cloud.aiplatform.preview.vertex_ray.client_builder import (
24+
from google.cloud.aiplatform.vertex_ray.client_builder import (
2525
VertexRayClientBuilder as ClientBuilder,
2626
)
2727

28-
from google.cloud.aiplatform.preview.vertex_ray.cluster_init import (
28+
from google.cloud.aiplatform.vertex_ray.cluster_init import (
2929
create_ray_cluster,
3030
delete_ray_cluster,
3131
get_ray_cluster,
3232
list_ray_clusters,
3333
update_ray_cluster,
3434
)
3535

36-
from google.cloud.aiplatform.preview.vertex_ray import data
36+
from google.cloud.aiplatform.vertex_ray import data
3737

38-
from google.cloud.aiplatform.preview.vertex_ray.util.resources import (
38+
from google.cloud.aiplatform.vertex_ray.util.resources import (
3939
Resources,
4040
NodeImages,
4141
)
4242

43-
from google.cloud.aiplatform.preview.vertex_ray.dashboard_sdk import (
43+
from google.cloud.aiplatform.vertex_ray.dashboard_sdk import (
4444
get_job_submission_client_cluster_info,
4545
)
4646

google/cloud/aiplatform/preview/vertex_ray/predict/sklearn/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
#
1919

20-
from .register import register_sklearn
20+
from google.cloud.aiplatform.vertex_ray.predict.sklearn import (
21+
register_sklearn,
22+
)
2123

2224
__all__ = ("register_sklearn",)

google/cloud/aiplatform/preview/vertex_ray/predict/tensorflow/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
#
1919

20-
from .register import register_tensorflow
20+
from google.cloud.aiplatform.vertex_ray.predict.tensorflow import (
21+
register_tensorflow,
22+
)
2123

2224
__all__ = ("register_tensorflow",)

google/cloud/aiplatform/preview/vertex_ray/predict/torch/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
#
1919

20-
from .register import get_pytorch_model_from
20+
from google.cloud.aiplatform.vertex_ray.predict.torch import (
21+
get_pytorch_model_from,
22+
)
2123

2224
__all__ = ("get_pytorch_model_from",)

google/cloud/aiplatform/preview/vertex_ray/predict/xgboost/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
#
1919

20-
from .register import register_xgboost
20+
from google.cloud.aiplatform.vertex_ray.predict.xgboost import (
21+
register_xgboost,
22+
)
2123

2224
__all__ = ("register_xgboost",)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""Ray on Vertex AI."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2022 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
import sys
20+
21+
from google.cloud.aiplatform.vertex_ray.bigquery_datasource import (
22+
BigQueryDatasource,
23+
)
24+
from google.cloud.aiplatform.vertex_ray.client_builder import (
25+
VertexRayClientBuilder as ClientBuilder,
26+
)
27+
28+
from google.cloud.aiplatform.vertex_ray.cluster_init import (
29+
create_ray_cluster,
30+
delete_ray_cluster,
31+
get_ray_cluster,
32+
list_ray_clusters,
33+
update_ray_cluster,
34+
)
35+
36+
from google.cloud.aiplatform.vertex_ray import data
37+
38+
from google.cloud.aiplatform.vertex_ray.util.resources import (
39+
Resources,
40+
NodeImages,
41+
)
42+
43+
from google.cloud.aiplatform.vertex_ray.dashboard_sdk import (
44+
get_job_submission_client_cluster_info,
45+
)
46+
47+
if sys.version_info[1] != 10:
48+
print(
49+
"[Ray on Vertex]: The client environment with Python version 3.10 is required."
50+
)
51+
52+
__all__ = (
53+
"BigQueryDatasource",
54+
"data",
55+
"ClientBuilder",
56+
"get_job_submission_client_cluster_info",
57+
"create_ray_cluster",
58+
"delete_ray_cluster",
59+
"get_ray_cluster",
60+
"list_ray_clusters",
61+
"update_ray_cluster",
62+
"Resources",
63+
"NodeImages",
64+
)

google/cloud/aiplatform/preview/vertex_ray/cluster_init.py google/cloud/aiplatform/vertex_ray/cluster_init.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
ServiceAccountSpec,
3636
)
3737

38-
from google.cloud.aiplatform.preview.vertex_ray.util import (
38+
from google.cloud.aiplatform.vertex_ray.util import (
3939
_gapic_utils,
4040
_validation_utils,
4141
resources,

google/cloud/aiplatform/preview/vertex_ray/data.py google/cloud/aiplatform/vertex_ray/data.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
from typing import Any, Dict, Optional
2121
import warnings
2222

23-
from google.cloud.aiplatform.preview.vertex_ray.bigquery_datasource import (
23+
from google.cloud.aiplatform.vertex_ray.bigquery_datasource import (
2424
BigQueryDatasource,
2525
)
2626

2727
try:
28-
from google.cloud.aiplatform.preview.vertex_ray.bigquery_datasink import (
28+
from google.cloud.aiplatform.vertex_ray.bigquery_datasink import (
2929
_BigQueryDatasink,
3030
)
3131
except ImportError:
3232
_BigQueryDatasink = None
3333

34-
from google.cloud.aiplatform.preview.vertex_ray.util._validation_utils import (
34+
from google.cloud.aiplatform.vertex_ray.util._validation_utils import (
3535
_V2_4_WARNING_MESSAGE,
3636
)
3737

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Ray on Vertex AI Prediction."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2023 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Ray on Vertex AI Prediction Tensorflow."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2023 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
from .register import register_sklearn
21+
22+
__all__ = ("register_sklearn",)

google/cloud/aiplatform/preview/vertex_ray/predict/sklearn/register.py google/cloud/aiplatform/vertex_ray/predict/sklearn/register.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
from google.cloud.aiplatform import initializer
3131
from google.cloud.aiplatform import utils
3232
from google.cloud.aiplatform.utils import gcs_utils
33-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import constants
34-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import (
33+
from google.cloud.aiplatform.vertex_ray.predict.util import constants
34+
from google.cloud.aiplatform.vertex_ray.predict.util import (
3535
predict_utils,
3636
)
37-
from google.cloud.aiplatform.preview.vertex_ray.util._validation_utils import (
37+
from google.cloud.aiplatform.vertex_ray.util._validation_utils import (
3838
_V2_4_WARNING_MESSAGE,
3939
)
4040

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Ray on Vertex AI Prediction Tensorflow."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2023 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
from .register import register_tensorflow
21+
22+
__all__ = ("register_tensorflow",)

google/cloud/aiplatform/preview/vertex_ray/predict/tensorflow/register.py google/cloud/aiplatform/vertex_ray/predict/tensorflow/register.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
from google.cloud import aiplatform
2626
from google.cloud.aiplatform import initializer
2727
from google.cloud.aiplatform import utils
28-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import constants
29-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import (
28+
from google.cloud.aiplatform.vertex_ray.predict.util import constants
29+
from google.cloud.aiplatform.vertex_ray.predict.util import (
3030
predict_utils,
3131
)
32-
from google.cloud.aiplatform.preview.vertex_ray.util._validation_utils import (
32+
from google.cloud.aiplatform.vertex_ray.util._validation_utils import (
3333
_V2_4_WARNING_MESSAGE,
3434
)
3535

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Ray on Vertex AI Prediction Tensorflow."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2023 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
from .register import get_pytorch_model_from
21+
22+
__all__ = ("get_pytorch_model_from",)

google/cloud/aiplatform/preview/vertex_ray/predict/torch/register.py google/cloud/aiplatform/vertex_ray/predict/torch/register.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import ray
2121
from ray.air._internal.torch_utils import load_torch_model
2222
import tempfile
23-
from google.cloud.aiplatform.preview.vertex_ray.util._validation_utils import (
23+
from google.cloud.aiplatform.vertex_ray.util._validation_utils import (
2424
_V2_4_WARNING_MESSAGE,
2525
)
2626
from google.cloud.aiplatform.utils import gcs_utils
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Ray on Vertex AI Prediction Tensorflow."""
2+
3+
# -*- coding: utf-8 -*-
4+
5+
# Copyright 2023 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
from .register import register_xgboost
21+
22+
__all__ = ("register_xgboost",)

google/cloud/aiplatform/preview/vertex_ray/predict/xgboost/register.py google/cloud/aiplatform/vertex_ray/predict/xgboost/register.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
from google.cloud.aiplatform import initializer
3030
from google.cloud.aiplatform import utils
3131
from google.cloud.aiplatform.utils import gcs_utils
32-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import constants
33-
from google.cloud.aiplatform.preview.vertex_ray.predict.util import (
32+
from google.cloud.aiplatform.vertex_ray.predict.util import constants
33+
from google.cloud.aiplatform.vertex_ray.predict.util import (
3434
predict_utils,
3535
)
36-
from google.cloud.aiplatform.preview.vertex_ray.util._validation_utils import (
36+
from google.cloud.aiplatform.vertex_ray.util._validation_utils import (
3737
_V2_4_WARNING_MESSAGE,
3838
)
3939

google/cloud/aiplatform/preview/vertex_ray/util/_gapic_utils.py google/cloud/aiplatform/vertex_ray/util/_gapic_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from google.cloud.aiplatform.utils import (
2626
PersistentResourceClientWithOverride,
2727
)
28-
from google.cloud.aiplatform.preview.vertex_ray.util import _validation_utils
29-
from google.cloud.aiplatform.preview.vertex_ray.util.resources import (
28+
from google.cloud.aiplatform.vertex_ray.util import _validation_utils
29+
from google.cloud.aiplatform.vertex_ray.util.resources import (
3030
Cluster,
3131
Resources,
3232
)

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141

4242
# Add vertex_ray relative packages
4343
packages += [
44-
package.replace("google.cloud.aiplatform.preview.vertex_ray", "vertex_ray")
44+
package.replace("google.cloud.aiplatform.vertex_ray", "vertex_ray")
4545
for package in setuptools.PEP420PackageFinder.find()
46-
if package.startswith("google.cloud.aiplatform.preview.vertex_ray")
46+
if package.startswith("google.cloud.aiplatform.vertex_ray")
4747
]
4848

4949
tensorboard_extra_require = ["tensorflow >=2.3.0, <3.0.0dev; python_version<='3.11'"]
@@ -215,7 +215,7 @@
215215
description=description,
216216
long_description=readme,
217217
packages=packages,
218-
package_dir={"vertex_ray": "google/cloud/aiplatform/preview/vertex_ray"},
218+
package_dir={"vertex_ray": "google/cloud/aiplatform/vertex_ray"},
219219
package_data={"": ["*.html.j2"]},
220220
entry_points={
221221
"console_scripts": [

tests/system/vertex_ray/test_cluster_management.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
from google.cloud import aiplatform
19-
from google.cloud.aiplatform.preview import vertex_ray
19+
from google.cloud.aiplatform import vertex_ray
2020
from tests.system.aiplatform import e2e_base
2121
import datetime
2222
import pytest

tests/system/vertex_ray/test_job_submission_dashboard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
from google.cloud import aiplatform
19-
from google.cloud.aiplatform.preview import vertex_ray
19+
from google.cloud.aiplatform import vertex_ray
2020
from ray.job_submission import JobSubmissionClient
2121
from tests.system.aiplatform import e2e_base
2222
import datetime
@@ -57,7 +57,7 @@ def test_job_submission_dashboard(self, cluster_ray_version):
5757

5858
# Need to use the full path since the installation is editable, not from a release
5959
client = JobSubmissionClient(
60-
"google.cloud.aiplatform.preview.vertex_ray://{}".format(
60+
"google.cloud.aiplatform.vertex_ray://{}".format(
6161
cluster_details.dashboard_address
6262
)
6363
)

0 commit comments

Comments
 (0)