Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9a57204
fix: unblock builds (#132)
sasha-gitg Dec 15, 2020
ca23e5c
chore: Update README with Experimental verbiage (#131)
sasha-gitg Dec 15, 2020
f547f1e
fix: Fixed comments (#116)
ivanmkc Dec 15, 2020
267e8d9
feat: Implements a wrapped client that instantiates the client at eve…
sasha-gitg Dec 17, 2020
e45ebfc
feat: Added optional model args for custom training (#129)
ivanmkc Dec 21, 2020
b6c4079
Fix: refactor class constructor for retrieving resource (#125)
morgandu Dec 21, 2020
542dc81
chore: merge main into dev (#154)
sasha-gitg Jan 5, 2021
ee6e275
test: Dataset integration tests (#126)
vinnysenthil Jan 5, 2021
4459fff
feat: specialized dataset classes, fix: datasets refactor (#153)
morgandu Jan 7, 2021
c419683
feat: Add AutoML Image Training Job class (#152)
vinnysenthil Jan 8, 2021
46d3fac
feat: Add custom container support (#164)
sasha-gitg Jan 8, 2021
9e1087a
chore: merge main into dev (#162)
sasha-gitg Jan 11, 2021
ce7b7a3
fix: suppress no project id warning (#160)
morgandu Jan 11, 2021
97fc6ee
fix: Fixed wrong key value for multilabel (#168)
ivanmkc Jan 12, 2021
7e6dd0f
feat: Add delete methods, add list_models and undeploy_all for Endpoi…
vinnysenthil Jan 13, 2021
a2ef7a9
fix: Fixed bug causing training failure for object detection (#171)
ivanmkc Jan 13, 2021
4e3587e
fix: Support intermediary BQ Table for Custom Training (#166)
sasha-gitg Jan 13, 2021
d75b5d6
chore: add AutoMLImageTrainingJob to aiplatform namespace (#173)
sasha-gitg Jan 15, 2021
3192485
fix: Unblock build (#174)
sasha-gitg Jan 15, 2021
1ebdd80
fix: default credentials config related test failures (#167)
morgandu Jan 19, 2021
cfb9da3
Fix: pass bq_destination to input data config when using training scr…
sasha-gitg Jan 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.
#
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# yoshi-python is the default owner
* @googleapis/yoshi-python

# The AI Platform GAPIC libraries are owned by Cloud AI DPE
/google/cloud/aiplatform* @googleapis/cdpe-cloudai

# The AI Platform SDK is owned by Model Builder SDK Dev team
/google/cloud/aiplatform/* @googleapis/cloud-aiplatform-model-builder-sdk

# The python-samples-owners team is the default owner for samples
/samples/**/*.py @dizcology @googleapis/python-samples-owners

# The enhanced client library tests are owned by @telpirion
/tests/unit/enhanced_library/*.py @telpirion
11 changes: 11 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings
# Rules for master branch protection
branchProtectionRules:
# Identifies the protection rule pattern. Name of the branch to be protected.
# Defaults to `master`
- pattern: master
requiredStatusCheckContexts:
- 'Kokoro'
- 'cla/google'
- 'Samples - Lint'
- 'Samples - Python 3.7'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pip-log.txt

# Unit test / coverage reports
.coverage
.coverage.*
.nox
.cache
.pytest_cache
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ env_vars: {
value: "py-3.8"
}

# Run tests located under tests/system
env_vars: {
key: "RUN_SYSTEM_TESTS"
value: "true"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/test-samples.sh"
Expand Down
27 changes: 27 additions & 0 deletions .sample_configs/implementations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2020 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.
#

def read_file(filename):
with open(filename, 'rb') as f:
file_content = f.read()
return file_content


def b64_encode(content):
return base64.b64encode(content).decode("utf-8")


def to_protobuf_value(d):
return json_format.ParseDict(d, Value())
27 changes: 27 additions & 0 deletions .sample_configs/param_handlers/batch_delete_data_items_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2020 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.
#

def make_parent(parent: str) -> str:
# Sample function parameter parent in batch_delete_data_items_sample
parent = parent

return parent

def make_names(data_item_name_1: str, data_item_name_2: str) -> typing.Sequence[str]:
# The list of full name of data items in the same dataset to be deleted.
names = [data_item_name_1, data_item_name_2]

return names

27 changes: 27 additions & 0 deletions .sample_configs/param_handlers/batch_migrate_resources_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2020 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.
#

def make_parent(parent: str) -> str:
# Sample function parameter parent in batch_migrate_resources_sample
parent = parent

return parent

def make_migrate_resource_requests(migrate_resource_requests: typing.Sequence[google.cloud.aiplatform_v1beta1.types.migration_service.MigrateResourceRequest]) -> typing.Sequence[google.cloud.aiplatform_v1beta1.types.migration_service.MigrateResourceRequest]:
# Sample function parameter migrate_resource_requests in batch_migrate_resources_sample
migrate_resource_requests = migrate_resource_requests

return migrate_resource_requests

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 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.
#

def make_name(name: str) -> str:
# Sample function parameter name in cancel_batch_prediction_job_sample
name = name

return name

21 changes: 21 additions & 0 deletions .sample_configs/param_handlers/cancel_custom_job_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 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.
#

def make_name(name: str) -> str:
# Sample function parameter name in cancel_custom_job_sample
name = name

return name

21 changes: 21 additions & 0 deletions .sample_configs/param_handlers/cancel_data_labeling_job_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 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.
#

def make_name(name: str) -> str:
# Sample function parameter name in cancel_data_labeling_job_sample
name = name

return name

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 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.
#

def make_name(name: str) -> str:
# Sample function parameter name in cancel_hyperparameter_tuning_job_sample
name = name

return name

21 changes: 21 additions & 0 deletions .sample_configs/param_handlers/cancel_training_pipeline_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 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.
#

def make_name(name: str) -> str:
# Sample function parameter name in cancel_training_pipeline_sample
name = name

return name

32 changes: 32 additions & 0 deletions .sample_configs/param_handlers/create_annotation_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2020 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.
#

def make_parent(parent: str) -> str:
# Sample function parameter parent in create_annotation_sample
parent = parent

return parent

def make_annotation(payload_schema_uri: str) -> google.cloud.aiplatform_v1alpha1.types.annotation.Annotation:
payload_dict = {}
payload = to_protobuf_value(payload_dict)

annotation = {
'payload_schema_uri': '',
'payload': payload
}

return annotation

28 changes: 28 additions & 0 deletions .sample_configs/param_handlers/create_annotation_spec_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2020 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.
#

def make_parent(parent: str) -> str:
# Sample function parameter parent in create_annotation_spec_sample
parent = parent

return parent

def make_annotation_spec(display_name: str) -> google.cloud.aiplatform_v1alpha1.types.annotation_spec.AnnotationSpec:
annotation_spec = {
'display_name': display_name
}

return annotation_spec

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2020 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.
#

def make_parent(parent: str) -> str:
# Sample function parameter parent in create_batch_prediction_job_bigquery_sample
parent = parent

return parent

def make_batch_prediction_job(display_name: str, model_name: str, instances_format: str, bigquery_source_input_uri: str, predictions_format: str, bigquery_destination_output_uri: str) -> google.cloud.aiplatform_v1alpha1.types.batch_prediction_job.BatchPredictionJob:
model_parameters_dict = {}
model_parameters = to_protobuf_value(model_parameters_dict)

batch_prediction_job = {
'display_name': display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
'model': model_name,
'model_parameters': model_parameters,
'input_config': {
'instances_format': instances_format,
'bigquery_source': {
'input_uri': bigquery_source_input_uri
}
},
'output_config': {
'predictions_format': predictions_format,
'bigquery_destination': {
'output_uri': bigquery_destination_output_uri
}
},
# optional
'generate_explanation': True
}

return batch_prediction_job
Loading