Closed Bug 1341214 Opened 8 years ago Closed 8 years ago

Avoid multiple definitions of GECKO, ARTIFACTS_URL and INDEX_URL

Categories

(Firefox Build System :: Task Configuration, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla54

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(2 files)

No description provided.
Blocks: 1341215
Attachment #8839353 - Flags: review?(dustin) → review+
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. https://reviewboard.mozilla.org/r/114032/#review115724 ::: taskcluster/taskgraph/util/taskcluster.py:28 (Diff revision 2) > + INDEX_URL = 'https://index.taskcluster.net/v1/task/{}' > + ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' > + > + > +def _do_request(url): > + session = requests.Session() Why not use a single, global session? ::: taskcluster/taskgraph/util/taskcluster.py:39 (Diff revision 2) > + > +def get_artifact_url(task_id, path): > + return ARTIFACT_URL.format(task_id, path) > + > + > +def get_artifact(task_id, path): Please add a docstring here explaining the content-or-file thing.
Attachment #8839354 - Flags: review?(dustin) → review+
(In reply to Dustin J. Mitchell [:dustin] from comment #5) > Comment on attachment 8839354 [details] > Bug 1341214 - Add a small API to handle taskcluster queue and index requests. > > https://reviewboard.mozilla.org/r/114032/#review115724 > > ::: taskcluster/taskgraph/util/taskcluster.py:28 > (Diff revision 2) > > + INDEX_URL = 'https://index.taskcluster.net/v1/task/{}' > > + ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}' > > + > > + > > +def _do_request(url): > > + session = requests.Session() > > Why not use a single, global session? No particular reason, other than not wanting to create a session object just by importing the module. I guess we could have a memoized function that returns a session object.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/d8122277e9fd Define GECKO in a single location. r=dustin https://hg.mozilla.org/integration/autoland/rev/5ffd6c7264ce Add a small API to handle taskcluster queue and index requests. r=dustin
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
backed out for causing on m-c trouble in vp-tc tasks like https://treeherder.mozilla.org/logviewer.html#?job_id=79361310&repo=mozilla-central
Status: RESOLVED → REOPENED
Flags: needinfo?(mh+mozilla)
Resolution: FIXED → ---
Currently no taskcluster-proxy on our Windows worker types, but for downloading public artifacts, you should be able to hit regular queue endpoint, rather than needing to go through the proxy. Note, if you avoid using the proxy and hit queue directly, you also don't need to enable the taskcluster-proxy feature in the task payload, which might also free up some resources on the worker (e.g. one less docker container to run and less calls to auth overhead server-side).
Backout by cbook@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/a7b465111b2c Backed out changeset 5ffd6c7264ce https://hg.mozilla.org/mozilla-central/rev/b06968288cff Backed out changeset d8122277e9fd for causing on m-c problems in vp tc tasks
Depends on: 1341934
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. This needs a re-review. Note that a followup I have in mind is to change use_proxy to default to None, in which case TASKCLUSTER_PROXY would then be used to choose whether to use the proxy or not, and the things that currently fill e.g. installer-url for other tasks would pass an explicit use_proxy=False. Not sure it's worth doing, but it's an open possibility.
Flags: needinfo?(mh+mozilla)
Attachment #8839354 - Flags: review+ → review?(dustin)
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. https://reviewboard.mozilla.org/r/114032/#review116768 I like the refactor of taskcluster API calls and URL generation into a single module. I think that should continue to use $TASK_ID, rather than introducing a new $TASKCLUSTER_PROXY, but otherwise I'm onboard. A further optimization I would like to see -- perhaps it's too much for this bug? -- is to generate proxy URLs for things that run in workers where it is supported, and non-proxy URLs for others. ::: taskcluster/taskgraph/task/base.py:106 (Diff revision 6) > """ > for index_path in self.index_paths: > try: > - url = INDEX_URL.format(index_path) > - existing_task = json.load(urllib2.urlopen(url)) > + task_id = find_task_id( > + index_path, > + use_proxy=bool(os.environ.get('TASKCLUSTER_PROXY'))) This code runs in `./mach taskgraph`, which is only ever run (a) in a decision task (on docker-worker) or (b) on a developer's desktop while debugging taskgraph generation. It never runs on Windows. In case (a) you want to use a proxy; in case (b) you do not. Those two cases are already sufficiently distinguished by the presence (a) or absence (b) of $TASK_ID.
Attachment #8839354 - Flags: review?(dustin) → review+
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. https://reviewboard.mozilla.org/r/114032/#review116782 This may be overlapping with bug 1341934 enough that the two should be merged? I think I have the same objection to both..
Attachment #8839354 - Flags: review+ → review-
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. (In reply to Dustin J. Mitchell [:dustin] from comment #20) > Comment on attachment 8839354 [details] > Bug 1341214 - Add a small API to handle taskcluster queue and index requests. > > https://reviewboard.mozilla.org/r/114032/#review116782 > > This may be overlapping with bug 1341934 enough that the two should be > merged? I think I have the same objection to both.. The patch here is just on top of bug 1341934. If bug 1341934 doesn't go in, then the patch here can be trivially changed with s/TASKCLUSTER_PROXY/TASK_ID/ without a need for another round of reviews.
Attachment #8839354 - Flags: review- → review?(dustin)
(In reply to Dustin J. Mitchell [:dustin] from comment #19) > A further optimization I would like to see -- perhaps it's too much for this > bug? -- is to generate proxy URLs for things that run in workers where it is > supported, and non-proxy URLs for others. That feels like scope bloat.
Comment on attachment 8839354 [details] Bug 1341214 - Add a small API to handle taskcluster queue and index requests. https://reviewboard.mozilla.org/r/114032/#review116914 Fair enough. Let's land this one first, with s/TASKCLUSTER_PROXY/TASK_ID/g.
Attachment #8839354 - Flags: review?(dustin) → review+
Blocks: 1341934
No longer depends on: 1341934
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/16391584c12e Define GECKO in a single location. r=dustin https://hg.mozilla.org/integration/autoland/rev/c9dabe672fd8 Add a small API to handle taskcluster queue and index requests. r=dustin
(In reply to Dustin J. Mitchell [:dustin] from comment #23) > Fair enough. Let's land this one first, with s/TASKCLUSTER_PROXY/TASK_ID/g. FWIW, I literally did that: extracted the patch, did a sed on it and reapplied.
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Product: TaskCluster → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: