Hey BuildKite team, what is the best way to set cancel-grace-period
? Should we set it as an ENV var for the agent? Where would we set that ENV var? I noticed that there’s an agent-config
in the agent-stack-k8s configuration but cancel-grace-period
is not an available option.
Hi @jonathanyeong ,
This is Suma from Buildkite support team. Thank you for reaching out to us with your question.
There are couple of approaches you can take, one is to define env BUILDKITE_CANCEL_GRACE_PERIOD
at pipeline level or if you are using custom agent image then in the config file provided to that agent image you can configure it so all pipelines running on the stack will get this.
Please let us know if you have any questions.
Thanks,
Suma
Hey @suma thank you so much for the reply!
We’re using agent-stack-k8s
will that pick up the env var BUILDKITE_CANCEL_GRACE_PERIOD
if it’s set at the pipeline level?
agents:
queue: kubernetes
env:
BUILDKITE_CANCEL_GRACE_PERIOD: 1800 # 30 minutes
steps:
<steps here>
It seems like the agent isn’t picking up the grace period even though I can see the environment variable set on the containers.
Hey @jonathanyeong,
Please share the agent version you are using so I can perform a test on my end to see why it is not working even though env is available.
Thanks,
Suma
We’re running agent-stack-k8s
0.19.2 which I believe runs agent 3.87.0
.
Hey @jonathanyeong,
I also performed a test and can see that the cancel grace period is getting set. Please send us an email at support@buildkite.com with the build you ran where you see it did not respect the cancel grace period so we can take a further look into this issue.
Thanks,
Suma