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

[TEP-0135] Update Affinity Assistant documentation #6892

Conversation

QuanZhang-William
Copy link
Member

Part of #6740. This commit updates the Affinity Assistant related documentation to reflect recent changes in the Affinity Assistant modes. This commit also adds a chart summarizing how to configure the Affinity Assistant modes using coschedule and disabled-affinity-assistant feature flags.

/kind documentation

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/documentation Categorizes issue or PR as related to documentation. labels Jun 30, 2023
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 30, 2023
@lbernick lbernick self-assigned this Jun 30, 2023
docs/workspaces.md Outdated Show resolved Hide resolved
docs/workspaces.md Outdated Show resolved Hide resolved
docs/workspaces.md Outdated Show resolved Hide resolved
docs/workspaces.md Outdated Show resolved Hide resolved
docs/workspaces.md Outdated Show resolved Hide resolved
docs/workspaces.md Outdated Show resolved Hide resolved
config/config-feature-flags.yaml Outdated Show resolved Hide resolved
@QuanZhang-William QuanZhang-William force-pushed the tep-0135-coschedule-documentation branch from ccd6bb0 to 7598323 Compare June 30, 2023 18:17
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 30, 2023
@QuanZhang-William QuanZhang-William force-pushed the tep-0135-coschedule-documentation branch from 7598323 to b4cbfa3 Compare June 30, 2023 18:20
<!--
---
linkTitle: "Affinity Assistants"
weight: 405
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why do we need it 😂

docs/affinityassistants.md Outdated Show resolved Hide resolved
docs/affinityassistants.md Outdated Show resolved Hide resolved

**Note:** For users who previously accepting default behavior (enabling affinity assistant) but now want one of the new features, you need to set `disable-affinity-assistant` to "true" and then turn on the new behavior by setting `coschedule` flag. For users who previously disabling the affinity assistant but want one of the new features, just set the `coschedule` flag accordingly.

**Note:** **DO NOT** change the default value of the `coschedule` feature flag since the feature is work in progress and not yet functional. Please **ONLY** toggle the `disabled-affinity-assistant` feature flag to switch between **"disabled"** and **"coschedule workspace"** modes.
Copy link
Member

Choose a reason for hiding this comment

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

coscheduling = disabled is OK right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this is fine. And disable-affinity-assistant : true and coschedule: workspaces will also disabled AA during migration. I put it here just for simplicity as this feature will be completed soon and this note will be removed.

docs/affinityassistants.md Outdated Show resolved Hide resolved
docs/affinityassistants.md Show resolved Hide resolved
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2023
@QuanZhang-William QuanZhang-William force-pushed the tep-0135-coschedule-documentation branch 3 times, most recently from fcddb4a to ebe86a6 Compare June 30, 2023 20:35
Comment on lines 18 to 23
* **coschedule pipelineruns (WIP)** - All `TaskRun` pods within the `PipelineRun` will be scheduled to the same Node.

* **isolate PipelineRun (WIP)** - All `TaskRun` pods within the `PipelineRun` will be scheduled to the same Node,
and only one PipelineRun is allowed to run on a node at a time.
Copy link
Member

Choose a reason for hiding this comment

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

If this functionality isn't available yet, perhaps comment this out for now?

(this gets published as user facing documentation on tekton.dev)

If this is meant to be more contributor focused, consider moving this to a README in the corresponding package or godoc.

Copy link
Member Author

Choose a reason for hiding this comment

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

The implementation for this feature is about to be completed. Maybe we can merge this PR after the feature is fully supported and update this section.

/hold

