Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kubernetes annotations #2868

Merged
merged 5 commits into from
Aug 10, 2022
Merged

Add support for Kubernetes annotations #2868

merged 5 commits into from
Aug 10, 2022

Conversation

ptitzler
Copy link
Member

@ptitzler ptitzler commented Aug 5, 2022

This PR adds support for Kubernetes annotations for Kubeflow Pipelines and Apache Airflow runtime environments.

Annotations are supported for generic components and custom components and can be defined as pipeline defaults or for individual nodes.

Input needs to be entered as a string using the annotation_key=annotation_value format until proper UI support (#2780) is released.

Annotation keys are validated according to this spec.

Closes #2849

Pipeline default settings in VPE
Displayed in section "Node defaults" (Settings in this section apply to all nodes):

image

Generic node setting in VPE

image

Custom node setting in VPE
Displayed in section "Additional properties"

image

Applied annotations (KFP)

Example describe pod output (KFP)

$ kubectl describe pod lambda-... -n kubeflow-user-example-com
Name:         lambda-6sj47-3256227022
Namespace:    kubeflow-user-example-com
Priority:     0
Node:         cloning1.fyre.ibm.com/9.30.189.14
Start Time:   Sun, 07 Aug 2022 22:57:16 -0700
Labels:       pipeline/runid=e0b80cae-9c4b-4e89-a594-0b7c7eb55c16
             pipelines.kubeflow.org/cache_enabled=true
             pipelines.kubeflow.org/cache_id=
             pipelines.kubeflow.org/enable_caching=true
             pipelines.kubeflow.org/kfp_sdk_version=1.8.13
             pipelines.kubeflow.org/metadata_context_id=1
             pipelines.kubeflow.org/metadata_execution_id=1
             pipelines.kubeflow.org/metadata_written=true
             pipelines.kubeflow.org/pipeline-sdk-type=kfp
             workflows.argoproj.io/completed=true
             workflows.argoproj.io/workflow=lambda-6sj47
Annotations:  a-to-Z: soup to nuts
             annotationA: annotation default  A
             pipelines.kubeflow.org/arguments.parameters: {"URL": "http://www.bing.com"}
             pipelines.kubeflow.org/component_ref: {"digest": "8e4384f422a088e4814024df7955e952c1488bd091fa0d4873d5f611d741ceb4"}

Applied annotations (Airflow)

The applied annotations can be inspected using the kubectl describe pod command or in the DAG task instance details page in the Airflow UI:

image

Notes:

  • Status (if checked, functionality is implemented and was verified):
    • Pipeline editor: validation
    • KFP generic node property
    • KFP custom node property
    • KFP pipeline default
    • Airflow generic node property
    • Airflow custom node property
    • Airflow pipeline default

What changes were proposed in this pull request?

  • Added new optional 'Kubernetes pod annotations' pipeline default property
  • Added new optional 'Kubernetes pod annotations' node property
  • Updated the user_guide/pipelines.html documentation

How was this pull request tested?

  • Added new validation tests
  • Manual testing (see scope and status in previous section)
  • Reviewed output of make docs

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@ptitzler ptitzler added kind:enhancement New feature or request component:pipeline-editor pipeline editor component:pipeline-runtime issues related to pipeline runtimes e.g. kubeflow pipelines status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. labels Aug 5, 2022
@ptitzler ptitzler added this to the 3.11.0 milestone Aug 5, 2022
@elyra-bot
Copy link

elyra-bot bot commented Aug 5, 2022

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

@ptitzler ptitzler marked this pull request as draft August 5, 2022 14:41
@ptitzler ptitzler marked this pull request as ready for review August 8, 2022 12:36
@ptitzler ptitzler changed the title [WIP] Add support for Kubernetes annotations Add support for Kubernetes annotations Aug 8, 2022
@ptitzler ptitzler removed the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Aug 8, 2022
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ptitzler - this will be extremely useful!

Copy link
Member

@kiersten-stokes kiersten-stokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my scenarios are testing as expected!

(Also, 20 files changed, wow! Hoping to reduce that for future params with some upcoming re-factoring 🤞 )

@ptitzler ptitzler merged commit 17d8aea into main Aug 10, 2022
@ptitzler ptitzler deleted the annotations branch August 10, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:pipeline-editor pipeline editor component:pipeline-runtime issues related to pipeline runtimes e.g. kubeflow pipelines kind:enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to specify annotation for steps execution pods
3 participants