Commit Graph

30 Commits

Author SHA1 Message Date
Andrew Halberstadt
cdabb89968 Bug 1466660 - Remove use-artifact directory from run-task workers after task has finished r=jmaher
Right now artifacts from previous tasks are left lying around. We should clean these up
in case a task accidentally uses an artifact from the wrong dependency.

Ideally we'd cache these properly based on the taskId they came from, but that can be
follow-up fodder.

MozReview-Commit-ID: HUgvNlqyFav
2018-06-04 16:36:28 -04:00
Andrew Halberstadt
d44669c0a2 Bug 1465181 - [run-task] Remove requirement to run as root on POSIX systems, r=gps
There is a superficial check in the run-task script which requires root. Simply
removing this check allows a native-engine task (which isn't running as root)
to proceed.

MozReview-Commit-ID: 44XavXAwxxn
2018-05-29 15:58:07 -04:00
Andrew Halberstadt
e9d8495956 Bug 1465181 - [taskgraph] Stop hardcoding the workdir to /builds/worker in 'job' tasks, r=gps
This adds an optional 'workdir' key to all job schemas. It still defaults to
/builds/worker, but can be overriden by individual tasks or schema
implementations.

MozReview-Commit-ID: LY20xfBhbCP
2018-05-29 16:05:35 -04:00
Andrew Halberstadt
75975b0514 Bug 1461980 - [taskgraph] Add ability to download artifacts from dependencies in run-task script, r=dustin
This adds a 'use-artifacts' key to the run_task schema. Tasks can specify artifacts to download like this:

run:
    using: run-task
    use_artifacts:
        build:
            - target.tar.bz2
            - target.common.tests.zip
            - target.mochitest.tests.zip

This will cause the run-task script to download those three artifacts from the task's 'build' dependency.
If the task doesn't have a 'build' dependency, taskgraph generation will error. The artifacts will be
downloaded into $USE_ARTIFACT_PATH. It is up to the task to do whatever extracting/setup may be required.
E.g this setup could go in the task's command.

At this time, only 'run-task' tasks using docker-worker are supported.

MozReview-Commit-ID: 3f02oCys62i
2018-05-17 10:04:23 -04:00
Gregory Szorc
7753608744 Bug 1460470 - Make run-task Python 3.5+ only; r=mshal
A try push converting run-task to Python 3 seemed to complete without
error.

Since it is annoying writing code that needs to work on both Python
2 and 3, let's require Python 3 and remove code for supporting Python 2.

We implement a version check enforcing Python 3.5+. This is because
we're supposed to be standardizing on 3.5+ everywhere. I want to
prevent accidental usage of older Python 3 versions.

MozReview-Commit-ID: 4vATLZ6Si2e
2018-05-11 10:19:53 -07:00
Gregory Szorc
9e08136b31 Bug 1460470 - Change run-task to use Python 3 by default; r=mshal
Python 3 is the future.

MozReview-Commit-ID: APuu4Q3mimj
2018-05-09 17:26:40 -07:00
Gregory Szorc
5597a50926 Bug 1460470 - More run-task Python 3 porting; r=mshal
Mostly normalization of str and bytes. Python 3 is annoying for
systems level code where most things are bytes.

MozReview-Commit-ID: KpvZGegBkYn
2018-05-09 21:15:36 -07:00
Gregory Szorc
3effa68198 Bug 1460470 - Make run-task somewhat usable on Python 3; r=mshal
This required a lot of attention to bytes versus strings.

The hacks around handling process output are somewhat gross. Apparently
readline() doesn't work on bytes streams in Python 3?! So we install a
custom stream decoder so we can have nice things.

There are still some failures in run-task on Python 3. But we're a big
step closer.

MozReview-Commit-ID: 4FJlTn3q9Ai
2018-05-16 11:06:36 -07:00
Gregory Szorc
47b8bbf23b Bug 1460470 - Make run-task compile on Python 3; r=mshal
The file failed to compile due to octal syntax and missing imports.
After this change, we get a run-time error, which is strictly better.

MozReview-Commit-ID: nY9A13Pt3E
2018-05-16 13:57:08 -07:00
Ciure Andrei
c1890d097c Backed out 5 changesets (bug 1460470) for toolchains bustages a=backout CLOSED TREE
Backed out changeset 94a9641c5a01 (bug 1460470)
Backed out changeset 33fe8423f88c (bug 1460470)
Backed out changeset 4902cab3ce5d (bug 1460470)
Backed out changeset 19fe5702cf6d (bug 1460470)
Backed out changeset ef477a048b57 (bug 1460470)
2018-05-17 01:04:29 +03:00
Gregory Szorc
fc4401e065 Bug 1460470 - Make run-task Python 3.5+ only; r=mshal
A try push converting run-task to Python 3 seemed to complete without
error.

Since it is annoying writing code that needs to work on both Python
2 and 3, let's require Python 3 and remove code for supporting Python 2.

We implement a version check enforcing Python 3.5+. This is because
we're supposed to be standardizing on 3.5+ everywhere. I want to
prevent accidental usage of older Python 3 versions.

MozReview-Commit-ID: 4vATLZ6Si2e
2018-05-11 10:19:53 -07:00
Gregory Szorc
52d7f9394a Bug 1460470 - Change run-task to use Python 3 by default; r=mshal
Python 3 is the future.

MozReview-Commit-ID: APuu4Q3mimj
2018-05-09 17:26:40 -07:00
Gregory Szorc
cc2902b22a Bug 1460470 - More run-task Python 3 porting; r=mshal
Mostly normalization of str and bytes. Python 3 is annoying for
systems level code where most things are bytes.

MozReview-Commit-ID: KpvZGegBkYn
2018-05-09 21:15:36 -07:00
Gregory Szorc
7e3a637aa8 Bug 1460470 - Make run-task somewhat usable on Python 3; r=mshal
This required a lot of attention to bytes versus strings.

The hacks around handling process output are somewhat gross. Apparently
readline() doesn't work on bytes streams in Python 3?! So we install a
custom stream decoder so we can have nice things.

There are still some failures in run-task on Python 3. But we're a big
step closer.

MozReview-Commit-ID: 4FJlTn3q9Ai
2018-05-16 11:06:36 -07:00
Gregory Szorc
262a6b2997 Bug 1460470 - Make run-task compile on Python 3; r=mshal
The file failed to compile due to octal syntax and missing imports.
After this change, we get a run-time error, which is strictly better.

MozReview-Commit-ID: nY9A13Pt3E
2018-05-16 13:57:08 -07:00
Ciure Andrei
d0af75c162 Backed out 5 changesets (bug 1460470) for gps: image build failures a=backout CLOSED TREE
Backed out changeset 07a3e76abc8c (bug 1460470)
Backed out changeset 94c3b68ccc48 (bug 1460470)
Backed out changeset 88324086394e (bug 1460470)
Backed out changeset 16d15b4b97fa (bug 1460470)
Backed out changeset ebd569c9d870 (bug 1460470)
2018-05-16 22:29:17 +03:00
Gregory Szorc
17efc169a2 Bug 1460470 - Make run-task Python 3.5+ only; r=mshal
A try push converting run-task to Python 3 seemed to complete without
error.

Since it is annoying writing code that needs to work on both Python
2 and 3, let's require Python 3 and remove code for supporting Python 2.

We implement a version check enforcing Python 3.5+. This is because
we're supposed to be standardizing on 3.5+ everywhere. I want to
prevent accidental usage of older Python 3 versions.

MozReview-Commit-ID: 4vATLZ6Si2e
2018-05-11 10:19:53 -07:00
Gregory Szorc
3683e6c589 Bug 1460470 - Change run-task to use Python 3 by default; r=mshal
Python 3 is the future.

MozReview-Commit-ID: APuu4Q3mimj
2018-05-09 17:26:40 -07:00
Gregory Szorc
e936706d44 Bug 1460470 - More run-task Python 3 porting; r=mshal
Mostly normalization of str and bytes. Python 3 is annoying for
systems level code where most things are bytes.

MozReview-Commit-ID: KpvZGegBkYn
2018-05-09 21:15:36 -07:00
Gregory Szorc
fa9f6a9233 Bug 1460470 - Make run-task somewhat usable on Python 3; r=mshal
This required a lot of attention to bytes versus strings.

The hacks around handling process output are somewhat gross. Apparently
readline() doesn't work on bytes streams in Python 3?! So we install a
custom stream decoder so we can have nice things.

There are still some failures in run-task on Python 3. But we're a big
step closer.

MozReview-Commit-ID: 4FJlTn3q9Ai
2018-05-16 11:06:36 -07:00
Gregory Szorc
e264e3ec0f Bug 1460470 - Make run-task compile on Python 3; r=mshal
The file failed to compile due to octal syntax and missing imports.
After this change, we get a run-time error, which is strictly better.

MozReview-Commit-ID: nY9A13Pt3E
2018-05-09 16:14:28 -07:00
Geoff Brown
1f62497c49 Bug 1460411 - Add kvm to desktop1604-test image; r=jmaher
Our normal ubuntu 16.04 test image is suitable for hosting an Android x86
emulator with these minor updates: Install kvm and make sure /dev/kvm
rw permissions are open for everyone. Note that /dev/kvm is generally
only visible when running docker with --privileged; its permissions
cannot be modified in the Dockerfile, only at run-time: run-task is the
first opportunity.
2018-05-15 09:57:27 -06:00
Gregory Szorc
1b7113c5ec Bug 1459737 - Assert that volumes aren't used on Windows; r=dustin
Volumes are a docker-worker concept. They shouldn't be encountered on
Windows, which uses generic-worker.

MozReview-Commit-ID: KUdSxVHVJQ
2018-05-04 18:02:54 -07:00
Gregory Szorc
6b79e72760 Bug 1459737 - Move volume configuration to standalone function; r=dustin
Do to volumes what we did to caches.

MozReview-Commit-ID: 7s4nYPC27nk
2018-05-04 18:00:44 -07:00
Gregory Szorc
959355e70d Bug 1459737 - Move cache configuration to standalone function; r=dustin
main() is quite long. And the control flow will become more complicated
as we support Windows.

Let's move the bulk of the cache configuration code into a standalone
function so main() is less cluttered.

MozReview-Commit-ID: xredCubr1E
2018-05-04 17:54:07 -07:00
Gregory Szorc
3a55ef6e0f Bug 1459737 - Require to run on root on POSIX platforms; r=dustin
The code for cache and volume normalization makes assumptions that uid
and gid are defined. They are not defined if not running as root and
Python would crash in these code paths.

So, presumably this means that all tasks using run-task are running as
root. Let's codify that requirement.

This requirement is arbitrary. But let's not scope bloat run-task to
support scenarios until we need them.

MozReview-Commit-ID: 2uW4OSovzWi
2018-05-04 17:47:09 -07:00
Gregory Szorc
688bb10e17 Bug 1459737 - Move closure to module-level function; r=dustin
MozReview-Commit-ID: 2Z2qL8LaEno
2018-05-04 17:41:45 -07:00
Gregory Szorc
c35555237a Bug 1459737 - Teach run-task where to find Mercurial on Windows; r=dustin
Because we can't rely on it being in %PATH%.

MozReview-Commit-ID: H6sMdX7XO5Q
2018-05-04 17:33:19 -07:00
Gregory Szorc
3702b711d5 Bug 1459737 - Make run-task more runnable on non-POSIX platforms; r=dustin
I want to make run-task work on Windows. The script is currently very
POSIX oriented, as it assumes the existence of the grp and pwd modules,
that user IDs are numeric, and that system calls like setresgid() and
setresuid() are available, etc.

This commit starts to make some of the POSIX-centric code conditional
on running on POSIX.

Code for uid/gid extraction has been moved to its own function. Some
error messages were tweaked slightly as part of the move. Otherwise,
the changes should be pretty straightforward.

There are still other parts of this file that won't work on e.g.
Windows. But this gets us a big step closer.

MozReview-Commit-ID: HNyytKcBbBo
2018-05-04 17:11:53 -07:00
Gregory Szorc
7e947fd801 Bug 1459737 - Move run-task into taskcluster/scripts; r=dustin
In preparation for making it usable on Windows, after which point
having it in a directory with "docker" in it doesn't make much sense.

MozReview-Commit-ID: Hgu0buFyJwF
2018-05-04 17:23:31 -07:00