Open hmoulart opened 2 months ago
We propose adding a new command to the Argo CLI:
argo suspend-all
There is already a keyword @latest
in the CLI, so rather than a new command, it could be a new keyword @all
through scripted solutions is inefficient and time-consuming, often taking up to 30 minutes for 500+ workflows.
argo cron list -o name | awk '{print "argo cron suspend "$1}' | bash
If I'm not mistaken, this is being run in serial, hence the slow throughput. Parallelizing this should be substantially faster.
Note: A similar demand was raised on Apr 11, 2023 (#10876)
Also that and your above command are for argo cron suspend
, not argo suspend
. Please differentiate the two
Behavior
Having a confirmation, progress bar, etc is quite complicated and involved; I would strongly suggest having an MVP for a first pass rather than all these requirements.
Retrieving all Workflows and then suspending one by one for progress reporting is also multiple API requests, whereas nearly all the CLI commands correspond 1-to-1 to an API method. That ensures consistency and simplicity
Hello,
Thank you for your answer and suggestions!
I've updated the description to simplify the behavior. I'm going to try parallelizing the command:
argo cron list -o name | xargs -P 4 -I {} argo cron suspend {}
This command uses xargs
with the -P
flag to run up to 4 parallel processes, which should improve performance when suspending multiple cron workflows. The -I {}
flag allows us to use {}
as a placeholder for each workflow name.
Let me know if you need any further clarification or have any questions about this approach.
I've updated the description to simplify the behavior
It looks like you only removed the progress bar element? I would suggest, rather than removing, split the "Behavior" section with a subsection called "Stretch Goals", and move certain features like progress bar there
Proposal:
argo cron suspend-all
/argo cron resume-all
CommandBackground and Motivation
Currently, Argo Workflows lacks a native way to suspend multiple workflows simultaneously. Users managing large-scale deployments (500+ workflows) face significant time and resource constraints when trying to suspend all workflows, especially in critical situations requiring quick action.
The existing method of suspending workflows individually or through scripted solutions is inefficient and time-consuming, often taking up to 30 minutes for 500+ workflows. This limitation poses a significant operational challenge and may impact system performance and reliability in production environments.
Note: A similar demand was raised on Apr 11, 2023 (https://github.com/argoproj/argo-workflows/issues/10876), but the proposal was incomplete and did not gain traction. This proposal aims to provide a more comprehensive and actionable solution to address this long-standing need.
Proposed Feature
We propose adding a new command to the Argo CLI:
argo cron suspend-all
. This command would provide a native, efficient way to suspend multiple workflows at once, significantly improving the management of large-scale Argo Workflows deployments.Command Syntax
Parameters
-n, --namespace
: Specify the namespace (optional, defaults to the current namespace)--selector
: Label selector to filter workflows (optional)--dry-run
: Print the workflows that would be suspended without actually suspending them--force
: Skip confirmation promptBehavior
--force
is used).Example Usage
Implementation Considerations
resume-all
command for easy reversal of this operation.Benefits
Next Steps
We believe this feature would greatly enhance Argo Workflows' capabilities in managing large-scale deployments and improve overall user experience.