We may want to prioritize certain servers above others for various reasons. The current main reason is we have EC2 signing scriptworkers in usw2 and use1, and signing servers in mdc1 (west coast) and mdc2 (east coast). Signing tends to be significantly faster when we stay geographically close, rather than cross-country.
This PR:
refactors the passwords.json file into a passwords.yaml file. When we add a new server, we can just add a new url instead of copying lengthy lines in the json.
adds a priority to the passwords.yml and the SigningServer namedtuple.
randomizes the server order, while maintaining priority, during get_suitable_signing_servers. By that, I mean all priority 2 servers will be in random order, but they'll all come before priority 1 servers.
fixes a couple of deprecation/flake8 warnings.
I'd like to test this a bit in my puppet env. This PR should pair with https://github.com/mozilla-releng/signtool/pull/13 , which stops randomizing server order in signtool; signtool should receive a pre-randomized-and-prioritized list from signingscript. We'll also need a puppet patch that adds PyYAML and changes the password templates, and prioritizes mdc1 for usw2 and mdc2 for use1.
Coverage remained the same at 100.0% when pulling 471c080a9d5f70b77f038a878a9789f72f778070 on escapewindow:server-priorities into 30d0626d0db1597932edd193486054675feb91e6 on mozilla-releng:master.
We may want to prioritize certain servers above others for various reasons. The current main reason is we have EC2 signing scriptworkers in usw2 and use1, and signing servers in mdc1 (west coast) and mdc2 (east coast). Signing tends to be significantly faster when we stay geographically close, rather than cross-country.
This PR:
url
instead of copying lengthy lines in the json.priority
to the passwords.yml and theSigningServer
namedtuple.get_suitable_signing_servers
. By that, I mean all priority2
servers will be in random order, but they'll all come before priority1
servers.I'd like to test this a bit in my puppet env. This PR should pair with https://github.com/mozilla-releng/signtool/pull/13 , which stops randomizing server order in signtool; signtool should receive a pre-randomized-and-prioritized list from signingscript. We'll also need a puppet patch that adds
PyYAML
and changes the password templates, and prioritizes mdc1 for usw2 and mdc2 for use1.