Closed Bug 475382 Opened 17 years ago Closed 17 years ago

Get rid of all usage of SetMozillaBuildProperties

Categories

(Release Engineering :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: coop)

References

Details

Attachments

(4 files, 3 obsolete files)

This was introduced when we first starting uploading Mercurial based builds. Since that time we've introduced an upload target that gets rid of much of the need for this class. We need to do a bit more work to get rid of it, because complete snippet generation for nightly builds still depends on it. We also require the buildid to be set as a property, but that should be trivial with SetProperty now. It would be great to get rid of this since it depends on custom slave-side code.
Priority: -- → P3
I need the information/build properties provided by SetMozillaBuildProperties (in fact, I need to extend it) to do updates-on-slaves (bug 511967), but I should be able get the same info from replacement build steps instead that won't require core buildbot modification.
Assignee: nobody → ccooper
Blocks: 511967
Status: NEW → ASSIGNED
OS: Mac OS X → All
Priority: P3 → P2
Hardware: x86 → All
I've got a patch working locally on Mac that I hope to get running in staging tomorrow for cross-platform testing.
This worked well in staging today on all platforms. I've replaced SetMozillaBuildProperties with 2 basic ShellCommands: 1) SetBuildProperties - sets build ID and app version 2) SetFileProperties - sets the filename, file size, and file hash for the provided filename or wildcard. SetFileProperties has been subclassed to generate the other info previously provided by SetMozillaBuildProperties, specifically: 1) SetPackageProperties 2) SetInstallerProperties 3) SetCompleteMarProperties 4) SetPartialMarProperties (not currently used, needed for bug 511967) This cleans things up a little in terms of not setting empty properties, e.g. installer props on non-win32 platforms. I don't limit the for loop at all when performing the find, i.e. it's possible that more than one matching file might be found and returned. In that case, only values for the last file found would remain set as properties. Note: this shouldn't happen provided you are providing a sufficiently specific filename/wildcard and starting from the correct workdir.
Attachment #410876 - Flags: review?(bhearsum)
Comment on attachment 410876 [details] [diff] [review] Replace calls to SetMozillaBuildProperties with targetted ShellCommands >- def commandComplete(self, cmd): >+ def evaluateCommand(self, cmd): >+ superResult = ShellCommand.evaluateCommand(self, cmd) >+ if superResult != SUCCESS: >+ return superResult >+ You'll want to hold onto a reference to ShellCommand in __init__, and then use that here to avoid reload related problems.
Comment on attachment 410876 [details] [diff] [review] Replace calls to SetMozillaBuildProperties with targetted ShellCommands I think this patch is heavier than the task requires. You seem to be modeling after GetBuildID which was written before we had SetProperty. For example: The existing GetBuildID could be replaced with: self.addStep(SetProperty( command=['python', 'config/printconfigsetting.py', '%s/dist/bin/%s' % (self.objdir, inifile), 'App', 'BuildID'] property='buildid' )) Similarly, SetBuildProperties could be broken into: self.addStep(SetProperty( command=['python', 'config/printconfigsetting.py', '%s/dist/bin/%s' % (self.objdir, inifile), 'App', 'BuildID'], property='buildid' )) self.addStep(SetProperty( command=['python', 'config/printconfigsetting.py', '%s/dist/bin/%s' % (self.objdir, inifile), 'App', 'Version'], property='appVersion' )) You should be able to do this for all of the properties you need to set. For things that need a bit of parsing, eg, size or hash, you can pass extract_fn, like we do for 'make upload', http://hg.mozilla.org/build/buildbotcustom/file/tip/process/factory.py#l3005. I know you spent a bunch of time on this, but I think it's worth the investment to avoid a bunch of more custom classes.
Attachment #410876 - Flags: review?(bhearsum) → review-
(In reply to comment #5) > You should be able to do this for all of the properties you need to set. For > things that need a bit of parsing, eg, size or hash, you can pass extract_fn, > like we do for 'make upload', > http://hg.mozilla.org/build/buildbotcustom/file/tip/process/factory.py#l3005. > > I know you spent a bunch of time on this, but I think it's worth the investment > to avoid a bunch of more custom classes. So, I think you're totally right about anything that can be parsed from application.ini. I can make those changes for sure. The problem with the package/installer/mar files is that we don't know for certain what the filename is going to be when we start the process. AFAIK we went with the custom remote class so that we could grep as lazily as possible (usually just by file extension) and not have to be more clever about handling different products and nightlies vs. incrementals. Is there a way to get the filename out of the build system without writing a bunch of custom steps to find/grep as I've done here? Should I be parsing the logs from make_pkg, etc. to get the names of the files we're creating?
Hm, I didn't mean to imply that you had to use printconfigsetting.py everywhere, or non-bash ShellCommands. For example, for SetFileProperties could be replaced with something like this in MercurialBuildFactory: class MercurialBuildFactory(...): ... ... def addFilePropertiesSteps(hashType, name): self.addStep(SetProperty, command=["bash", "-c", "for filename in `find . -iname " + name + \ " -print`; do echo 'filename:' `basename $filename`; done"] property=filename, workdir=whatever ) self.addStep(SetProperty, command=["bash", "-c", "ls -l $filename | awk '{print $5}'"], property=fileSize, workdir=whatever ) self.addStep(SetProperty, command=['openssl', hashType, WithProperties('%(filename)s')], property=fileSum, workdir=whatever ) ...and then you can just pass hashType and name to that, rather than all the new classes. We've also got a FindFile step that might help you out with the first part of it. http://hg.mozilla.org/build/buildbotcustom/file/tip/steps/misc.py#l368
I've moved addFilePropertiesSteps() into MozillaBuildFactory so I can use it easily in the l10n factories eventually. I'm not sure about unsetFilepath. I'm just using it to clear the temp property I use for setting the other file properties. Is there a way to completely remove an unneeded property? Here is the output from the various platform nightlies in staging: http://staging-master.build.mozilla.org:8010/builders/Linux%20mozilla-central%20nightly/builds/4 http://staging-master.build.mozilla.org:8010/builders/OS%20X%2010.5.2%20mozilla-central%20nightly/builds/11 http://staging-master.build.mozilla.org:8010/builders/WINNT%205.2%20mozilla-central%20nightly/builds/68 http://staging-master.build.mozilla.org:8010/builders/WINCE%205.0%20mozilla-central%20nightly/builds/3 Note: the Windows build is still in progress, but I have high hopes based on WinCE.
Attachment #410876 - Attachment is obsolete: true
Attachment #412873 - Flags: review?(bhearsum)
Comment on attachment 412873 [details] [diff] [review] Replace calls to SetMozillaBuildProperties, v2 This looks great, at a high level. I'll try to do a more detailed review tonight.
Comment on attachment 412873 [details] [diff] [review] Replace calls to SetMozillaBuildProperties, v2 This is 95% of the way there. Two things though: * extract_fn is a cleaner and more cross platform way to parse the output of the ShellCommands. Can you use that to parse the ls -l and openssl calls rather than awk/cut piping? * SetMozillaBuildProperties can't be deleted, unfortunately, as Thunderbird and SeaMonkey are still using it. r=me with those changes.
Attachment #412873 - Flags: review?(bhearsum) → review-
(In reply to comment #10) > * extract_fn is a cleaner and more cross platform way to parse the output of > the ShellCommands. Can you use that to parse the ls -l and openssl calls > rather than awk/cut piping? Done. I also haltOnFailure now because we use some of these properties in later steps and there's no sense waiting to fail later. > * SetMozillaBuildProperties can't be deleted OK, I've put it back in, but we no longer import it for our factories. Not much of a delta from what I had before, really. This works locally (mac-only), but I want to give it a go in staging to test cross-platform before landing.
Attachment #412873 - Attachment is obsolete: true
Attachment #414185 - Flags: review?(bhearsum)
Comment on attachment 414185 [details] [diff] [review] Replace calls to SetMozillaBuildProperties, v3 >+ self.addStep(SetProperty, >+ command=['bash', '-c', >+ WithProperties("ls -l %(filepath)s")], >+ workdir='.', >+ name='set_'+fileType.lower()+'_size', >+ extract_fn = self.parseFileSize(propertyName=fileType+'Size'), >+ haltOnFailure=haltOnFailure >+ ) >+ self.addStep(SetProperty, >+ command=['bash', '-c', >+ WithProperties('openssl ' + >+ self.hashType + >+ ' %(filepath)s')], >+ workdir='.', >+ name='set_'+fileType.lower()+'_hash', >+ extract_fn=self.parseFileHash(propertyName=fileType+'Hash'), >+ haltOnFailure=haltOnFailure >+ ) You don't need the "'bash', '-c'" parts anymore, now that you're just running a single command. r=bhearsum with those removed.
Attachment #414185 - Flags: review?(bhearsum) → review+
Attachment #414185 - Flags: checked-in+
Masters were reconfig-ed with this change this morning.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment on attachment 414185 [details] [diff] [review] Replace calls to SetMozillaBuildProperties, v3 http://hg.mozilla.org/build/buildbotcustom/rev/f37c15654c98 Had to revert this change due to bustage in linux mozilla-central builds: ls -l build/obj-firefox/dist/firefox-3.7a1pre.en-US.linux-i686.tests.tar.bz2 build/obj-firefox/dist/firefox-3.7a1pre.en-US.linux-i686.tar.bz2 in dir /builds/slave/mozilla-central-linux/. (timeout 1200 secs) ... ls: build/obj-firefox/dist/firefox-3.7a1pre.en-US.linux-i686.tests.tar.bz2 build/obj-firefox/dist/firefox-3.7a1pre.en-US.linux-i686.tar.bz2: No such file or directory Bugzilla is probably going to screw with the formatting of that that, but in the original there is a newline between the two builds for the command echo and the ls output. Should be finding just the one build, right ?
Attachment #414185 - Flags: checked-in+ → checked-in-
I bet this will turn out to be only 32bit linux on m-c.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Just a small change to how the packageFilename is set for linux. We need to be explicit about the platform when listing the files on linux so that we properly pickup the package instead of the tests on both i686 and x64.
Attachment #414185 - Attachment is obsolete: true
Attachment #414852 - Flags: review?(bhearsum)
Attachment #414852 - Flags: review?(bhearsum) → review+
Could we use sha512 instead of sha1, to match what we do for releases ? openssl can do that even though the docs don't mention it. We'd just need to verify that mac and windows work OK given release updates are all generated on linux.
(In reply to comment #18) > Could we use sha512 instead of sha1, to match what we do for releases ? openssl > can do that even though the docs don't mention it. We'd just need to verify > that mac and windows work OK given release updates are all generated on linux. Sure, I was just following what we did currently.
Attachment #414852 - Flags: checked-in+
Had to land a bustage fix to add the missing wildcards, but this seems to have taken now: http://hg.mozilla.org/build/buildbotcustom/rev/6c03a8efa338
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
This broke release builds.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I just noticed that the sha512 support isn't fully correct, either: [bhearsum@dm-ausstage01 ~]$ cd /opt/aus2/build/0/Firefox/mozilla-central/Darwin_Universal-gcc3/20091201031300/en-US/ [bhearsum@dm-ausstage01 en-US]$ [bhearsum@dm-ausstage01 en-US]$ [bhearsum@dm-ausstage01 en-US]$ ls complete.txt [bhearsum@dm-ausstage01 en-US]$ cat complete.txt complete http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2009/12/2009-12-01-03-mozilla-central/firefox-3.7a1pre.en-US.mac.complete.mar sha1 cd384bdcd5c97cbd1340a49a4dc4a4a9a00ff2e8b14d7460d940ca0362714d7d4b5fd6e5d77eb074665bf7ae705704f710d3dd892f7ddf4195ff3bd205623ed7 23834525 20091201031300 3.7a1pre 3.7a1pre the sum there is sha512, but the snippet still says sha1
Attachment #415425 - Flags: review?(catlee) → review+
I am hitting the "failed find_filepath" problem on the try server since I upgraded to the latest code. For Linux: http://sm-try-master.mozilla.org:8010/builders/Linux%20try%20hg%20build/builds/7108 bash -c find build/objdir/dist -maxdepth 1 -type f -name *.linux-i686.tar.bz2 in dir /builds/slave/sendchange-linux-hg/. For Wince: http://sm-try-master.mozilla.org:8010/builders/WinCE%20try%20hg%20build/builds/1959 bash -c find build/obj-firefox/dist -maxdepth 1 -type f -name *.wince-arm.zip in dir e:\builds\slave\wince-hg\. For WINNT: http://sm-try-master.mozilla.org:8010/builders/WINNT%205.2%20try%20hg%20build/builds/3288 bash -c find build/objdir/dist -maxdepth 1 -type f -name *.win32.zip in dir e:\builds\slave\win32-hg\. I am downgrading the try server to what it was.
Comment on attachment 415425 [details] [diff] [review] Set hashtype for snippets, don't addFileProperties for release builds http://hg.mozilla.org/build/buildbotcustom/rev/4ba76a5888bc
Attachment #415425 - Flags: checked-in+
Attachment #415458 - Flags: review?(armenzg) → review+
Blocks: 532224
No longer blocks: 532224
XULRunner nightlies for 1.9.1/1.9.2/1.9.3 were broken too.
(In reply to comment #30) > XULRunner nightlies for 1.9.1/1.9.2/1.9.3 were broken too. Two issues in play here, both of which are addressed by this patch: 1) XR doesn't produce installers yet, so looking for installer packages won't work. 2) We were looking for a non-existent section (App) in platform.ini.
Attachment #415562 - Flags: review?(nrthomas)
Attachment #415562 - Flags: review?(nrthomas) → review+
Comment on attachment 415562 [details] [diff] [review] Fix XR bustage: don't try to create installers for XR, parse the right section from platform.ini http://hg.mozilla.org/build/buildbotcustom/rev/a1a97959927e
Attachment #415562 - Flags: checked-in+
All masters are running with this change now.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Depends on: 534456
Moving closed Future bugs into Release Engineering in preparation for removing the Future component.
Component: Release Engineering: Future → Release Engineering
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: