Skip to content

Commit 4f0c18e

Browse files
author
Jonny Browning (Datatonic)
authored
docs: Add code sample for Pipelines (#684)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-aiplatform/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Fixes #683 🦕
1 parent af809b0 commit 4f0c18e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,47 @@ To delete an endpoint:
349349
endpoint.delete()
350350
351351
352+
Pipelines
353+
---------
354+
355+
To create a Vertex Pipeline run:
356+
357+
.. code-block:: Python
358+
359+
# Instantiate PipelineJob object
360+
pl = PipelineJob(
361+
# Display name is required but seemingly not used
362+
# see https://github.com/googleapis/python-aiplatform/blob/9dcf6fb0bc8144d819938a97edf4339fe6f2e1e6/google/cloud/aiplatform/pipeline_jobs.py#L260
363+
display_name="My first pipeline",
364+
365+
# Whether or not to enable caching
366+
# True = always cache pipeline step result
367+
# False = never cache pipeline step result
368+
# None = defer to cache option for each pipeline component in the pipeline definition
369+
enable_caching=False,
370+
371+
# Local or GCS path to a compiled pipeline definition
372+
template_path="pipeline.json",
373+
374+
# Dictionary containing input parameters for your pipeline
375+
parameter_values=parameter_values,
376+
377+
# GCS path to act as the pipeline root
378+
pipeline_root=pipeline_root,
379+
)
380+
381+
# Execute pipeline in Vertex
382+
pl.run(
383+
# Email address of service account to use for the pipeline run
384+
# You must have iam.serviceAccounts.actAs permission on the service account to use it
385+
service_account=service_account,
386+
387+
# Whether this function call should be synchronous (wait for pipeline run to finish before terminating)
388+
# or asynchronous (return immediately)
389+
sync=sync
390+
)
391+
392+
352393
Explainable AI: Get Metadata
353394
----------------------------
354395

0 commit comments

Comments
 (0)