Closed
Bug 960201
Opened 12 years ago
Closed 12 years ago
Implement ghetto "gaia-try" by allowing test jobs to operate on arbitrary gaia.json
Categories
(Release Engineering :: General, defect)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jgriffin, Assigned: jgriffin)
References
Details
Attachments
(2 files, 5 obsolete files)
|
759 bytes,
patch
|
gaye
:
review+
|
Details | Diff | Splinter Review |
|
4.88 KB,
patch
|
jgriffin
:
review+
|
Details | Diff | Splinter Review |
Since we've agreed to push back implementation of a robust gaia-try until the TaskCluster project is up and running (see https://bugzilla.mozilla.org/show_bug.cgi?id=914632#c9), we've had a couple of developers request that we implement a kind of ghetto gaia-try as a temporary hack, in which test jobs on try could operate on arbitrary gaia.json files that may point to github branches.
I believe the implementation cost of this would be fairly low. We need:
1 - sec review on opening up try server jobs to github. Done! See bug 914651.
2 - opening network flows from try to github (if not already available)
3 - git installed on ubuntu VM slves. Done! See bug 914627.
4 - updating the mozharness scripts that run gaia test jobs to be able to handle additional options in gaia.json.
If we agree to only support tests on b2g desktop builds, we would not need to change the build jobs at all, since the test jobs do not use gaia from the build products, but rather generate their own gaia profile.
Are there any objections or obstacles to this plan?
| Assignee | ||
Updated•12 years ago
|
Comment 1•12 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=914651#c3 reads to me like OpSec signed off on try jobs pulling from github.com/mozilla repositories, but not arbitrary other repos (based on the comments about committer agreement/level 1). If that's the case, I think we need some wrapper around the code that clones gaia to enforce that.
| Assignee | ||
Comment 2•12 years ago
|
||
You are possibly correct, although I should note that this kind of gaia-try would still require level 1 commit access to mozilla's hg try; you couldn't initiate a try run just by changing something in github alone.
Limiting this to github.com/mozilla(-b2g) would very much reduce its usefulness, and I don't think it really adds any meaningful security, since nothing happens without pushing to try anyway.
(In reply to Jonathan Griffin (:jgriffin) from comment #0)
> I believe the implementation cost of this would be fairly low. We need:
>
> 1 - sec review on opening up try server jobs to github. Done! See bug
> 914651.
That bug has been reopened to clarify which machines need the github access.
| Assignee | ||
Comment 4•12 years ago
|
||
This is a ghetto patch for ghetto try! I'm going to play around with it on ash.
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → jgriffin
| Assignee | ||
Comment 5•12 years ago
|
||
This works like a charm on linux slaves; we'll see if it runs on osx too.
| Assignee | ||
Comment 6•12 years ago
|
||
Fixed a minor error that I saw on ash.
| Assignee | ||
Updated•12 years ago
|
Attachment #8370931 -
Attachment is obsolete: true
| Assignee | ||
Comment 7•12 years ago
|
||
This changes gaia.json to include an optional gaia dict; to use it for gaia try, you would specify a remote and a branch OR revision, like so:
{
revision: 621040ee199cdde3bdd2aeaf2a016ff7806875bb,
repo_path: /integration/gaia-central,
git: {
remote: https://github.com/jonallengriffin/gaia.git,
branch: gaia_unit_crash,
revision:
}
}
The limitations are that this will only affect gaia tests (gaia-integration, gaia-unit, and gaia-ui) on b2g desktop builds. It won't be honored for legacy tests (like mochitests) or any tests running on emulators. We can expand this later to work with those if we think we need to.
Attachment #8371978 -
Flags: review?(gaye)
| Assignee | ||
Comment 8•12 years ago
|
||
Er, that was a patch against ash, here's the correct one.
Attachment #8371979 -
Flags: review?(gaye)
| Assignee | ||
Updated•12 years ago
|
Attachment #8371978 -
Attachment is obsolete: true
Attachment #8371978 -
Flags: review?(gaye)
| Assignee | ||
Comment 9•12 years ago
|
||
I'll need to update bump_gaia_json.py as well.
| Assignee | ||
Comment 10•12 years ago
|
||
This adds mozharness support for ghetto gaia try. Ideally, we'd make a git VCS class to support git cloning, but until then, this approach should work good enough for try (I hope). Tested fine on ash. See for instance:
https://tbpl.mozilla.org/php/getParsedLog.php?id=34176647&tree=Ash&full=1
(look for 'Running pull step')
Trying not to add a review to aki's queue right before he leaves for PTO, but feel free to redirect if this should go elsewhere.
Attachment #8371987 -
Flags: review?(bhearsum)
| Assignee | ||
Updated•12 years ago
|
Attachment #8371174 -
Attachment is obsolete: true
Comment 11•12 years ago
|
||
Comment on attachment 8371987 [details] [diff] [review]
Add git support to gaia.json
Review of attachment 8371987 [details] [diff] [review]:
-----------------------------------------------------------------
Seems fine for the most part - do you have any logs from sample runs that I can have a look at it?
::: mozharness/mozilla/gaia.py
@@ +51,5 @@
>
> + # git clone
> + git_cmd = self.query_exe('git')
> + cmd = [git_cmd,
> + 'clone',
Why are you using plain git instead of vcs_checkout? You can override its default vcs by passing vcs='git' (https://hg.mozilla.org/build/mozharness/file/5af0139c7e39/mozharness/base/vcs/vcsbase.py#l54).
Updated•12 years ago
|
Attachment #8371979 -
Flags: review?(gaye) → review+
| Assignee | ||
Comment 12•12 years ago
|
||
(In reply to Ben Hearsum [:bhearsum] from comment #11)
> Comment on attachment 8371987 [details] [diff] [review]
> Add git support to gaia.json
>
> Review of attachment 8371987 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Seems fine for the most part - do you have any logs from sample runs that I
> can have a look at it?
Yes, see https://tbpl.mozilla.org/php/getParsedLog.php?id=34176647&tree=Ash&full=1
>
> ::: mozharness/mozilla/gaia.py
> @@ +51,5 @@
> >
> > + # git clone
> > + git_cmd = self.query_exe('git')
> > + cmd = [git_cmd,
> > + 'clone',
>
> Why are you using plain git instead of vcs_checkout? You can override its
> default vcs by passing vcs='git'
> (https://hg.mozilla.org/build/mozharness/file/5af0139c7e39/mozharness/base/
> vcs/vcsbase.py#l54).
Because we don't have any git class in mozharness. We have only gittool, but that's for git shares which aren't appropriate here, AFAICT. In order to use vcs='git', we'd need a GitVCS class that's the equivalent of http://hg.mozilla.org/build/mozharness/file/5af0139c7e39/mozharness/base/vcs/mercurial.py, and I didn't want to write one just for this use case. But we eventually should!
Comment 13•12 years ago
|
||
Comment on attachment 8371987 [details] [diff] [review]
Add git support to gaia.json
(In reply to Jonathan Griffin (:jgriffin) from comment #12)
> (In reply to Ben Hearsum [:bhearsum] from comment #11)
> > Comment on attachment 8371987 [details] [diff] [review]
> > Add git support to gaia.json
> >
> > Review of attachment 8371987 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > Seems fine for the most part - do you have any logs from sample runs that I
> > can have a look at it?
>
> Yes, see
> https://tbpl.mozilla.org/php/getParsedLog.php?id=34176647&tree=Ash&full=1
>
> >
> > ::: mozharness/mozilla/gaia.py
> > @@ +51,5 @@
> > >
> > > + # git clone
> > > + git_cmd = self.query_exe('git')
> > > + cmd = [git_cmd,
> > > + 'clone',
> >
> > Why are you using plain git instead of vcs_checkout? You can override its
> > default vcs by passing vcs='git'
> > (https://hg.mozilla.org/build/mozharness/file/5af0139c7e39/mozharness/base/
> > vcs/vcsbase.py#l54).
>
> Because we don't have any git class in mozharness. We have only gittool,
> but that's for git shares which aren't appropriate here, AFAICT. In order
> to use vcs='git', we'd need a GitVCS class that's the equivalent of
> http://hg.mozilla.org/build/mozharness/file/5af0139c7e39/mozharness/base/vcs/
> mercurial.py, and I didn't want to write one just for this use case. But we
> eventually should!
Per IRC, gittool doesn't help because gaia will come from various different sources, and gittool isn't smart enough to combine them.
I looked over your test run and it seems good. Ship it!
Attachment #8371987 -
Flags: review?(bhearsum) → review+
| Assignee | ||
Comment 14•12 years ago
|
||
Will land on Monday (so I can monitor for bustage).
| Assignee | ||
Comment 15•12 years ago
|
||
New version of the patch, which only does an hg purge of the 'gaia' dir if an .hg repo exists, otherwise it just deletes the directory.
This change is needed because sometimes the 'gaia' dir from a previous test run will be an hg repo, and sometimes a github one. This should also fix bug 970166, which I believe is caused by my experiments running the first version of this patch on ash.
Attachment #8373724 -
Flags: review?(bhearsum)
| Assignee | ||
Updated•12 years ago
|
Attachment #8371987 -
Attachment is obsolete: true
Comment 16•12 years ago
|
||
Comment on attachment 8373724 [details] [diff] [review]
Add git support to gaia.json
Review of attachment 8373724 [details] [diff] [review]:
-----------------------------------------------------------------
::: mozharness/mozilla/gaia.py
@@ +46,5 @@
> branch = None
>
> + if git:
> + if os.path.exists(dest):
> + self.rmtree(dest)
Can we do something smarter here for git, too, and only clobber if it isn't already a git dir? Or does that not make sense?
@@ +74,5 @@
> +
> + else:
> + # purge the repo if it already exists
> + if os.access(dest, os.F_OK):
> + if os.access(os.path.join(dest, '.hg'), os.F_OK):
Just curious - is there a reason you're using os.access instead of os.path.exists?
| Assignee | ||
Comment 17•12 years ago
|
||
(In reply to Ben Hearsum [:bhearsum] from comment #16)
> Comment on attachment 8373724 [details] [diff] [review]
> Add git support to gaia.json
>
> Review of attachment 8373724 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: mozharness/mozilla/gaia.py
> @@ +46,5 @@
> > branch = None
> >
> > + if git:
> > + if os.path.exists(dest):
> > + self.rmtree(dest)
>
> Can we do something smarter here for git, too, and only clobber if it isn't
> already a git dir? Or does that not make sense?
We normally will want to clobber anyway, since the target will likely be a different github repo, even if it's git. But, we could skip the clobber if it's a git dir and the remote is the same. I wouldn't expect that to happen often...it will only occur on repeated try runs off the same user repo if we happen to get the same slave.
>
> @@ +74,5 @@
> > +
> > + else:
> > + # purge the repo if it already exists
> > + if os.access(dest, os.F_OK):
> > + if os.access(os.path.join(dest, '.hg'), os.F_OK):
>
> Just curious - is there a reason you're using os.access instead of
> os.path.exists?
No reason, I can change it.
Comment 18•12 years ago
|
||
Comment on attachment 8373724 [details] [diff] [review]
Add git support to gaia.json
Review of attachment 8373724 [details] [diff] [review]:
-----------------------------------------------------------------
Given your comments, I'm okay with this as is. Feel free to address either of the things mentioned though.
Attachment #8373724 -
Flags: review?(bhearsum) → review+
| Assignee | ||
Comment 19•12 years ago
|
||
Addressing both review comments; will test this on ash before landing.
| Assignee | ||
Updated•12 years ago
|
Attachment #8373724 -
Attachment is obsolete: true
| Assignee | ||
Comment 20•12 years ago
|
||
Comment on attachment 8374284 [details] [diff] [review]
Add git support to gaia.json
Review of attachment 8374284 [details] [diff] [review]:
-----------------------------------------------------------------
Carry r+ forward.
Attachment #8374284 -
Flags: review+
| Assignee | ||
Comment 21•12 years ago
|
||
| Assignee | ||
Comment 22•12 years ago
|
||
Pushed a follow-up fix for a typo (thanks aki!): http://hg.mozilla.org/build/mozharness/rev/f3e61d3d1ee2
| Assignee | ||
Comment 23•12 years ago
|
||
Marking as fixed even though there's still an open dependency, as it isn't a strict blocker.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Component: General Automation → General
You need to log in
before you can comment on or make changes to this bug.
Description
•