-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Validate conditions for affinity assistant to operate correctly #2864
Comments
I wonder if there is another option, c) decide that using the affinity assistant for the multiple-workspace run will not work and fallback to running without it, emitting a warning. |
multiple-workspace run will work with the affinity assistant - as long as multiple workspaces is not used by the same task. and multi-PVC-tasks should not be used in Tasks - they will most likely deadlock in regional clusters sometimes as what happened in #2546 |
nice, thanks for clarifying! |
I can have a look at this. /assign |
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
I'm facing this issue for 2 nodes in a same single AZ and a pipelinerun which uses multiple pvcs and some tasks which also use multiple pvcs. @jlpettersson , what is the suggested approach for avoiding multi-PVC tasks? In my use case, as part of a pipeline, I have a task which builds an application, and it does so based on 3 volumes: 1 with the git code and 2 with dependencies (which are retained across runs). Even if I put the dependencies together in a single pvc, I still can't make it work with less than 2, so I could use some guidance on how to best handle this. Thank you. |
As a generic solution, I suggests using subPaths of the same PVC volume. See the example with different subPaths: https://github.com/tektoncd/pipeline/blob/master/examples/v1beta1/pipelineruns/pipelinerun-using-different-subpaths-of-workspace.yaml
There is probably multiple different solutions for this. It also depends on what storage solutions is available for you.
Do you keep the volume, and mount it in access mode As a generic suggestion for this, I would recommend to store your dependencies in a bucket e.g. GCS or S3, when a new
the following tasks, can see both source files and dependencies from different directories of the workspace, or they can use two workspaces with the same subPaths as the two initial tasks. |
Thank you. With that approach I can have the 2 dependency volumes be used in a single one.
I'm currently using AWS default EBS which I know can pose issues when nodes go across availability zones, but for now I'm having my tekton pipelines and tasks in a single availability zone to avoid volume affinity handling complexity.
Currently I'm using the PVCs with access mode of
Thank you for the suggestion. It's nice that there are ways to work around this, although I hope that Tekton continues to support multi-PVC tasks because they are powerful and simpler to use, and if there are situations which can cause deadlocks in regional clusters they can probably still be addressed by continuing to improve the affinity assistant, its documentation, and the capabilities to further label/annotate/mark in other ways the tasks, pipelines and volumes, so that the affinity assistant can have a more complete view for influencing the pods scheduling and volume binding, or even for the system to be able to give early feedback about potentially problematic configurations. |
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in #2829 (comment) Closes #2864
A TaskRun that mount more than one PVC-backed workspace is incompatible with the Affinity Assistant. But there is no validation if the TaskRun is compatible - so the TaskRun Pod is stuck with little information on why to the user. This commit adds validation of TaskRuns. When a TaskRun is associated with an Affinity Assistant, it is checked that not more than one PVC workspace is used - if so, the TaskRun will fail with a TaskRunValidationFailed condition. Proposed in tektoncd#2829 (comment) Closes tektoncd#2864
Expected Behavior
Tekton validates whether a TaskRun's or PipelineRun's volume configuration will be impossible to manage with the Affinity Assistant.
Actual Behavior
Currently it's possible to get into a situation where tasks wait forever to start due to use of multiple persistent volumes as workspaces. Ideally we should validate that this will happen and either a) reject the taskrun / pipelinerun with a clear validation error or b) fail the runs early with a clear error reason + message.
Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: