diff --git a/samples/notebooks/KubeFlow Pipeline Using TFX OSS Components.ipynb b/samples/notebooks/KubeFlow Pipeline Using TFX OSS Components.ipynb index 20140537808..caa68c93f38 100644 --- a/samples/notebooks/KubeFlow Pipeline Using TFX OSS Components.ipynb +++ b/samples/notebooks/KubeFlow Pipeline Using TFX OSS Components.ipynb @@ -31,7 +31,10 @@ "outputs": [], "source": [ "# Install Pipeline SDK\n", - "!pip3 install https://storage.googleapis.com/ml-pipeline/release/0.1.1/kfp.tar.gz --upgrade" + "!pip3 install https://storage.googleapis.com/ml-pipeline/release/0.1.1/kfp.tar.gz --upgrade\n", + " \n", + "# Component building requires this package. For now you need to install it explicitly.\n", + "!pip3 install kubernetes" ] }, { @@ -84,15 +87,63 @@ "# Note that this notebook should be running in JupyterHub in the same cluster as the pipeline system.\n", "# Otherwise it will fail to talk to the pipeline system.\n", "client = kfp.Client()\n", - "exp = client.create_experiment(name='demo_exp')\n", - "# See Screenshot 1" + "exp = client.create_experiment(name='demo')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test Run a Pipeline" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Copying gs://ml-pipeline-playground/coin.tar.gz...\n", + "/ [1 files][ 978.0 B/ 978.0 B] \n", + "Operation completed over 1 objects/978.0 B. \n" + ] + } + ], + "source": [ + "# Download a pipeline package\n", + "!gsutil cp gs://ml-pipeline-playground/coin.tar.gz ." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "Job link here" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "run = client.run_pipeline(exp.id, 'coin', 'coin.tar.gz')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Define a Pipeline with OSS TFX components\n", + "## Define a Pipeline\n", "\n", "Authoring a pipeline is just like authoring a normal Python function. The pipeline function describes the topology of the pipeline. Each step in the pipeline is typically a ContainerOp --- a simple class or function describing how to interact with a docker container image. In the below pipeline, all the container images referenced in the pipeline are already built. The pipeline starts with a TFDV step which is used to infer the schema of the data. Then it uses TFT to transform the data for training. After a single node training step, it analyze the test data predictions and generate a feature slice metrics view using a TFMA component. At last, it deploys the model to TF-Serving inside the same cluster." ] @@ -270,12 +321,13 @@ } ], "source": [ + "# Compile it into a tar package.\n", "compiler.Compiler().compile(taxi_cab_classification, 'tfx.tar.gz')\n", "\n", + "# Submit a run.\n", "run = client.run_pipeline(exp.id, 'tfx', 'tfx.tar.gz',\n", " params={'output': OUTPUT_DIR,\n", - " 'project': PROJECT_NAME})\n", - "# See Screenshot 2" + " 'project': PROJECT_NAME})" ] }, { @@ -583,8 +635,7 @@ "run = client.run_pipeline(exp.id, 'my-tfx', 'my-tfx.tar.gz',\n", " params={'output': OUTPUT_DIR,\n", " 'project': PROJECT_NAME,\n", - " 'model': 'mytaxi.beta'})\n", - "# See screenshot 3" + " 'model': 'mytaxi.beta'})" ] }, {