Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add taskcluster support to mozdownload #365

Open
whimboo opened this issue Feb 5, 2016 · 10 comments
Open

Add taskcluster support to mozdownload #365

whimboo opened this issue Feb 5, 2016 · 10 comments

Comments

@whimboo
Copy link
Contributor

whimboo commented Feb 5, 2016

Given several problems we face with querying archive.mozilla.org for builds, and the fact that the build system will be transitioned over to taskcluster and its index, we should add a taskcluster module which let us turn on support for taskcluster step by step for various type of builds.

I think what we have to get started with are the latest nightly builds on various branches:
https://bugzilla.mozilla.org/show_bug.cgi?id=703559#c60

Access will happen through the taskcluster index. Full documentation can be found here:
http://docs.taskcluster.net/services/index/

We could also have a look at mozregression given that it has that support already integrated.

@parkouss
Copy link
Contributor

parkouss commented Feb 5, 2016

Here is an example to get a build url of a firefox 64 bits linux build:

import re
import taskcluster

re_firefox_linux64 = re.compile(r"firefox.*linux-x86_64\.tar.bz2$")

index = taskcluster.client.Index()
queue = taskcluster.Queue()

route = "gecko.v2.mozilla-central.nightly.2016.01.04.latest.firefox.linux64-opt"
task_id = index.findTask(route)['taskId']

artifacts = queue.listLatestArtifacts(task_id)["artifacts"]

for artifact in artifacts:
    if re_firefox_linux64.search(artifact['name']):
        build_url = queue.buildUrl('getLatestArtifact', task_id,
                                   artifact['name'])
        print(build_url)

In mozregression we do things a bit differently, checking for runs of a task, using different routes (revision based) in combination with pushlog api and allowing private artifact accesses, but the logic is similar. Here is the relevant mozregression code: https://github.com/mozilla/mozregression/blob/68df78fe694beb6e9dc9abe848bf2c7f53a1f1db/mozregression/fetch_build_info.py#L88-L172.

@whimboo
Copy link
Contributor Author

whimboo commented Feb 5, 2016

Thanks Julien! So with mozdownload we have the following data for downloading a build:

  • Release/Candidate: latest, version
  • Daily: latest, date, buildid, (revision via Treeherder soon) + build number
  • Tinderbox build: latest, date vs. timestamp, (revision via Treeherder soon) + debug flag, build number
  • Tryscraper: revision + debug flag

To all of them variations of application, branch, locale, and platform will exist. Treeherder for Tinderbox is needed for the beta, release and esr branches given that there are no builds in the taskcluster index yet.

So the example above looks to be trivial and might not be too hard to get implemented. Lets see if I can do that the next weeks, or find a core contributor who is interested in doing that.

@Motwani
Copy link
Contributor

Motwani commented Mar 4, 2016

Hi @whimboo I am interested in this issue. I have read up on taskcluster and confident I can solve this

@whimboo
Copy link
Contributor Author

whimboo commented Mar 4, 2016

That sounds good. If you want, you can take it! One thing I want to note is that we might want to refactor mozdownload first so we can have the three possible download solutions as independent packages. Those are:

  • Scrapers (archive.mozilla.org)
  • Treeherder (by revision)
  • Taskcluster

The Taskcluster method we might be able to use for everything nowadays. But at some point in the past we have to fallback to the scraper method because builds won't be available via the Taskcluster index.

@EricRahm
Copy link
Contributor

EricRahm commented Mar 6, 2017

This is more important now that we've stopped doing Linux buildbot builds. I looked into fixing things, but it boils down to a few tweaks in treeherder.py and then completely replacing the Scrapers with something that doesn't depend on archive.m.o

@EricRahm
Copy link
Contributor

EricRahm commented Mar 6, 2017

glandium pointed out that the code behind mach artifact install might be a useful starting point, there's also code in mozregression that could probably help.

@whimboo
Copy link
Contributor Author

whimboo commented Mar 7, 2017

Lets wait for a response from Releng on bug 1344936 before making a decision what could be done with mozdownload, and especially when.

@armenzg
Copy link

armenzg commented Jun 16, 2017

<&jonasfj> I don't there is a tool, but:
2:11 PM an HTTPS client with retries, following redirects, supporting content-encoding: gzip, should be able to just fetch it from index.taskcluster.net/v1/task//artifacts/
2:13 PM docs: https://docs.taskcluster.net/reference/core/taskcluster-index/references/api#findArtifactFromTask
2:21 PM G<&garndt> armenzg: this is the latest artifacts indexed for win64 opt on inbound: https://tools.taskcluster.net/index/artifacts/#gecko.v2.mozilla-inbound.latest.firefox/gecko.v2.mozilla-inbound.latest.firefox.win64-opt
2:21 PM so for the latest installer for win64 opt on inbound: https://index.taskcluster.net/v1/task/gecko.v2.mozilla-inbound.latest.firefox.win64-opt/artifacts/public/build/firefox-56.0a1.en-US.win64.installer.exe

Also for reference:
taskcluster/taskcluster-rfcs#56

@davehunt
Copy link
Member

I recently learned of fuzzfetch from @tysmith, developed and used by the fuzzing team.

@whimboo
Copy link
Contributor Author

whimboo commented Sep 9, 2020

I actually stumbled about this posting:
https://groups.google.com/g/mozilla.dev.platform/c/0OV_M3b-cMM/m/kkknfFdECgAJ

As it lays out the Taskcluster builds will disappear after a year and as such wont' be accessible anymore. That means we would have to keep the scraping feature as fallback so that old binaries (>1 year) can still be downloaded.

@whimboo whimboo added this to the 1.28.0 milestone Sep 28, 2022
@whimboo whimboo modified the milestones: 1.28.0, 1.29.0 Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants