Commit Graph

20 Commits

Author SHA1 Message Date
Mike Hommey
59882266b7 Bug 1341214 - Add a small API to handle taskcluster queue and index requests. r=dustin
Various modules under taskcluster are doing ad-hoc url formatting or
requests to taskcluster services. While we could use the taskcluster
client python module, it's kind of overkill for the simple requests done
here. So instead of vendoring that module, create a smaller one with
a limited set of functions we need.

This changes the behavior of the get_artifact function to return a
file-like object when the file is neither a json nor a yaml, but that
branch was never used (and was actually returning an unassigned
variable, so it was broken anyways).

At the same time, make the function that does HTTP requests more
error-resistant, using urllib3's Retry with a backoff factor.

Also add a function that retrieves the list of artifacts, that while
currently unused, will be used by `mach artifact` shortly.
2017-02-17 12:04:48 +09:00
Mike Hommey
32f26de395 Bug 1341214 - Define GECKO in a single location. r=dustin
Instead of every file trying to get the top source directory having an
ad-hoc definition that gets wrong if the files gets moved around for
some reason, define it in a more central location.
2017-02-17 11:56:12 +09:00
Carsten "Tomcat" Book
20a26945dc Backed out changeset d8122277e9fd (bug 1341214) for causing on m-c problems in vp tc tasks 2017-02-22 15:33:42 +01:00
Carsten "Tomcat" Book
711501d98d Backed out changeset 5ffd6c7264ce (bug 1341214) 2017-02-22 15:33:17 +01:00
Mike Hommey
c7945d8ea1 Bug 1341214 - Add a small API to handle taskcluster queue and index requests. r=dustin
Various modules under taskcluster are doing ad-hoc url formatting or
requests to taskcluster services. While we could use the taskcluster
client python module, it's kind of overkill for the simple requests done
here. So instead of vendoring that module, create a smaller one with
a limited set of functions we need.

This changes the behavior of the get_artifact function to return a
file-like object when the file is neither a json nor a yaml, but that
branch was never used (and was actually returning an unassigned
variable, so it was broken anyways).

At the same time, make the function that does HTTP requests more
error-resistant, using urllib3's Retry with a backoff factor.

Also add a function that retrieves the list of artifacts, that while
currently unused, will be used by `mach artifact` shortly.
2017-02-17 12:04:48 +09:00
Mike Hommey
eb5916da95 Bug 1341214 - Define GECKO in a single location. r=dustin
Instead of every file trying to get the top source directory having an
ad-hoc definition that gets wrong if the files gets moved around for
some reason, define it in a more central location.
2017-02-17 11:56:12 +09:00
CuriousLearner
f27a0ad144 Bug 1302763 - Move docker images out of testing/docker into taskcluster/docker; r=dustin r=CuriousLearner
MozReview-Commit-ID: 7v1uCDB5qoN
2016-10-20 18:25:34 +05:30
Jonas Finnemann Jensen
e09600726d Bug 1324414 - Reference prebuilt docker images by HASH. r=dustin
This adds a HASH file next to the VERSION file in the image
context folders for prebuilt docker images. And uses the
HASH for referencing the image in the tasks created by
the decision task.

This way docker will validate the image hash when pulling it
in production. Thus, attackers won't be able to inject code
by compromising the remote docker registries we use to store
prebuilt images. Further more, this makes validation of the
Chain-Of-Trust artifacts easier as this eliminates the need
for whitelists and hash validation.

MozReview-Commit-ID: FD3B9MyeU9Q
2016-12-19 11:31:56 +01:00
Sebastian Hengst
a30693c808 Backed out changeset fe7303de56be (bug 1302763) for failing webdriver tests on Linux x64 debug (geckodriver.manifest fetch failed). r=backout 2016-12-19 21:15:07 +01:00
CuriousLearner
5ad707be1b Bug 1302763 - Move docker images out of testing/docker into taskcluster/docker; r=CuriousLearner
MozReview-Commit-ID: 7v1uCDB5qoN
2016-10-20 18:25:34 +05:30
Jonas Finnemann Jensen
6a00728363 Bug 1316446 - Improve mach taskcluster-load-image r=gps
MozReview-Commit-ID: 3Y8fI5WXP1Y
2016-11-10 18:05:52 -08:00
Jonas Finnemann Jensen
2bae2cad08 Bug 1316183 - Compress docker images with zstd. r=dustin
* Compress docker images with zstd
 * Removed need for context.tar from decision task
 * Index images by level rather than project

MozReview-Commit-ID: 4RL4QXNWmpd
2016-11-07 11:26:27 -08:00
Gregory Szorc
c4aaaa805b Bug 1290531 - Build Docker images from custom tar contexts; r=dustin
Now that Docker image building is called from Python, we can start to
do advanced stuff with it.

With this commit, we switch from building Docker images directly from
the source directory ("the Docker way") to using our custom Docker image
build contexts.

The main advantage of this is that locally-built Docker images can now
use our custom Dockerfile syntax to include extra files in the build
context!

The code for building a Docker image from a context has been extracted
to its own standalone function. I have nefarious plans for this in the
future, such as the ability to override the FROM syntax to specify
URLs of images. This would allow us to host base images on our own
server, which removes a dependency on Docker Hub and improves
determinism, since images on Docker Hub change all the time.

MozReview-Commit-ID: 5lTdV8yEHkc
2016-07-29 13:41:59 -07:00
Gregory Szorc
62f4d481c2 Bug 1290531 - Invoke docker from Python, remove build.sh; r=dustin
build.sh had been reduced to invoking `docker`. We move that invocation
to Python and remove build.sh. Long live build.sh!

MozReview-Commit-ID: FQBDJv4HSaU
2016-07-29 13:22:06 -07:00
Gregory Szorc
67aa547f7e Bug 1290531 - Move image tag resolution to Python; r=dustin
We already had code for resolving the image registry and tag. We
refactored it slightly to be more useful then changed build.sh to
accept the tag as an argument.

At this point, build.sh is basically a wrapper around `docker`. But
there's a special case for executing custom "build.sh" files we
need to eliminate first...

MozReview-Commit-ID: A9HVvxgCdG2
2016-07-29 13:06:10 -07:00
Gregory Szorc
c5501b72a5 Bug 1290531 - Move image name verification to Python; r=dustin
MozReview-Commit-ID: 8KJZH5vjANS
2016-07-29 12:59:46 -07:00
Gregory Szorc
594ff4f3ad Bug 1290531 - Move docker validation from build.sh to Python; r=dustin
Now that we have a mach command and Python code for doing Docker image
building, we can start moving code from build.sh to Python.

We start with searching for and validating the `docker` binary works.

MozReview-Commit-ID: 2DCc3b8UyZ3
2016-07-29 12:58:39 -07:00
Gregory Szorc
f1364a2a25 Bug 1290531 - Add mach taskcluster-build-image command; r=dustin
Docker image building will soon need to use Python in order to produce
the image build context archive.

As the first step towards this, we introduce a Python function that
calls out to build.sh. We also implement a mach command that calls it
so we can test the functionality.

I'm not keen about introducing a new mach command. I'd prefer to have
a sub-command instead. I'm not sure what all uses
`mach taskcluster-load-image`. Perhaps we could make a `taskcluster`
top-level command. Or perhaps we could fold these image commands into
`mach taskgraph`? Either way, the mach side of this isn't terribly
important to the commit series: most of the code will live inside a
Python module outside of mach.

MozReview-Commit-ID: AI8p6H4psNh
2016-07-29 12:45:25 -07:00
Gregory Szorc
1498dcf793 Bug 1288567 - Use create_context_tar in generate_context_hash; r=dustin
This restores order to only having a single hash for a context
directory.

Using a tempfile here is a bit unfortunate. It can be optimized later,
if needed.

MozReview-Commit-ID: LMNsvt3fDYx
2016-07-22 12:46:06 -07:00
Dustin J. Mitchell
8bc81a73e8 Bug 1275409: remove taskcluster_graph.image_builder; r=wcosta
MozReview-Commit-ID: 21HBtcDVPXC
2016-06-06 18:55:10 +00:00