Closed
Bug 475382
Opened 17 years ago
Closed 17 years ago
Get rid of all usage of SetMozillaBuildProperties
Categories
(Release Engineering :: General, defect, P2)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bhearsum, Assigned: coop)
References
Details
Attachments
(4 files, 3 obsolete files)
|
12.11 KB,
patch
|
bhearsum
:
review+
coop
:
checked-in+
|
Details | Diff | Splinter Review |
|
3.77 KB,
patch
|
catlee
:
review+
coop
:
checked-in+
|
Details | Diff | Splinter Review |
|
986 bytes,
patch
|
armenzg
:
review+
coop
:
checked-in+
|
Details | Diff | Splinter Review |
|
1.96 KB,
patch
|
nthomas
:
review+
coop
:
checked-in+
|
Details | Diff | Splinter Review |
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.
| Reporter | ||
Updated•17 years ago
|
Priority: -- → P3
| Assignee | ||
Comment 1•17 years ago
|
||
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
| Assignee | ||
Comment 2•17 years ago
|
||
I've got a patch working locally on Mac that I hope to get running in staging tomorrow for cross-platform testing.
| Assignee | ||
Comment 3•17 years ago
|
||
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 4•17 years ago
|
||
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.
| Reporter | ||
Comment 5•17 years ago
|
||
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-
| Assignee | ||
Comment 6•17 years ago
|
||
(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?
| Reporter | ||
Comment 7•17 years ago
|
||
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
| Assignee | ||
Comment 8•17 years ago
|
||
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)
| Reporter | ||
Comment 9•17 years ago
|
||
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.
| Reporter | ||
Comment 10•17 years ago
|
||
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-
| Assignee | ||
Comment 11•17 years ago
|
||
(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)
| Reporter | ||
Comment 12•17 years ago
|
||
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+
| Assignee | ||
Comment 13•17 years ago
|
||
Comment on attachment 414185 [details] [diff] [review]
Replace calls to SetMozillaBuildProperties, v3
http://hg.mozilla.org/build/buildbotcustom/rev/ffa4c55289ce
Attachment #414185 -
Flags: checked-in+
| Assignee | ||
Comment 14•17 years ago
|
||
Masters were reconfig-ed with this change this morning.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 15•17 years ago
|
||
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-
Comment 16•17 years ago
|
||
I bet this will turn out to be only 32bit linux on m-c.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 17•17 years ago
|
||
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)
| Reporter | ||
Updated•17 years ago
|
Attachment #414852 -
Flags: review?(bhearsum) → review+
Comment 18•17 years ago
|
||
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.
| Assignee | ||
Comment 19•17 years ago
|
||
(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.
| Assignee | ||
Comment 20•17 years ago
|
||
Comment on attachment 414852 [details] [diff] [review]
Replace calls to SetMozillaBuildProperties, v4
http://hg.mozilla.org/build/buildbotcustom/rev/b1eab8fc23ad
Attachment #414852 -
Flags: checked-in+
| Assignee | ||
Comment 21•17 years ago
|
||
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
Comment 22•17 years ago
|
||
This broke release builds.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 23•17 years ago
|
||
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
| Assignee | ||
Comment 25•17 years ago
|
||
Attachment #415425 -
Flags: review?(catlee)
Updated•17 years ago
|
Attachment #415425 -
Flags: review?(catlee) → review+
Comment 26•17 years ago
|
||
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.
| Assignee | ||
Comment 27•17 years ago
|
||
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+
| Assignee | ||
Comment 28•17 years ago
|
||
Attachment #415458 -
Flags: review?(armenzg)
Updated•17 years ago
|
Attachment #415458 -
Flags: review?(armenzg) → review+
| Assignee | ||
Comment 29•17 years ago
|
||
Comment on attachment 415458 [details] [diff] [review]
Don't addFileProperties for try builds
http://hg.mozilla.org/build/buildbotcustom/rev/e1e6596bb900
Attachment #415458 -
Flags: checked-in+
Comment 30•17 years ago
|
||
XULRunner nightlies for 1.9.1/1.9.2/1.9.3 were broken too.
| Assignee | ||
Comment 31•17 years ago
|
||
(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)
Updated•17 years ago
|
Attachment #415562 -
Flags: review?(nrthomas) → review+
| Assignee | ||
Comment 32•17 years ago
|
||
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+
| Assignee | ||
Comment 33•17 years ago
|
||
All masters are running with this change now.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 34•16 years ago
|
||
Moving closed Future bugs into Release Engineering in preparation for removing the Future component.
Component: Release Engineering: Future → Release Engineering
Updated•13 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•