Comment on lines 27 to 30
This means that Affinity Assistant is incompatible with e.g. other affinity rules
configured for the `TaskRun` pods. If the `PipelineRun` has a custom
[PodTemplate](pipelineruns.md#specifying-a-pod-template) configured, the `NodeSelector` and `Tolerations` fields
will also be set on the Affinity Assistant pod. The Affinity Assistant
is deleted when the `PipelineRun` is completed.
Copy link
Member

Choose a reason for hiding this comment

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

"Incompatible" is a bit ambiguous here - could you explain this a bit more?

Typically when I think of incompatibility I expect either an error to be returned or one field to take precedence over the other. But in this case it doesn't sound like either is what happens, and Affinity Assistants do coexist with PodTemplates? (though I could be misunderstanding something)

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added some explanation for it, Affinity term in PodTemplate will be overwritten by Affinity Assistant if specified:

https://github.com/tektoncd/pipeline/blob/4f6c74a33b59d2bfc5d5ee14e2a9aa67d74b22f9/pkg/reconciler/taskrun/taskrun.go#L752C1-L756C3


The following chart summarizes the Affinity Assistant Modes with different combinations of the `disable-affinity-assistant` and `coschedule` feature flags during migration (when both feature flags are present) and after the migration (when only the `coschedule` flag is present).

**Note:** For users who previously accepted the default behavior (enabling affinity assistant) but now want one of the new features, you need to set `disable-affinity-assistant` to "true" and then turn on the new behavior by setting the `coschedule` flag. For users who previously disabled the affinity assistant but want one of the new features, just set the `coschedule` flag accordingly.
Copy link
Member

Choose a reason for hiding this comment

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

How can I figure out if I previously accepted the default behavior?

Copy link
Member Author

@QuanZhang-William QuanZhang-William Jul 10, 2023

Choose a reason for hiding this comment

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

I have update this part to show the default configmap setting explicitly!


The following chart summarizes the Affinity Assistant Modes with different combinations of the `disable-affinity-assistant` and `coschedule` feature flags during migration (when both feature flags are present) and after the migration (when only the `coschedule` flag is present).

**Note:** For users who previously accepted the default behavior (enabling affinity assistant) but now want one of the new features, you need to set `disable-affinity-assistant` to "true" and then turn on the new behavior by setting the `coschedule` flag. For users who previously disabled the affinity assistant but want one of the new features, just set the `coschedule` flag accordingly.
Copy link
Member

Choose a reason for hiding this comment

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

Side note: it's a bit confusing that to turn on the coscheduling affinity assistant feature, you need to set disable-affinity-assistant=true - the flag names seem to conflict each other. idk if it's too late for this, but you may want to look into renaming these flags.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @wlynch. Yeah, there was quite a long discussion about the naming, default value and how to make the migration less confusing to users while maintaining backward compatibility: tektoncd/community#1025 (comment) and tektoncd/community#1031.

Based on the discussion, it appeared that turning disable-affinity-assistant on or off to honour coschedule is quite personal. This feature is added as an alpha feature, I think we can collect more user feedback before promoting it to beta.


**Note:** For users who previously accepted the default behavior (enabling affinity assistant) but now want one of the new features, you need to set `disable-affinity-assistant` to "true" and then turn on the new behavior by setting the `coschedule` flag. For users who previously disabled the affinity assistant but want one of the new features, just set the `coschedule` flag accordingly.

**Note:** **DO NOT** change the default value of the `coschedule` feature flag since the feature is work in progress and not yet functional. Please **ONLY** toggle the `disabled-affinity-assistant` feature flag to switch between **"disabled"** and **"coschedule workspace"** modes.
Copy link
Member

Choose a reason for hiding this comment

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

You may want to make this warning more prominent - moving this up to the top + ⚠️ / 🚨 emojis + bigger font / bold would help.

We should also try and classify all of these with their stability level to set expectations around breaking changes (by default users will assume stable).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Will add the stability levels for different mode!

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @wlynch. I have removed all the warnings and WIP in the documentation, and we will hold this PR until this feature is fully implemented (#6927 is merged).

I have also added the stability levels for the feature, including adding it to the alpha feature list. PTAL 😄

In the future, the `disable-affinity-assistant` feature flag will be deprecated, and the Affinity Assistant Modes will be only determined by
the `coschedule` feature flag.

The following chart summarizes the Affinity Assistant Modes with different combinations of the `disable-affinity-assistant` and `coschedule` feature flags during migration (when both feature flags are present) and after the migration (when only the `coschedule` flag is present).
Copy link
Member

Choose a reason for hiding this comment

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

This is the first mention of migration - when is this happening?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added 9 month deprecation time to this part


**Note:** **DO NOT** change the default value of the `coschedule` feature flag since the feature is work in progress and not yet functional. Please **ONLY** toggle the `disabled-affinity-assistant` feature flag to switch between **"disabled"** and **"coschedule workspace"** modes.

<table>
Copy link
Member

Choose a reason for hiding this comment

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

As a user / someone who isn't really familiar with this feature, I don't know what this table is supposed to be telling me 😅

Are these the config map values?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. I switched the order of the chart and the notes, so that the chart is now right below its explanations. PTAL

will also be set on the Affinity Assistant pod. The Affinity Assistant
is deleted when the `PipelineRun` is completed.

Currently, the Affinity Assistant Modes can be configured by the `disable-affinity-assistant` and `coschedule` feature flags.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth including the expected config map values somewhere and how they map to the modes above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please see the above comment

@QuanZhang-William QuanZhang-William force-pushed the tep-0135-coschedule-documentation branch from ebe86a6 to d8c299e Compare July 10, 2023 21:27
@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2023
@QuanZhang-William QuanZhang-William force-pushed the tep-0135-coschedule-documentation branch 2 times, most recently from 23530e0 to 561f6f4 Compare July 21, 2023 21:05
Part of [tektoncd#6740][tektoncd#6740]. This commit updates the Affinity Assistant related documentation to reflect recent changes in the Affinity Assistant modes.
This commit also adds a chart summarizing how to configure the Affinity Assistant modes using `coschedule` and `disabled-affinity-assistant` feature
flags.

/kind documentation

[tektoncd#6740]: tektoncd#6740
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2023
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [lbernick,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@QuanZhang-William
Copy link
Member Author

/hold cancel

#6927 is merged

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2023
@tekton-robot tekton-robot merged commit c38c220 into tektoncd:main Jul 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants