Skip to content

Question about resuable workflows #1530

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
teodor-daskalov opened this issue Dec 20, 2021 · 6 comments
Closed

Question about resuable workflows #1530

teodor-daskalov opened this issue Dec 20, 2021 · 6 comments

Comments

@teodor-daskalov
Copy link

teodor-daskalov commented Dec 20, 2021

Hi @npalm,

About 3 months ago we implemented your solution (v0.18.1) and we're really happy with it, because it provides us with a way to have dynamic EC2 instances as self-hosted runners and free up resources for other things from our own on-prem machines.

A colleague of ours is trying to implement the new feature of reusing workflows that was released last month:
https://docs.github.com/en/actions/learn-github-actions/reusing-workflows

So far no success. The workflows that call a reusable workflow cannot trigger the spawning of new AWS runners.

Have you tried this on your end and could it work in theory with the version that we have on our end?

Thanks in advance for your support!

@npalm
Copy link
Member

npalm commented Dec 21, 2021

Yes, we have the reusable workflows / templates working. Did you grant org level access to the repo containing the shared workflow?

@teodor-daskalov
Copy link
Author

teodor-daskalov commented Dec 21, 2021

@npalm thanks for your response. Yes, that workflow is using another workflow from the same repo, so that is definitely not the issue here.

I think I found out the reason behind this, after I re-checked the webhook lambda's logs:

image

So what I fail to understand is why doesn't the lambda recognize the 3 default labels for any linux OS runner:
self-hosted, linux, and x86 ? (it seems it only recognizes self-hosted by default)

In our Terraform config we have defined 3 custom labels: aws-runner, ubuntu-18.04, and test.
But the lambda rejects a request that has labels self-hosted + linux because the label linux doesn't seem to be taken into consideration.

Am I missing something or is this the expected behavior?

Of course, at this time it is an easy thing to fix, we just always have to target the exact set of labels defined or a specific part of them, without introducing a label "unknown" to the lambda.
Or we can just add linux and x86 to our Terraform config. ¯\_(ツ)_/¯

@npalm
Copy link
Member

npalm commented Dec 21, 2021

The webhook is checking if the labels in the event are matching the configured labels. So in your case the labels aws-runner, ubuntu-18.04, and test should be used in the workflow triggering the build. The predefined github labels are ignored in the check. You can also set disable_check_wokflow_job_labels which should disable the label check and accept any workflow job event to the webhook.

The labels check is relative new, and was introduced together with the workflow job even.

@teodor-daskalov
Copy link
Author

Thanks a lot for the info! Btw, do you think all the configured labels have to be used in the workflow or one or two is enough?

@npalm
Copy link
Member

npalm commented Dec 22, 2021

Actually, I doubt a bit about what to do with the labels. I even think to disable the check by default. So would suggest to siable them for now.

@teodor-daskalov
Copy link
Author

Alright, thanks very much for your help. I'll close this one.

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

No branches or pull requests

2 participants