Closed Bug 1529501 Opened 7 years ago Closed 7 years ago

Taskcluster-based artifacts for tests

Categories

(Release Engineering :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: tarek, Assigned: tarek)

References

Details

For the heavy profile project, I implemented a small feature that allows a test to pick up an archive on taskcluster that is regularly updated via a TC "cron"

see https://searchfox.org/mozilla-central/source/testing/talos/talos/heavy.py

This mechanism is useful for automation, as it avoids relying on tooltool (which requires manual updates of archives based on metadata).

For Bug 1527620 we want a similar mechanism, and I think that's generally useful in other parts of testing.

My initial plan is to add a python client in a new /testing/artifacts/ module that would let a test grab/update an artifact prior to running a test.

That module would also provide simple helpers to compress/decompress/verify tarballs in a standard way, and some minimal security checks (like url whitelisting, simple checksums)

For the artifact generator inside TC, I don't know if we need to provide any specific tool other than describing how a script should generate an artifact that can be picked by tests.

In general, I think we should absolutely do this. My first question is, how is this different from TC toolchains? How is it different from TC fetch tasks? I'll NI glandium to get his thoughts on how toolchains and fetch might differ, and on the general caching problem.

I would very much like to keep this away from mozharness as much as possible. The less we do in mozharness the happier we will be.

Flags: needinfo?(mh+mozilla)

how is this different from TC toolchains? How is it different from TC fetch tasks?

I don't know. My TC knowledge is very limited, that's why I cced Dustin :)

I would very much like to keep this away from mozharness as much as possible

+1. I want to stick with vanilla Python (+requests) as much as possible - as I did in the heavy profile stuff

Glandium's the right person to ask -- in the current implementation, these artifacts are generated on a cron, so there's always a "fresh" artifact and it is never built as part of the on-push taskgraph. I'm assuming that model is good and won't change. So that means toolchains aren't a great match, since those are mostly about building a deep tree of dependent tasks within the taskgraph.

Fetches might be a better match. The job here is to look up a task in the index, and then download some artifact(s) from that task. The second part of that matches fetches exactly. I don't recall how tightly coupled fetches are to task dependencies. If they are tightly coupled, then perhaps a much simpler thing with a different name could be established.

It might also be nice to make the link between artifacts generated in a cron task and tasks consuming those artifacts visible to other developers, moreso than just happening to use the same index paths. That probably means picking a unique name for the overall feature, documenting it, and maybe structuring the code so that it can do basic validations like check that an artifact used by a task is actually generated by some cron.

(In reply to Tarek Ziadé (:tarek) from comment #2)

I would very much like to keep this away from mozharness as much as possible

+1. I want to stick with vanilla Python (+requests) as much as possible - as I did in the heavy profile stuff

Some common frameworks would be useful so that if we want to add things like timing instrumentation to these tasks, there's a single place to do that.

Fetches are indeed a better match. Bug 1476372 does something similar for chromium.

Flags: needinfo?(mh+mozilla)

Thanks all, I will investigate this with your feedback

So, looking at the code, unless I missed something, the client-side of fetch is basically
filling the MOZ_FETCHES_DIR when it's running in TC, with artifacts picked from URLS that follow this scheme
(+ checksum & gpg verification)

https://queue.taskcluster.net/v1/task/{task}/artifacts/{artifact}

There's one extra thing I did for the heavy profile and want to do again, is check the Last-Modified header to decide
if the artifact is fresher than a local copy. Maybe that's something we could also add in the fetch-content script?

I also need the artifact to get downloaded on local test runs (I don't think that's the case in Raptor for stuff that are downloaded by fetch tasks?)

Here's a proposal:

1/ move https://searchfox.org/mozilla-central/source/taskcluster/scripts/misc/fetch-content python code to its own
module in mozilla-central that can be used by TC, testing, etc.
2/ have taskcluster use it (in the same fetch-content script, but calling the new module)
3/ have raptor & my new YT test use that client in two modes = local or ci

In terms of code, the new module would just be some Artifact(name=xx, task=xx, downloaddir=MOZ_FETCHES_DIR) class.
In terms of where to put that code, I don't really know what would be the best spot. Would testing/mozbase/mozartifact make sense? does that work for TC ?

Flags: needinfo?(mh+mozilla)

This feels more like questions for Tom.

(It's worth noting some redundancy with mach artifact toolchain, which we should switch to use fetches eventually)

Flags: needinfo?(mh+mozilla) → needinfo?(mozilla)

There's too much adaptation for using the fetch-content script in a python2/python3 environment.

I will create an ad-hoc helper inside mozproxy.

Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(mozilla)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.