Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
337ec5c
Export aiplatform_v1beta1 as aiplatform.gapic_v1beta1 (#17)
dizcology Oct 2, 2020
7e83ff6
GAPIC namespace (#20)
dizcology Oct 2, 2020
d3d8670
Init Disclaimer (#28)
vinnysenthil Oct 12, 2020
0fc50ab
clean up docstrings that are not rendered properly in reference doc (…
dizcology Oct 12, 2020
3c713d5
fix: re-add py sessions to noxfile (#22)
busunkim96 Oct 19, 2020
81366dc
feat: python-aiplatform beta library (#39)
dizcology Nov 4, 2020
a94d79a
chore: release 0.3.0 (#43)
dizcology Nov 5, 2020
3bee74d
chore: release 0.3.0 (#44)
release-please[bot] Nov 9, 2020
5685fe8
chore: update description (#53)
dizcology Nov 11, 2020
d2eb2fb
chore: release 0.3.1 (#54)
dizcology Nov 11, 2020
9e3519f
chore: release 0.3.1 (#55)
dizcology Nov 12, 2020
53cc5f5
feat: add samples (#56)
dizcology Nov 13, 2020
1eab2be
chore: release 0.3.1 (#64)
release-please[bot] Nov 16, 2020
26da7a7
feat: add get_custom_job and get_hyperparameter_tuning_job samples (#68)
dizcology Nov 16, 2020
1d71652
chore(deps): update dependency google-cloud-aiplatform to v0.3.1 (#74)
renovate-bot Nov 17, 2020
f79c0f4
chore(deps): update dependency pytest to v6.1.2 (#65)
renovate-bot Nov 17, 2020
7daacd5
feat: add data_labeling samples (#78)
morgandu Nov 17, 2020
fb165b3
feat: add custom_job samples (#69)
dizcology Nov 18, 2020
5155dee
feat: add create_hyperparameter_tuning_job_python_package sample (#76)
morgandu Nov 18, 2020
4c60ad6
feat: add video action recognition samples (#77)
morgandu Nov 25, 2020
b012283
feat: add create_training_pipeline_custom_training_managed_dataset sa…
morgandu Nov 25, 2020
ad09c29
feat: adds text batch prediction samples (#82)
telpirion Nov 26, 2020
19dc31a
docs: update readme (#81)
dizcology Nov 26, 2020
860d12e
test: var (#89)
morgandu Nov 26, 2020
77956b2
chore: sample tests lint (#90)
dizcology Nov 30, 2020
96a850f
feat: add create_batch_prediction_job samples (#67)
dizcology Dec 1, 2020
e5ddd3c
chore: updates synth.py to use Bazel generator (#88)
telpirion Dec 1, 2020
e6acf37
chore: require samples checks (#101)
busunkim96 Dec 2, 2020
5362a4d
chore: update sample test resouce names (#120)
dizcology Dec 4, 2020
5ddbf16
feat: initial generation of enhanced types (#102)
telpirion Dec 5, 2020
151ed11
chore: add sample_configs (#115)
dizcology Dec 5, 2020
6096ce7
chore: sample tests decouple (#124)
dizcology Dec 8, 2020
5cf3859
feat: xai samples (#83)
andrewferlitsch Dec 10, 2020
fe40777
chore: update create batch prediction job samples (#133)
dizcology Dec 15, 2020
07ae55a
chore(deps): update dependency pytest to v6.2.1 (#130)
renovate-bot Dec 15, 2020
53cdbab
fix: blacken on library, test files (#135)
telpirion Dec 16, 2020
dd8677c
chore: add api_endpoint_comment (#138)
dizcology Dec 16, 2020
1a302d2
feat: adds function/method enhancements, demo samples (#122)
telpirion Dec 17, 2020
1cbd4a5
feat: add schema namespace (#140)
dizcology Dec 21, 2020
624a08d
feat: update create_training_pipeline samples (#142)
dizcology Dec 22, 2020
69fc7fd
feat: Added tabular forecasting samples (#128)
ivanmkc Dec 22, 2020
7983b44
fix: predict image samples params (#150)
dizcology Dec 23, 2020
e2577fe
Update CODEOWNERS with GAPIC and SDK dev teams (#157)
vinnysenthil Jan 5, 2021
a23857b
feat: Added tabular forecasting sample (#156)
ivanmkc Jan 6, 2021
117ce24
test: add constraints file (#155)
busunkim96 Jan 7, 2021
0c41ed2
chore: aiplatform.schema -> aiplatform.gapic.schema (#158)
dizcology Jan 8, 2021
7650269
chore: release 0.4.0 (#73)
release-please[bot] Jan 13, 2021
6d3027b
chore(deps): update dependency google-cloud-aiplatform to v0.4.0 (#172)
renovate-bot Jan 13, 2021
8c0932f
chore: Update aiplatform test directory CODEOWNERS (#184)
sasha-gitg Jan 22, 2021
6589383
fix(deps): remove optional dependencies (#187)
busunkim96 Jan 25, 2021
a3c14bd
build: migrate to flakybot (#195)
JustinBeckwith Jan 30, 2021
fd36abe
chore: release 0.5.0 (#203)
dizcology Feb 3, 2021
3ed0e09
fix: reduces image size for test image (#213)
telpirion Feb 8, 2021
a04a561
feat: moves manual enhanced lib edits outside of generated files (#198)
telpirion Feb 8, 2021
f5839f8
chore(deps): update dependency pytest to v6.2.2 (#186)
renovate-bot Feb 8, 2021
2863dc0
feat: LRO metadata (#204)
dizcology Feb 8, 2021
cdeb0ec
fix: Fix sample test (#215)
dizcology Feb 9, 2021
0befde3
fix: correct text sentiment analysis sample (#222)
dizcology Feb 12, 2021
efc00ed
feat: updates python-aiplatform to v1 (#212)
telpirion Feb 12, 2021
96ac976
chore: update sample configs to keep some samples in v1beta1 (#225)
dizcology Feb 16, 2021
07499cc
chore: update prediction endpoint (#221)
dizcology Feb 16, 2021
0881f63
fix: rename schema.training_job.definition tabular_task to automl_tab…
morgandu Feb 16, 2021
07f0a85
feat: Add SDK-wide delete method, cancel methods to Job and TrainingJ…
vinnysenthil Feb 16, 2021
42b587d
feat: exposes v1 enhanced types and adds tests (#226)
telpirion Feb 17, 2021
719d785
chore: release 0.5.0 (#206)
release-please[bot] Feb 17, 2021
d24a9c2
chore(deps): update dependency google-cloud-aiplatform to v0.5.0 (#236)
renovate-bot Feb 17, 2021
e9d008d
feat: Added CustomTrainingJob.get (#161)
ivanmkc Feb 18, 2021
20b8859
fix: fix update export model sample, and add sample test (#239)
dizcology Feb 22, 2021
606a967
feat: Added AutoMLTextTrainingJob and tests (#220)
ivanmkc Feb 23, 2021
1918dca
feat: Made get function available to all training jobs (#238)
ivanmkc Feb 23, 2021
3c440de
fix: fix create data labeling job samples tests (#244)
dizcology Feb 24, 2021
82193ef
docs: update index.rst to include v1 (#246)
dizcology Feb 25, 2021
7b950eb
merge main into dev
sasha-gitg Feb 27, 2021
1174f3d
chose:remove unused tests
sasha-gitg Mar 1, 2021
b1c9d88
fix: fix predict sample tests for proto-plus==1.14.2 (#250)
dizcology Mar 1, 2021
0f00895
Merge branch 'master' into dev
sasha-gitg Mar 1, 2021
fc33d40
feat: add automl video training class (#235)
morgandu Mar 1, 2021
4d708cc
chore: release 0.5.1 (#240)
release-please[bot] Mar 1, 2021
0c7bc8f
Merge branch 'dev' into dev
sasha-gitg Mar 2, 2021
6617e82
Merge pull request #247 from sasha-gitg/dev
sasha-gitg Mar 2, 2021
267af10
chore: allow merge commits (#252)
busunkim96 Mar 3, 2021
b4338dc
chore(deps): update dependency google-cloud-aiplatform to v0.5.1 (#251)
renovate-bot Mar 3, 2021
116a29b
fix: skip create data labeling job sample tests (#254)
dizcology Mar 3, 2021
350ffd5
feat: Add Explanations to service APIs (#216)
vinnysenthil Mar 4, 2021
abb9661
feat: VideoDataset class (#253)
morgandu Mar 8, 2021
d75da52
feat: Added encryption_spec_key_name to all relevant resources (#256)
ivanmkc Mar 11, 2021
9dff2a6
chore: Modify integration tests to support VPC-SC environment (#262)
vinnysenthil Mar 16, 2021
47b7f38
chore(deps): update precommit hook pycqa/flake8 to v3.9.0 (#261)
renovate-bot Mar 19, 2021
755e7ad
fix: Fixed exception when the python executable path has a space in i…
ivanmkc Mar 22, 2021
e5c1b1a
feat: add Vizier service (#266)
dizcology Mar 22, 2021
e79d5a4
chore: release 0.6.0 (#268)
release-please[bot] Mar 22, 2021
45d5565
Merge branch 'master' into dev
sasha-gitg Mar 22, 2021
57f4fcf
fix: remove TPU from accelerator test cases
sasha-gitg Mar 22, 2021
ddd54af
Merge pull request #269 from sasha-gitg/dev
sasha-gitg Mar 23, 2021
3556046
chore: merge dev into mb-experimental-release
sasha-gitg Mar 23, 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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exclude =
*_pb2.py

# Standard linting exemptions.
**/.nox/**
__pycache__,
.git,
*.pyc,
Expand Down
15 changes: 15 additions & 0 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
1 change: 1 addition & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings
# Rules for master branch protection
mergeCommitAllowed: true
branchProtectionRules:
# Identifies the protection rule pattern. Name of the branch to be protected.
# Defaults to `master`
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ docs.metadata

# Virtual environment
env/

# Test logs
coverage.xml
sponge_log.xml
*sponge_log.xml

# System test environment variables.
system_tests/local_test_setup
Expand Down
26 changes: 20 additions & 6 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-aiplatform
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-aiplatform"
fi

cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
Expand All @@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If this is a continuous build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
cleanup() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap cleanup EXIT HUP
fi

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
11 changes: 11 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
28 changes: 28 additions & 0 deletions .kokoro/test-samples-against-head.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# 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
#
# https://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.

# A customized test runner for samples.
#
# For periodic builds, you can specify this file for testing against head.

# `-e` enables the script to automatically fail when a command fails
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
set -eo pipefail
# Enables `**` to include files nested inside sub-folders
shopt -s globstar

cd github/python-aiplatform

exec .kokoro/test-samples-impl.sh
102 changes: 102 additions & 0 deletions .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/bin/bash
# Copyright 2021 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
#
# https://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.


# `-e` enables the script to automatically fail when a command fails
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
set -eo pipefail
# Enables `**` to include files nested inside sub-folders
shopt -s globstar

# Exit early if samples directory doesn't exist
if [ ! -d "./samples" ]; then
echo "No tests run. `./samples` not found"
exit 0
fi

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Debug: show build environment
env | grep KOKORO

# Install nox
python3.6 -m pip install --upgrade --quiet nox

# Use secrets acessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
gcloud auth activate-service-account \
--key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
--project="cloud-devrel-kokoro-resources"
fi

# This script will create 3 files:
# - testing/test-env.sh
# - testing/service-account.json
# - testing/client-secrets.json
./scripts/decrypt-secrets.sh

source ./testing/test-env.sh
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json

# For cloud-run session, we activate the service account for gcloud sdk.
gcloud auth activate-service-account \
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"

export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json

echo -e "\n******************** TESTING PROJECTS ********************"

# Switch to 'fail at end' to allow all tests to complete before exiting.
set +e
# Use RTN to return a non-zero value if the test fails.
RTN=0
ROOT=$(pwd)
# Find all requirements.txt in the samples directory (may break on whitespace).
for file in samples/**/requirements.txt; do
cd "$ROOT"
# Navigate to the project folder.
file=$(dirname "$file")
cd "$file"

echo "------------------------------------------------------------"
echo "- testing $file"
echo "------------------------------------------------------------"

# Use nox to execute the tests for the project.
python3.6 -m nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a periodic build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
fi

if [[ $EXIT -ne 0 ]]; then
RTN=1
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
else
echo -e "\n Testing completed.\n"
fi

done
cd "$ROOT"

# Workaround for Kokoro permissions issue: delete secrets
rm testing/{test-env.sh,client-secrets.json,service-account.json}

exit "$RTN"
96 changes: 16 additions & 80 deletions .kokoro/test-samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# The default test runner for samples.
#
# For periodic builds, we rewinds the repo to the latest release, and
# run test-samples-impl.sh.

# `-e` enables the script to automatically fail when a command fails
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
Expand All @@ -24,87 +28,19 @@ cd github/python-aiplatform

# Run periodic samples tests at latest release
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
# preserving the test runner implementation.
cp .kokoro/test-samples-impl.sh "${TMPDIR}/test-samples-impl.sh"
echo "--- IMPORTANT IMPORTANT IMPORTANT ---"
echo "Now we rewind the repo back to the latest release..."
LATEST_RELEASE=$(git describe --abbrev=0 --tags)
git checkout $LATEST_RELEASE
fi

# Exit early if samples directory doesn't exist
if [ ! -d "./samples" ]; then
echo "No tests run. `./samples` not found"
exit 0
fi

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Debug: show build environment
env | grep KOKORO

# Install nox
python3.6 -m pip install --upgrade --quiet nox

# Use secrets acessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
gcloud auth activate-service-account \
--key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
--project="cloud-devrel-kokoro-resources"
fi

# This script will create 3 files:
# - testing/test-env.sh
# - testing/service-account.json
# - testing/client-secrets.json
./scripts/decrypt-secrets.sh

source ./testing/test-env.sh
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json

# For cloud-run session, we activate the service account for gcloud sdk.
gcloud auth activate-service-account \
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"

export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json

echo -e "\n******************** TESTING PROJECTS ********************"

# Switch to 'fail at end' to allow all tests to complete before exiting.
set +e
# Use RTN to return a non-zero value if the test fails.
RTN=0
ROOT=$(pwd)
# Find all requirements.txt in the samples directory (may break on whitespace).
for file in samples/**/requirements.txt; do
cd "$ROOT"
# Navigate to the project folder.
file=$(dirname "$file")
cd "$file"

echo "------------------------------------------------------------"
echo "- testing $file"
echo "------------------------------------------------------------"

# Use nox to execute the tests for the project.
python3.6 -m nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a periodic build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
echo "The current head is: "
echo $(git rev-parse --verify HEAD)
echo "--- IMPORTANT IMPORTANT IMPORTANT ---"
# move back the test runner implementation if there's no file.
if [ ! -f .kokoro/test-samples-impl.sh ]; then
cp "${TMPDIR}/test-samples-impl.sh" .kokoro/test-samples-impl.sh
fi
fi

if [[ $EXIT -ne 0 ]]; then
RTN=1
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
else
echo -e "\n Testing completed.\n"
fi

done
cd "$ROOT"

# Workaround for Kokoro permissions issue: delete secrets
rm testing/{test-env.sh,client-secrets.json,service-account.json}

exit "$RTN"
exec .kokoro/test-samples-impl.sh
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def make_parent(parent: str) -> str:

def make_training_pipeline(display_name: str, dataset_id: str, model_display_name: str) -> google.cloud.aiplatform_v1alpha1.types.training_pipeline.TrainingPipeline:
# Use sentiment_max of 4
training_task_inputs_dict = {"sentiment_max": 4}
training_task_inputs_dict = {"sentiment_max": 10}
training_task_inputs = to_protobuf_value(training_task_inputs_dict)

training_pipeline = {
Expand Down
4 changes: 3 additions & 1 deletion .sample_configs/param_handlers/export_model_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def make_output_config(gcs_destination_output_uri_prefix: str) -> google.cloud.a
output_config = {
'artifact_destination': {
'output_uri_prefix': gcs_destination_output_uri_prefix
}
},
# For information about export formats: https://cloud.google.com/ai-platform-unified/docs/export/export-edge-model#aiplatform_export_model_sample-drest
'export_format_id': 'tf-saved-model'
}

return output_config
Expand Down
Loading