Swarming: Fetches Credentials with scope & other Minor fixes#5222
Swarming: Fetches Credentials with scope & other Minor fixes#5222
Conversation
| Job dimensions have more precedence than static dimensions""" | ||
| unique_dimensions = {} | ||
| unique_dimensions['os'] = job.platform | ||
| unique_dimensions['os'] = str(job.platform).capitalize() |
There was a problem hiding this comment.
Is the call to str() actually needed? Isn't job.platform already a string? I suppose we need to capitalize it since Swarming is not accepting the string as is, correct? Is it because it's not a string or because it's not capitalized?
| url = f'https://{swarming_server}/prpc/swarming.v2.Tasks/NewTask' | ||
| utils.post_url( | ||
| url=url, data=json_format.MessageToJson(task_spec), headers=headers) | ||
| message_body = json_format.MessageToJson(task_spec) |
There was a problem hiding this comment.
Isn't this a security concern to log the whole body to the console?
Might want to consider logging it conditionally depending on the environment.
There was a problem hiding this comment.
I guess not since logs are only readable trough the GCP project, but im not 100% sure of this affirmation, since im not fully aware of who has access to this projects.
@javanlacerda wdyt?
jardondiego
left a comment
There was a problem hiding this comment.
Left a couple questions above. :)
After testing the remote task gate in
devwe were able to discover more things that were missing in the swarming implementation.Credentials request to retrieve required scopes
Credentials retrieved using

credentials.get_default(_SWARMING_SCOPES)didn't have all the requested scopes, even tough we explicitly requested it, this happened because the GCP metadata server ignored the requested scopes and instead returned the VM scopesNote: In red previous workflow, in green new workflow, in gray workflow used for local tests
Minor Fixes