<jupyter_start><jupyter_text>Example notebook component pipelineFirst component:*  get's `a`, `b`, `c` inputs from pipeline input.* executes notebook `notebook_step_1.py` that uses those variables and ouputs variable `d` and artifact `x`Second component:* injests variable `d` and artifact `x` from previous step<jupyter_code>from kfn import NbComponentBuilder
import kfp
base_image = 'asia.gcr.io/ppb-services/tensorflow-1.14.0-py3-jupytext-papermill:latest'
packages_to_install = ['pandas', 'matplotlib']
nb = NbComponentBuilder(
    'Task 1', 
    inject_notebook_path='notebook_step_1.py', 
    remove_nb_inputs=True)

nb.add_input_param('a', int, 1)
nb.add_input_param('b', int, 2)
nb.add_input_param('c', int, None)
nb.add_output_param('d', int)
nb.add_output_artifact('x')
first_op = nb.build_op(
    base_image=base_image, 
    packages_to_install=packages_to_install)
nb = NbComponentBuilder(
    'Task 2', 
    inject_notebook_path='notebook_step_2.py')

nb.add_input_artifact('x')
nb.add_input_param('d', int)
second_op = nb.build_op(
    base_image=base_image, 
    packages_to_install=packages_to_install)
# Define pipeline
@kfp.dsl.pipeline(name='Notebook pipeline example')
def notebook_run_pipeline(
    a='a', b='b', c='c'
):
    op1 = first_op(a=a, b=b, c=c)    
    second_op(x=op1.outputs['x'], d=op1.outputs['d'])    

# Run
arguments = {'a': 20, 'b': 30, 'c': 40}
kfp.Client().create_run_from_pipeline_func(notebook_run_pipeline, arguments=arguments)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1378162450066578, 'fraction_numerical': 0.013981358189081226, 'mean_word_length': 6.056338028169014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '115586', 'license': 'MIT', 'n_tokens_mistral': 581, 'n_tokens_neox': 559, 'n_words': 107, 'path': 'examples/basic_pipeline/pipeline.ipynb', 'repo_name': 'bartgras/kf-notebook-component', 'size': '1502'}