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

fix: Failure to update runner if image hasn't changed #103

Merged
merged 2 commits into from Sep 15, 2022

Conversation

kichik
Copy link
Member

@kichik kichik commented Sep 15, 2022

This affected Lambda runners and Windows runners.
We create images as part of the stack, but we also update them on a schedule and delete the old ones. That means any stack update that touches just the runner and not the image will fail. It will fail because the Lambda function or CodeBuild project will be updated, but the stack will still try to update it with the old image as it's not aware of the new image. This code forces the stack to always get the latest image digest for Lambda, even if the image wasn't created by the stack. On the Windows side, we just tell it to use the 'latest' tag, so we don't have to worry about this issue. That means it's now just a Lambda runner problem and can be confined in the Lambda runner code. Lambda is the only runner provider that needs a digest instead of a tag.

BREAKING CHANGE: RunnerImage.imageDigest was removed

This affected Lambda runners and Windows runners.
We create images as part of the stack, but we also update them on a schedule and delete the old ones. That means any stack update that touches just the runner and not the image will fail. It will fail because the Lambda function or CodeBuild project will be updated, but the stack will still try to update it with the old image as it's not aware of the new image.
This code forces the stack to always get the latest image digest for Lambda, even if the image wasn't created by the stack.
On the Windows side, we just tell it to use the 'latest' tag, so we don't have to worry about this issue. That means it's now just a Lambda runner problem and can be confined in the Lambda runner code. Lambda is the only runner provider that needs a digest instead of a tag.

BREAKING CHANGE: RunnerImage.imageDigest was removed
Signed-off-by: github-actions <github-actions@github.com>
@mergify mergify bot merged commit 6d32001 into main Sep 15, 2022
@mergify mergify bot deleted the always-get-image-digest branch September 15, 2022 23:53
kichik added a commit that referenced this pull request Oct 8, 2022
Use a simpler method to avoid conflicts when updating the function code after the image is updated. Instead of looking for a running stack operation, just try again in a loop every 10 seconds.
The current code assumed some special handling in CloudFormation that would update the function later. It wasn't working. I believe it was broken by #103.
mergify bot pushed a commit that referenced this pull request Oct 9, 2022
Use a simpler method to avoid conflicts when updating the function code after the image is updated. Instead of looking for a running stack operation, just try again in a loop every 10 seconds. The current code assumed some special handling in CloudFormation that would update the function later. It wasn't working. I believe it was broken by #103.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant