Commit Graph

9 Commits

Author SHA1 Message Date
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
Gregory Szorc
253c498807 Bug 1290611 - Normalize mode of created file in tests; r=dustin
Without this, current umask may influence test results. That was
causing differences between automation and local runs.

MozReview-Commit-ID: 1eu613aBpKB
2016-08-02 08:36:19 -07:00
Dustin J. Mitchell
29364a87ea Bug 1290611: fix test_generate_context_hash; r=gps
The existing hash was for an empty tarfile.  Oops!

MozReview-Commit-ID: 1KOZxnDmoOH
2016-07-29 22:54:18 +00:00
Gregory Szorc
47830cf2f1 Bug 1288567 - Add special Dockerfile syntax to add arbitrary files to context; r=dustin
A limitation of traditional docker build context generation is it
only includes files from the same directory as the Dockerfile. When
repositories have multiple, related Dockerfiles, this limitation
results file duplication or putting all Dockerfiles in the same
directory (which isn't feasible for mozilla-central since they would
need to be in the root directory).

This commit enhances Dockerfiles to allow *any* file from the
repository checkout to be ADDed to the docker build context.

Using the syntax "# %include <path>" you are able to include paths
or directories (relative from the top source directory root) in the
generated context archive. Files add this way are available under the
"topsrcdir/" path and can be ADDed to Docker images.

Since context archive generation is deterministic and the hash of
the resulting archive is used to determine when images need to be
rebuilt, any extra included file that changes will change the hash
of the context archive and force image regeneration.

Basic tests for the new feature have been added.

MozReview-Commit-ID: 4hPZesJuGQV
2016-07-21 16:51:30 -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
Gregory Szorc
a3dd46e83d Bug 1288567 - Add basic test for context tar creation; r=dustin
Now that the context tar creation function is standalone and doesn't
rely on external state, we can start unit testing it easier.

We establish a basic unit test that verifies the function works as
advertised and that output is deterministic.

MozReview-Commit-ID: H4MY28PiHSN
2016-07-22 10:57:27 -07:00
Justin Wood
46e1d74044 Bug 1280956 - Use in-tree linter job to flake8 test taskcluster directory. r=dustin
MozReview-Commit-ID: FsWmAnnycZ2
2016-06-20 21:06:55 -04: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
Dustin J. Mitchell
2ccf79973b Bug 1275409: move templates to taskgraph.util; r=wcosta
MozReview-Commit-ID: 3vdnm20W4OD
2016-06-05 18:34:22 +00:00