-
Notifications
You must be signed in to change notification settings - Fork 57
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
deployment errors leave deployments paused in OCP #860
Comments
I guess the trick is to query only the non-paused DCs :) in both code blocks ... |
yes. but this leads to "unattended" rollouts. |
|
Phew, tricky! The pausing/resuming logic seems to have been added in #686, in order to add further labels to the resources without causing multiple rollouts. In general, I personally think there are a couple of underlying issues:
@clemensutschig so ... I think your idea of "query only the non-paused DCs" works, but it feels like a band-aid to me ... as an aside: because of this we intentionally side-step all of those issues in ODS pipeline by not interfering at all with the
Whether we fail right away or continue and fail at the end, we still leave the deployments in an inconsistent state. This might be the more pressing issue to solve? Ideally we would have some kind of atomic operation - either all succeed, or all stay on the old version ... |
Describe the bug
When a deployment triggered by
odsComponentStageRolloutOpenShiftDeployment()
fails, DeploymentConfigs in OCP might be left in pauses state.There is code to catch an fix that: https://github.com/opendevstack/ods-jenkins-shared-library/blob/4.x/src/org/ods/component/RolloutOpenShiftDeploymentStage.groovy#L156
But I think it doesn't work as expected.
To Reproduce
Our component has more than one
DeploymentConfig
. The rollout starts with all DCs being paused. Then, the latest built images from the-cd
namespaces are tagged over into the ImageStream of my current namespace. (This would trigger the DC, but they are paused). After all images are tagged, the DCs are resumed one by one.Let's say we have 3 DCs and one DC rollout fails (e.g. a container does not come up because of misconfiguration elsewhere). Let's say it was the second DC:
This is how it looks in the jenkins log:
Now the
bulkResume()
mentioned above is run in thefinally
block. But it fails, too:The bulkResume fails because the first DC was already unpaused. This leaves the last DC (3) in a paused state.
This state will also let the next Jenkins job fail: after building everything, the next call to
odsComponentStageRolloutOpenShiftDeployment()
will fail, too. This time because setting all DCs to pause fails, because the last DCs (3) is already paused.Workaround
If I manually resume the paused DC after a rollout failure, the next Jenkins job will work as expected.
One side-effect of this workaround could be problematic: The ODS rollout has imported the image from the
-cd
namespace to as:latest
. That means that resuming the DCs will actually continue the failed rollout. The DC state then reads like this:Expected behavior
A failed rollout should not leave a state that will let the next rollout fail, too.
However, we must be aware that gracefully resuming all DCs after a failure will continue the rollout in OCP without ODS/Jenkins still monitoring that.
A better solution might be to not let the ODS rollout fail when a single DC rollout fails. Then, ODS has still control over the rollout of the remaining DCs and can track their state.
Affected version (please complete the following information):
The text was updated successfully, but these errors were encountered: