-
Notifications
You must be signed in to change notification settings - Fork 48
Various taskgraph load-task fixes
#767
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
Conversation
Previously we were checking whether the worker-implementation was docker-worker by looking at the task tags. But many projects are missing this tag, and especially Decision tasks don't tend to have it. Instead, check if the `payload.image` key is defined.
6936dfe to
d16425e
Compare
| impl := task_def.get("tags", {}).get("worker-implementation") | ||
| ) != "docker-worker": | ||
| print(f"Tasks with worker-implementation '{impl}' are not supported!") | ||
| if "payload" not in task_def or not (image := task_def["payload"].get("image")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that walrus assignments in a conditional block are valid in the outer scope. This is fine...but I admit I was bit confused about where the image further down was coming from at first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... It threw me off initially as well. Originally I didn't have the payload not in task_def fix and it looked a bit less confusing.
I can change it if you like, or I can leave it and force everyone to get used to it 😈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I'd rather we didn't have assignments in the middle of complex conditions
d16425e to
1c9cbd5
Compare
run-task expects the worker to mount a volume at each path passed in here. Let's avoid needing the user of `taskgraph load-task` needing to do the same.
1c9cbd5 to
ffb3ed9
Compare
| # run-task expects the worker to mount a volume for each path defined in | ||
| # TASKCLUSTER_CACHES, delete them to avoid needing to do the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just as easily mount a volume there?
No description provided.