Skip to content
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

add a rety option to the step command #1585

Merged
merged 4 commits into from
Jan 13, 2025
Merged

add a rety option to the step command #1585

merged 4 commits into from
Jan 13, 2025

Conversation

lewismarshall
Copy link
Contributor

@lewismarshall lewismarshall commented Jan 10, 2025

This adds flags to allow for commands to be retried with backoff (at this time all commands) but simple.

Regression test

13:44 $ docker run -it --entrypoint /bin/step europe-west2-docker.pkg.dev/appvia-hub/terranetes-executor-step-up/wf-step:1.0.4 --comment=gogo --command=true

=======================================================
GOGO
=======================================================
INFO[0000] successfully executed the step
✔ ~/projects/appvia/terranetes-controller [add-retry-to-step|✚ 2]
13:44 $ docker run -it --entrypoint /bin/step europe-west2-docker.pkg.dev/appvia-hub/terranetes-executor-step-up/wf-step:1.0.4 --comment=gogo --command=false

=======================================================
GOGO
=======================================================
ERRO[0000] command execution failed                      attempt=0 command=0 error="exit status 1"
Error: command failed after 1 attempts: exit status 1
[Error] command failed after 1 attempts: exit status 1
✘-1 ~/projects/appvia/terranetes-controller [add-retry-to-step|✚ 2]

New functionality

13:44 $ docker run -it --entrypoint /bin/step europe-west2-docker.pkg.dev/appvia-hub/terranetes-executor-step-up/wf-step:1.0.4 --comment=gogo --command=false --retry-attempts=3 --retry-min-backoff=3s --retry-max-jitter=5s

=======================================================
GOGO
=======================================================
ERRO[0000] command execution failed                      attempt=0 command=0 error="exit status 1"
INFO[0000] retrying command                              attempt=1 backoff=7.94378454s command=0
ERRO[0007] command execution failed                      attempt=1 command=0 error="exit status 1"
INFO[0007] retrying command                              attempt=2 backoff=3.351980995s command=0
ERRO[0011] command execution failed                      attempt=2 command=0 error="exit status 1"
INFO[0011] retrying command                              attempt=3 backoff=6.35325038s command=0
ERRO[0017] command execution failed                      attempt=3 command=0 error="exit status 1"
Error: command failed after 4 attempts: exit status 1
[Error] command failed after 4 attempts: exit status 1

cmd/step/main.go Outdated Show resolved Hide resolved
cmd/step/main.go Outdated Show resolved Hide resolved
Copy link
Member

@gambol99 gambol99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gambol99 gambol99 merged commit c327b00 into master Jan 13, 2025
11 checks passed
@gambol99 gambol99 deleted the add-retry-to-step branch January 13, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants