Mitch
06/04/2024, 12:24 AMJob 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started.
04:53:40 PM
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2024-06-03 23:45:20+00:00: Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch
04:53:43 PM
prefect.flow_runs.worker
Pod event 'TriggeredScaleUp' at 2024-06-03 23:49:22+00:00: pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}]
04:53:43 PM
prefect.flow_runs.worker
Pod event 'FailedScheduling' (5 times) at 2024-06-03 23:51:06+00:00: 0/17 nodes are available: 12 Insufficient <http://nvidia.com/gpu|nvidia.com/gpu>, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
04:53:43 PM
prefect.flow_runs.worker
Reported flow run '1977ce58-36f6-4095-8a6c-cd08ffd8e2ab' as crashed: Flow run infrastructure exited with non-zero status code -1.
Marvin
06/04/2024, 12:24 AMHow am I getting the below error when the flow is already started and doesn't create any other subflows...```Job 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started. 045340 PM prefect.flow_runs.worker Job event 'SuccessfulCreate' at 2024-06-03 234520+0000 Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch 045343 PM prefect.flow_runs.worker Pod event 'TriggeredScaleUp' at 2024-06-03 234922+0000 pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}] 045343 PM prefect.flow_runs.worker Pod event 'FailedScheduling' (5 times) at 2024-06-03 235106+0000 0/17 nodes are available: 12 Insufficient nvidia.com/gpu, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes
Mitch
06/04/2024, 12:25 AMJob 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started.
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2024-06-03 23:45:20+00:00: Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch
prefect.flow_runs.worker
Pod event 'TriggeredScaleUp' at 2024-06-03 23:49:22+00:00: pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}]
prefect.flow_runs.worker
Pod event 'FailedScheduling' (5 times) at 2024-06-03 23:51:06+00:00: 0/17 nodes are available: 12 Insufficient <http://nvidia.com/gpu|nvidia.com/gpu>, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
prefect.flow_runs.worker
Reported flow run '1977ce58-36f6-4095-8a6c-cd08ffd8e2ab' as crashed: Flow run infrastructure exited with non-zero status code -1.
Marvin
06/04/2024, 12:25 AMHow am I getting the below error when the flow is already started and doesn't create any other subflows...```Job 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started. prefect.flow_runs.worker Job event 'SuccessfulCreate' at 2024-06-03 234520+0000 Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch prefect.flow_runs.worker Pod event 'TriggeredScaleUp' at 2024-06-03 234922+0000 pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}] prefect.flow_runs.worker Pod event 'FailedScheduling' (5 times) at 2024-06-03 235106+0000 0/17 nodes are available: 12 Insufficient nvidia.com/gpu, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful
Mitch
06/04/2024, 12:26 AMJob 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started.
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2024-06-03 23:45:20+00:00: Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch
prefect.flow_runs.worker
Pod event 'TriggeredScaleUp' at 2024-06-03 23:49:22+00:00: pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}]
prefect.flow_runs.worker
Pod event 'FailedScheduling' (5 times) at 2024-06-03 23:51:06+00:00: 0/17 nodes are available: 12 Insufficient <http://nvidia.com/gpu|nvidia.com/gpu>, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
Marvin
06/04/2024, 12:26 AMHow am I getting the below error when the flow pod is already started and showing progress...```Job 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started. prefect.flow_runs.worker Job event 'SuccessfulCreate' at 2024-06-03 234520+0000 Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch prefect.flow_runs.worker Pod event 'TriggeredScaleUp' at 2024-06-03 234922+0000 pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}] prefect.flow_runs.worker Pod event 'FailedScheduling' (5 times) at 2024-06-03 235106+0000 0/17 nodes are available: 12 Insufficient nvidia.com/gpu, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
Mitch
06/04/2024, 12:26 AMJob 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started.
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2024-06-03 23:45:20+00:00: Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch
prefect.flow_runs.worker
Pod event 'TriggeredScaleUp' at 2024-06-03 23:49:22+00:00: pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}]
prefect.flow_runs.worker
Pod event 'FailedScheduling' (5 times) at 2024-06-03 23:51:06+00:00: 0/17 nodes are available: 12 Insufficient <http://nvidia.com/gpu|nvidia.com/gpu>, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
Marvin
06/04/2024, 12:26 AMHow am I getting the below error when the flow pod is already started and showing progress```Job 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started. prefect.flow_runs.worker Job event 'SuccessfulCreate' at 2024-06-03 234520+0000 Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch prefect.flow_runs.worker Pod event 'TriggeredScaleUp' at 2024-06-03 234922+0000 pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}] prefect.flow_runs.worker Pod event 'FailedScheduling' (5 times) at 2024-06-03 235106+0000 0/17 nodes are available: 12 Insufficient nvidia.com/gpu, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
Mitch
06/04/2024, 12:26 AMJob 'clip-processing-clip-01-001-0hdiwva2-t65g5': Pod never started.
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2024-06-03 23:45:20+00:00: Created pod: clip-processing-clip-01-001-0hdiwva2-t65g5-hgbch
prefect.flow_runs.worker
Pod event 'TriggeredScaleUp' at 2024-06-03 23:49:22+00:00: pod triggered scale-up: [{eks-managed-ondemand-gpu-2x-20240410221932672100000001-9ec7650c-23fb-ae15-a964-710268245289 17->19 (max: 20)}]
prefect.flow_runs.worker
Pod event 'FailedScheduling' (5 times) at 2024-06-03 23:51:06+00:00: 0/17 nodes are available: 12 Insufficient <http://nvidia.com/gpu|nvidia.com/gpu>, 5 node(s) didn't match Pod's node affinity/selector. preemption: 0/17 nodes are available: 12 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling..
Marvin
06/04/2024, 12:27 AM<http://nvidia.com/gpu|nvidia.com/gpu>
resource is correctly advertised by the nodes.
shell
kubectl get nodes -o json | jq '.items[].status.allocatable'
2. Review Node Affinity Rules:
- Double-check the node affinity rules defined in your pod specification to ensure they're not overly restrictive.
Example affinity settings:
yaml
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: <http://nvidia.com/gpu|nvidia.com/gpu>
operator: Exists
3. Kubernetes Cluster Scaling:
- If using a managed Kubernetes service (like EKS), ensure the cluster can scale to accommodate the demand for GPU nodes.
4. Pod Scheduling Insights:
- Investigate pod events and descriptions to get more details on scheduling failures.
shell
kubectl describe pod <pod-name>
kubectl get events --sort-by='.metadata.creationTimestamp'
### Relevant Discussions and Issues:
- Adding more detail to k8s agent logs when pod never starts: Discusses improving log details for pod startup failures.
- Scheduling Failures and Affinity Issues:
- Ensure node affinity and tolerations are correctly configured.
- Review Kubernetes scheduling documentation for more insights.
### Documentation Links:
- Prefect Kubernetes Quickstart
- Prefect Deployment Configurations
By verifying the above, you should be able to pinpoint and resolve the resource and scheduling constraints preventing your pods from starting.Mitch
06/04/2024, 12:30 AMMarvin
06/04/2024, 12:30 AMFailedScheduling
errors indicate that nodes were having trouble meeting the required resources (`nvidia.com/gpu`).
2. Multiple Pods in a Single Flow:
- It’s possible that Prefect is trying to auto-scale or create multiple instances due to workload distribution strategies. According to this GitHub issue, autoscaling can sometimes lead to pods being started multiple times, especially in environments like GKE Autopilot.
3. Flow Configuration Insights:
- In the Prefect documentation, deployments with work pools and base job templates can lead to multiple pods being created depending on the configuration and tasks at hand. For more details, see the Prefect Deployments documentation.
### Potential Solutions & Further Investigation:
1. Check Configuration and Reconcile Resources:
- Ensure that your Kubernetes cluster nodes have sufficient resources and are correctly labeled to meet the demands of your pods.
- Re-evaluate node affinity and resource requests in your Kubernetes jobs.
2. Review Flow Setup and Autoscaling:
- Review the flow and task configuration to make sure that tasks aren’t unintentionally causing new pods to spin up.
- Consider adjusting the autoscaling settings, especially if using GKE Autopilot or similar managed services that handle autoscaling automatically.
3. Pod Event Logs:
- Investigate the Kubernetes pod events and logs to get more details on why rescheduling or new pod creation was triggered. Use:
sh
kubectl get events --sort-by='.metadata.creationTimestamp'
kubectl describe pod <pod-name>
### Useful Links:
- Prefect Deployments Documentation
- GitHub Issue on Multiple Pod Spawning
- Configuring Node Affinity and Tolerations in Kubernetes
If after checking these points the issue persists, more context from Kubernetes logs and Prefect flow definitions might be necessary to troubleshoot further.Mitch
06/04/2024, 12:31 AMMarvin
06/04/2024, 12:31 AMDaskExecutor
with Kubernetes, tasks can be distributed across multiple Dask workers, which may run in separate pods.
- This ties back to how Dask handles scaling and task distribution rather than Prefect inherently spinning up pods for individual tasks.
### Related Documentation Excerpts:
- From Prefect Concepts: Deployments:
- Deployments can define how individual flow runs are submitted to infrastructure (source).
- From GitHub Issues:
- Mapped tasks trigger multiple times on GKE Autopilot: Users have noticed mapped tasks may trigger more instances, especially with auto-scaling infrastructure.
### Task Execution Strategy:
- Mapped Tasks:
- Running tasks in a mapped manner (task.map()
) can distribute the workload across multiple workers, which in turn can cause multiple pods to be started if done via Dask or similar executors.
- This is particularly prevalent in complex or large flows where ConcurrentTaskRunner
is used.
### Summary:
- Tasks themselves do not spin up new pods directly.
- Flows associated with pod management can create new pods, particularly influenced by configuration, scaling policies, and the deployment setup.
- Using mappers and distributed execution frameworks like Dask can lead to seeing more pod activity if the executor scales out pods to handle the task workload.
For deeper insight into a particular behavior in your setup, ensure to check the deployment and execution configuration, and consider how adaptive scaling may be affecting pod creation.