Closed eu9ene closed 4 months ago
@bhearsum I wonder if there's a way to pull a secret based on the author of the task. Then instead of using our service token we could use personal tokens to automatically identify authors in w&B.
There's no technical reason we can't do that. The secrets are defined in the task definitions: https://github.com/mozilla/firefox-translations-training/blob/c4b0d121985d84ed88aefc966df0ffbb1431a3ed/taskcluster/kinds/train-backwards/kind.yml#L70
The person who triggered the task (whether by opening a PR, making a push, or triggering an action) is available in config.params["owner"]
in the transforms. So we could either substitute that into the secret in a transform, or add the secret entirely in a transform.
We'd likely want some way to gracefully handle the secret not existing. That could be checking for existence before adding it to the task definition (and fallback to disabling or a default), or it could be done somewhere in the payload. Eg: if the secret doesn't exist we implicitly disable publication.
Ok, ideally we should do tricks with tokens because it turned out W&B has some nice filters like "show only my work" based on this Author field and I don't see an API to override that.
After discussion there will not be multiple tokens.
We can add a new tag on the run, with format author:<owner>
where <owner>
comes from the run configuration as mentionned by @bhearsum above.
I'm happy with this solution.
We should be able to identify the author of an experiment. Currently, it's always
moz-translations-wandb-bot
because of the service token we use. Let's find a way to either change this one or use another field.