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 tolerations #2848

Merged
merged 17 commits into from
Aug 12, 2022

Conversation

ptitzler
Copy link
Member

@ptitzler ptitzler commented Jul 22, 2022

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

Deviations from the specification:

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

Pipeline default settings in VPE

  • Displayed in section "Node defaults":
    image

Generic node setting in VPE
image

Custom node setting in VPE

  • Displayed in section "Additional properties"
    image

Applied tolerations (KFP)

Confirmation that the tolerations are applied on the pod

  • Top: output of kubectl describe pod lambda-...
  • Bottom: Pod summary in Kubeflow central dashboard
    image

Notes:

What changes were proposed in this pull request?

  • Added new optional 'Kubernetes tolerations' pipeline default property
  • Added new optional 'Kubernetes tolerations' node property
  • Updated documentation

How was this pull request tested?

  • Added new validation tests
  • Manual testing (see scope and status in previous section)

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 Jul 22, 2022
@ptitzler ptitzler added this to the 3.11.0 milestone Jul 22, 2022
@elyra-bot
Copy link

elyra-bot bot commented Jul 22, 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 July 22, 2022 01:45
@kevin-bates
Copy link
Member

[Requires discussion] The current UI support for list-based properties requires input in the form SOME_KEY=SOME_VALUE. Of the inputs (key, operator, value, and effect) only operator is required, which in essence means that (while this is a work in progress) input would need to be specified as =::.

I think the key value must be used in the key position otherwise, you could only apply two taints max (one for Exists and one for Equal) if using operator since the set of key/values maps to a dictionary. Since the empty key indicates that the taint applies to all keys, perhaps we could let a key value of '*' indicate this behavior and keep key in the key position.

@ptitzler ptitzler marked this pull request as ready for review August 4, 2022 09:23
@ptitzler ptitzler changed the title [WIP] Add support for Kubernetes tolerations Add support for Kubernetes tolerations Aug 4, 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 4, 2022
@akchinSTC akchinSTC self-requested a review August 8, 2022 15:34
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.

This looks great! I added some taints to one of the KFP RTCs (since untainted) and it's working well for me. Same with all the validation stuff.

I think the chosen key=value format makes sense for the current implementation, especially for overriding pipeline default values. It also seems in line with how taints are specified via kubectl. Plus I'm not sure one way would be all that better than any other until RJSF support is in. Approving now, but should this format be changed before merge, I'll re-review

@ptitzler ptitzler added the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Aug 10, 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 10, 2022
Copy link
Member

@akchinSTC akchinSTC left a comment

Choose a reason for hiding this comment

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

Changes LGTM.
Maybe sometime in the future if we continue to add and expose even more k8s api parameters, we can put them into a "advanced properties" section with an arrow toggle dropdown to make things cleaner ..
e.g. >, v

@ptitzler
Copy link
Member Author

ptitzler commented Aug 11, 2022

Re-confirmed* that after the merge the following scenarios yield the expected results

  • run pipeline with generic component (KFP)
  • run pipeline with generic component (Airflow)
  • export pipeline with generic component (KFP)
  • export pipeline with generic component (Airflow)
  • run pipeline with custom component (KFP)
  • run pipeline with custom component (Airflow)
  • export pipeline with custom component (KFP)
  • export pipeline with custom component (Airflow)

(*) by inspecting

  • exported DAG
  • checking the output of kubectl describe pod ...
  • task instance details properties (Airflow)
  • pod log in Central dashboard (KFP)

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.

New changes to the handling of <4-part values looks good!

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
4 participants