Replies: 6 comments 10 replies
-
Are there any plans to support this feature? 🤔 |
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
-
A really great idea would be if one could specify a pool of pods (a workflow pod pool) and these pods would be kept "hot" for workflows to use. For example, let's say I have a task that requires a large ML model to be loaded into memory (which can take minutes depending on the size), and I have several workflows and/or tasks within a workflow that all use it. What I want is that Pod to be kept "hot" (running) while workflows are ran instead of each workflow spawning the same Pod over and over again and incurring the initial startup/scheduling costs over and over again. The container template would work for some use cases (keep inference steps together maybe) but comes with a lot of limitations. |
Beta Was this translation helpful? Give feedback.
-
The solution we adopted is to use HTTP/Plugin Template instead of Container Template. |
Beta Was this translation helpful? Give feedback.
-
Do you want to use a service that is already running in the cluster, such as Vincent diagram, and then all workflows will call this service, and then have some input and get some output? Probably you can use this: https://argo-workflows.readthedocs.io/en/release-3.5/async-pattern/ |
Beta Was this translation helpful? Give feedback.
-
One hacky workaround using daemon containers to reuse a pod: Working example: apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: kubectl-daemon-loop
spec:
entrypoint: main
templates:
- name: main
steps:
- - name: run-daemon
template: daemon
- - name: lookup-pod-name
template: lookup-pod-name
arguments:
parameters:
- name: daemon-ip
value: "{{steps.run-daemon.ip}}"
- - name: exec-in-daemon
template: exec-command
arguments:
parameters:
- name: daemon-pod-name
value: "{{steps.lookup-pod-name.outputs.parameters.pod-name}}"
- name: command
value: "{{item}}"
withItems: # or use withSequence
- ls / | head -n 3
- ls / | head -n 4
- ls / | head -n 5
- ls / | head -n 6
- name: daemon
daemon: true
container:
image: busybox
command: ["sh", "-c", "tail -f /dev/null"]
nodeSelector:
kubernetes.io/os: linux
- name: lookup-pod-name
inputs:
parameters:
- name: daemon-ip
outputs:
parameters:
- name: pod-name
valueFrom:
path: /tmp/pod-name.txt
container:
image: bitnami/kubectl
command: [sh, -c]
args:
- |
POD_NAME=$(kubectl get pods -n argo -o custom-columns=NAME:.metadata.name --no-headers --field-selector status.podIP="{{inputs.parameters.daemon-ip}}") &&\
echo $POD_NAME &&\
echo -n $POD_NAME > /tmp/pod-name.txt
nodeSelector:
kubernetes.io/os: linux
- name: exec-command
inputs:
parameters:
- name: daemon-pod-name
- name: command
container:
image: bitnami/kubectl
command: [sh, "-c"]
args: ["kubectl exec {{inputs.parameters.daemon-pod-name}} -- {{inputs.parameters.command}}"]
nodeSelector:
kubernetes.io/os: linux |
Beta Was this translation helpful? Give feedback.
-
Instead of creating a new pod per task Argo could look if there is an existing pod available and use it. I guess this would increase performance because it wouldn't need to create it again.
Beta Was this translation helpful? Give feedback.
All reactions