From a1c554c46e87a05b40bcbab8e3b96ebb8cda8cf1 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Tue, 17 Sep 2019 14:30:12 -0700 Subject: [PATCH 1/3] Tests - Samples - Added the component_build sample test --- .../configs/component_build.config.yaml | 18 ++++++++++++++++++ test/sample_test.yaml | 1 + 2 files changed, 19 insertions(+) create mode 100644 test/sample-test/configs/component_build.config.yaml diff --git a/test/sample-test/configs/component_build.config.yaml b/test/sample-test/configs/component_build.config.yaml new file mode 100644 index 00000000000..50e8a0db80a --- /dev/null +++ b/test/sample-test/configs/component_build.config.yaml @@ -0,0 +1,18 @@ +# Copyright 2019 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. + +test_name: component_build +notebook_params: + EXPERIMENT_NAME: component_build-test + PROJECT_NAME: ml-pipeline-test diff --git a/test/sample_test.yaml b/test/sample_test.yaml index e40659ab5df..6a677401a24 100644 --- a/test/sample_test.yaml +++ b/test/sample_test.yaml @@ -82,6 +82,7 @@ spec: - preemptible_tpu_gpu - volume_snapshot_ops - kubeflow_tf_serving + - component_build # Build and push image - name: build-image-by-dockerfile inputs: From 4d61baedc61599255b59d0f67e2319dabfe7a2e6 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Wed, 18 Sep 2019 12:43:26 -0700 Subject: [PATCH 2/3] Fixed the papermill issue --- samples/core/component_build/component_build.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/core/component_build/component_build.ipynb b/samples/core/component_build/component_build.ipynb index d41973449d1..0e45cb99954 100644 --- a/samples/core/component_build/component_build.ipynb +++ b/samples/core/component_build/component_build.ipynb @@ -69,6 +69,13 @@ "# Set your output and project. !!!Must Do before you can proceed!!!\n", "EXPERIMENT_NAME = 'basic_component'\n", "PROJECT_NAME = 'Your-Gcp-Project-Name' #'Your-GCP-Project-ID'\n", + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ "OUTPUT_DIR = 'gs://%s-basic-component' % PROJECT_NAME # A path for asset outputs\n", "BASE_IMAGE = 'google/cloud-sdk:latest' # Base image used in various steps of the pipeline\n", "TARGET_IMAGE = 'gcr.io/%s/component:latest' % PROJECT_NAME # Target image that will include our final code" From 6471f36f0384833f91617fac5950aba62aae5300 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Wed, 18 Sep 2019 14:46:18 -0700 Subject: [PATCH 3/3] Renamed EXPERIMENT_NAME to experiment_name --- samples/core/component_build/component_build.ipynb | 9 +++++---- test/sample-test/configs/component_build.config.yaml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/core/component_build/component_build.ipynb b/samples/core/component_build/component_build.ipynb index 0e45cb99954..899a3c10b2c 100644 --- a/samples/core/component_build/component_build.ipynb +++ b/samples/core/component_build/component_build.ipynb @@ -67,13 +67,14 @@ "outputs": [], "source": [ "# Set your output and project. !!!Must Do before you can proceed!!!\n", - "EXPERIMENT_NAME = 'basic_component'\n", - "PROJECT_NAME = 'Your-Gcp-Project-Name' #'Your-GCP-Project-ID'\n", + "experiment_name = 'basic_component'\n", + "PROJECT_NAME = 'Your-Gcp-Project-Name' #'Your-GCP-Project-ID'\n" ] }, { "cell_type": "code", "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "OUTPUT_DIR = 'gs://%s-basic-component' % PROJECT_NAME # A path for asset outputs\n", @@ -110,9 +111,9 @@ "client = kfp.Client()\n", "\n", "try:\n", - " experiment = client.get_experiment(experiment_name=EXPERIMENT_NAME)\n", + " experiment = client.get_experiment(experiment_name=experiment_name)\n", "except:\n", - " experiment = client.create_experiment(EXPERIMENT_NAME)" + " experiment = client.create_experiment(experiment_name)" ] }, { diff --git a/test/sample-test/configs/component_build.config.yaml b/test/sample-test/configs/component_build.config.yaml index 50e8a0db80a..b74b08ac6ab 100644 --- a/test/sample-test/configs/component_build.config.yaml +++ b/test/sample-test/configs/component_build.config.yaml @@ -14,5 +14,5 @@ test_name: component_build notebook_params: - EXPERIMENT_NAME: component_build-test + experiment_name: component_build-test PROJECT_NAME: ml-pipeline-test