Closed Bug 702595 Opened 13 years ago Closed 13 years ago

write initial balrog admin client to support nightly build submissions

Categories

(Release Engineering :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: rail)

References

Details

Attachments

(5 files, 4 obsolete files)

We need this to start submitting nightly build data directly to the Balrog dev environment. Rail has been doing some work on this.
Priority: -- → P2
Depends on: 718509
Attached patch CLI tools using buildprops.json (obsolete) (deleted) — Splinter Review
Ignore lib/python/vendor TODOs: * SSL verification * print messages for retry.py Todos should be done before we go live using production balrog server. buildbotcustom part incoming in a bit
Attachment #608695 - Flags: review?(bhearsum)
Attached patch buildbotcustom (obsolete) (deleted) — Splinter Review
Attachment #608721 - Flags: review?(bhearsum)
Attached patch configs (obsolete) (deleted) — Splinter Review
Once we get the password I can start using it in staging!
Attachment #608722 - Flags: review?(bhearsum)
Comment on attachment 608721 [details] [diff] [review] buildbotcustom Have to use pyton2.6, to be updated.
Attachment #608721 - Flags: review?(bhearsum)
Attached patch buildbotcustom (obsolete) (deleted) — Splinter Review
* use python2.6 (requests needs it) * move self.balrog_api_root to MozillaBuildFactory
Attachment #608721 - Attachment is obsolete: true
Attachment #608833 - Flags: review?(bhearsum)
Attached patch puppet-manifests (deleted) — Splinter Review
TODO: update secrets.pp on master-puppet1 with real credentials.
Attachment #608835 - Flags: review?(bhearsum)
Attachment #608722 - Flags: review?(bhearsum) → review+
Attachment #608835 - Flags: review?(bhearsum) → review+
Comment on attachment 608833 [details] [diff] [review] buildbotcustom Review of attachment 608833 [details] [diff] [review]: ----------------------------------------------------------------- ::: process/factory.py @@ +1802,5 @@ > + slavedest='buildprops_balrog.json', > + workdir='.', > + flunkOnFailure=False, > + )) > + credentialsFile = os.path.join(os.getcwd(), "BuildSlaves.py") For the Tuxedo factory, we pass this in from release.py. Can we do a similar thing here and either put it in misc.py or config.py?
Comment on attachment 608695 [details] [diff] [review] CLI tools using buildprops.json Review of attachment 608695 [details] [diff] [review]: ----------------------------------------------------------------- This is looking pretty good. There's just a few minor things to address before this can land. ::: lib/python/balrog/client/api.py @@ +7,5 @@ > + > +class API(object): > + > + url_template = \ > + '%(api_root)s/releases/%(name)s/builds/%(abi)s/%(locale)s' s/api/build_target/, since that's what we call it in most places. @@ +13,5 @@ > + verify = False > + auth = None > + > + def __init__(self, api_root='https://balrog.build.mozilla.org', > + auth=None, ca_certs=None, timeout=60, raise_exceptions=True): Can you add docstrings for at least auth and ca_certs? It's not immediately clear what's expected in them. @@ +16,5 @@ > + def __init__(self, api_root='https://balrog.build.mozilla.org', > + auth=None, ca_certs=None, timeout=60, raise_exceptions=True): > + self.api_root = api_root > + if ca_certs: > + self.verify = ca_certs Your usage of this variable is a bit weird...it defaults to "False" but then gets assigned a non-boolean value. I think it should always be the same type. Also, let's default to verifying certs! @@ +22,5 @@ > + self.timeout = timeout > + # raise exception by default > + self.config = dict(danger_mode=True) > + if not raise_exceptions: > + self.config = dict(danger_mode=False) I think these 3 lines can just be: self.conf = dict(danger_mode=raise_exceptions) ::: lib/python/balrog/client/cli.py @@ +15,5 @@ > + > + build_type = 'nightly' > + appName = None > + branch = None > + abi = None Rename to buildTarget, like in the other file. @@ +41,5 @@ > + if self.dummy: > + self.branch = '%s-dummy' % self.branch > + self.appVersion = props['appVersion'] > + self.name = '%s-%s-%s-%s' % (self.appName, self.branch, > + self.build_type, buildID) I think it would be good to put the generation of these names into another function, maybe in balrog.names? @@ +51,5 @@ > + } > + if not (props.get('completeMarFilename') or > + props.get('partialMarFilename')): > + raise UpdateException( > + 'completeMarFilename or/and partialMarFilename should be set.') Any case where the complete MAR is missing seems like an error case to me, regardless of whether or not we have a partial. Can we change this to error out only on the absence of the complete? ::: scripts/updates/balrog-client.py @@ +26,5 @@ > + logging_level = logging.INFO > + if options.verbose: > + logging_level = logging.DEBUG > + logging.basicConfig(stream=sys.stdout, level=logging_level, > + format="%(message)s") This needs to get run regardless of what options.verbose is set to.
Attachment #608695 - Flags: review?(bhearsum) → review-
Attached patch CLI tools using buildprops.json (deleted) — Splinter Review
* address comments * enable SSL by default * include Mozilla CA Cert
Attachment #608695 - Attachment is obsolete: true
Attachment #609418 - Flags: review?(bhearsum)
Attached patch buildbotcustom (deleted) — Splinter Review
Attachment #608833 - Attachment is obsolete: true
Attachment #608833 - Flags: review?(bhearsum)
Attachment #609420 - Flags: review?(bhearsum)
Attached patch configs (deleted) — Splinter Review
Attachment #608722 - Attachment is obsolete: true
Attachment #609422 - Flags: review?(bhearsum)
Attachment #609420 - Flags: review?(bhearsum) → review+
Attachment #609422 - Flags: review?(bhearsum) → review+
Comment on attachment 609418 [details] [diff] [review] CLI tools using buildprops.json Review of attachment 609418 [details] [diff] [review]: ----------------------------------------------------------------- Looks good overall! r=me with the two little things noted below fixed. ::: lib/python/balrog/client/cli.py @@ +6,5 @@ > +from release.platforms import buildbot2updatePlatforms > +from balrog.client.api import API > + > + > +def get_name(appName, branch, build_type, buildID, dummy=False): Since this is meant to handle both dated and latest cases, let's rename 'buildID' to 'suffix', to make it more clear. Another naming quibble: get_name should be get_blob_name or maybe get_nightly_blob_name. @@ +57,5 @@ > + 'from': '*', > + 'filesize': props['completeMarSize'], > + 'hashValue': props['completeMarHash'], > + 'fileUrl': props['completeMarUrl'] > + } Can you catch the potential KeyError's here and convert them to an UpdateException, similar to your original patch? It's good that we're always trying to set the complete now, but better to wrap failures to something with a better message IMO.
Attachment #609418 - Flags: review?(bhearsum) → review+
Attachment #609418 - Flags: checked-in+
Everything is pushed, waiting for reconfig and bug 739323
Blocks: 718509
No longer depends on: 718509
this was deployed during a reconfig today
Component: Release Engineering → Release Engineering: Automation (General)
QA Contact: release → catlee
Depends on: 739959
Blocks: 739959
No longer depends on: 739959
Attached patch use GeoTrust's CA certificate (deleted) — Splinter Review
Bug 739323 the dev instance was tweaked and now we need to use Geotrust's CA certificate.
Attachment #610513 - Flags: review?(bhearsum)
Attachment #610513 - Flags: review?(bhearsum) → review+
Attachment #610513 - Flags: checked-in+
All one for an *initial* client.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: