Skip to content

job_retry.enabled=true fails to find manually downloaded runners.zip #4078

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

Closed
imphil opened this issue Aug 18, 2024 · 2 comments · Fixed by #4080 or #4081
Closed

job_retry.enabled=true fails to find manually downloaded runners.zip #4078

imphil opened this issue Aug 18, 2024 · 2 comments · Fixed by #4080 or #4081
Labels
bug Something isn't working

Comments

@imphil
Copy link
Contributor

imphil commented Aug 18, 2024

I manually download and specify the lambda zip files in my main module:

  webhook_lambda_zip                = "./webhook.zip"
  runner_binaries_syncer_lambda_zip = "./runner-binaries-syncer.zip"
  runners_lambda_zip                = "./runners.zip"

This has worked fine for a long time now.

When enabling the new job retry feature in v5.15.1 with

  job_retry = {
    enable           = true
  }

I get the following error when running tofu apply:

╷
│ Error: Error in function call
│ 
│   on .terraform/modules/gh-runner-linux/modules/lambda/main.tf line 24, in resource "aws_lambda_function" "main":
│   24:   source_code_hash  = var.lambda.s3_bucket == null ? filebase64sha256(var.lambda.zip) : null
│     ├────────────────
│     │ while calling filebase64sha256(path)
│     │ var.lambda.zip is ".terraform/modules/gh-runner-linux/modules/runners/job-retry/../../../lambdas/functions/control-plane/runners.zip"
│ 
│ Call to function "filebase64sha256" failed: open .terraform/modules/gh-runner-linux/lambdas/functions/control-plane/runners.zip: no such file or directory.
╵

It looks like the runners_lambda_zip path is not passed on to the new module.

I tried to sort out a fix, but I'm slightly confused as to how things are supposed to be. It looks like there's a bit of inconsistency introduced with zip vs lambda_zip and the variable names are around it, starting with the termination watcher, and now (it seems) copied over to the job retry functionality.

@npalm, you probably know best how things are supposed to be? If not, let me know and I'll try to come up with something.

PS: Thanks a lot for introducing the job retry feature, I cannot wait to try it out. We repeatedly had jobs not starting, it's the only thing that didn't work for us with this fantastic module.

@npalm
Copy link
Member

npalm commented Aug 19, 2024

@npalm npalm added the bug Something isn't working label Aug 19, 2024
@npalm npalm closed this as completed in 098c0ea Aug 19, 2024
npalm pushed a commit that referenced this issue Aug 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[5.15.2](philips-labs/terraform-aws-github-runner@v5.15.1...v5.15.2)
(2024-08-19)


### Bug Fixes

* pass lambda zip file to job retry feature
([#4080](https://github.com/philips-labs/terraform-aws-github-runner/issues/4080))
([098c0ea](philips-labs/terraform-aws-github-runner@098c0ea)),
closes
[#4078](https://github.com/philips-labs/terraform-aws-github-runner/issues/4078)
* use name instead of name prefix to avoid too long names
([#4079](https://github.com/philips-labs/terraform-aws-github-runner/issues/4079))
([8bb6272](philips-labs/terraform-aws-github-runner@8bb6272))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: forest-releaser[bot] <80285352+forest-releaser[bot]@users.noreply.github.com>
@imphil
Copy link
Contributor Author

imphil commented Aug 19, 2024

Thanks for having a look and even doing the PR and a release! I'm now running with the latest version and job retry enabled, let's see how far we get with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants