-
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
Help Scheduler make the right choice #3824
Comments
Yes, these are a weak point with Tekton currently. I feel this problem is similar to #3049 I have tried to elaborate about similar problems in Design doc: Task parallelism when using workspace and a potentially viable solution (but require lot of work) for this is to run the whole PipelineRun within a Pod (such that Kubernetes can be responsible for the scheduling and potential autoscaling). I have suggested to address this problem in TEP-0046 Colocation of Tasks and Workspaces (formerly PipelineRun in a Pod) |
From the k8s documentation:
|
hey @bdurrow - it seems like maybe part of the problem is that the variable replacement you're trying to do isn't working, is that right? e.g.: resources:
requests:
cpu: $(params.cpu)
ephemeral-storage: $(params.ephemeral-storage)
memory: $(params.memory) Looking at the list of fields that accept variable replacement it doenst look like the resource requests (or limits) are in there - im sure we'd be happy to add them tho! I guess that only helps you with the pre-allocate Task though and not the rest of the problem 🙃 It sounds like the other thing that you might want is some way to express resource requests at a Pipeline level 🤔 vs having to include your pre-allocate task |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Feature request
Through some mechanism provide the scheduler enough information so that the workspace PV(s) are scheduled somewhere the pipeline can complete. Nice to have, if a node scale-up is required allow that to happen while other less resource intensive tasks are being performed.
Use case
As a cluster admin I would like to run pipelines that are hard to schedule due to resource constraints in the cluster.
Consider the following pipeline:
(git-clone) -> (build) -> (test) -> (copy-assets)
The test task in my pipeline is hard to schedule, it requires 75% of the CPU and Memory of a node.
I have a cluster divided across 3 availability zones, each PV is only available in a single availability zone. I have Machine Autoscaler for each availability zone that can scale up a new node but some of the Autoscalers may be at their limit and will not create any additional nodes.
When the git-clone task is scheduled it doesn't provide enough "hints" to the scheduler so that the PV gets created in an availability zone where the test task can be completed. The "affinity-assistant" tends to make matters worse.
I can currently work around this limitation (assuming affinity-assistant is disabled) by adding a task that has resource requests that match the test task so my pipeline looks like this:
(preallocate-resources) -> (git-clone) -> (build) -> (test) -> (copy-assets)
This is an ugly hack especially because I can no longer parameterize the resource requests due to this validation failure (for reference I am including my
task__reallocate-resources.yaml
at the end of this issue):Additionally, the affinity-assistant feature breaks this workaround because the affinity-assitant pod is scheduled before the first task pod.
Even before implementing the preallocate-resources workaround described above I set a priorityClassName attribute on the test task that is slightly higher than default and allows for preemption. This allows the scheduler to evict pods from a node in order to make space for the test task pod. I'm not sure exactly why but when the affinity-assistant feature is enabled this workaround doesn't appear to work any longer.
I know that documentation states in many places to use a limitRange to automatically provide for resource allocation for the pods. I feel that limitRanges are a poor solution to the problem. It seems that every pod schedule in the namespace will use this limitRange so in my use case the test task pod would never schedule because the affinity-assistant pod has such large resource requests.
For reference
task__preallocate-resources.yaml
which fails validation:The text was updated successfully, but these errors were encountered: