Commit Graph

57 Commits (6be1257f5d3e7addb4c3cfa67ca657f327d7be98)

Author SHA1 Message Date
Tonis Tiigi 53f657a5db client: add secret mounts test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-19 22:02:11 -07:00
Tonis Tiigi 3fa70c6b25 client: simplify parallel sources test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-09 16:27:08 -07:00
Ian Campbell 0dd25df7e2 client: add test case for multiple parallel builds.
It appears that multiple parallel builds suffer some cross talk between their
mount/snapshots e.g. this new case currently fails because iterations see files
in `/src/` which correspond to other iterations (i.e. iteration 1 might see a
file called "test2.txt"). The `ls -i` and `stat` output also confirms that
where tests see the same filename they are also apparently seeing the same
inode.

Note that each solve uses a `SolverOpt.SharedKey` of the (unique) source
directory so there should be no clashes. Use of `llb.sharedKeyHint()` is
avoided since using a unique one of these hides the issue (AIUI uniqueness of
`sharedKeyHint` is only required with a session, not between them).

The shell fragment within the test is a bit crazy, it tries to output as much
info about what it saw vs what was expected to aid debugging.

I have also been seeing cases in my own code where `cacheContext.checksum`
fails the `not found` test at the top, which seems like either the wrong thing
is mounted or it has gone away or otherwise been mutated unexpectedly. I had
been hoping that this test case would also reproduce this, but so far it has
not.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-09 15:44:28 -07:00
Derek McGowan 618f34a1f9 Support creating and pushing OCI types
Adds image and oci exporter option "oci-mediatypes"
Ensures that the images created in the content store
have the correct type which matches the manifest.
Sets the correct media type on the descriptor in push from
reading the type specified in the manifest.
Removes use of distribution manifest packages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-28 11:23:35 -07:00
Tonis Tiigi ccbf185006 llbsolver: allow sharing modes for cache mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-19 15:57:20 -07:00
Ian Campbell 97ffd6cce8 client: take a context.Context to New().
This allows two things:

- The caller to set a shorter timeout than previously hardcoded 30s. In
  `buildctl` reduce the timeout to 5s. Since the existing timeout has gone
  callers will need to arrange to pass one themselves.
- The caller can arrange for the context to be cancelled for other reasons, use
  this in `buildctl` to plumb through the Ctrl-C handling, meaning that
  `buildctl` now exits almost immediately on Ctrl-C instead of after several
  seconds.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-06-11 14:28:08 +01:00
Tonis Tiigi 30461204da vendor: update fsutil to fix local source bug
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-10 09:22:59 -07:00
Tonis Tiigi 596b03a8a0 llbsolver: allow tmpfs mounts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-08 13:05:14 -07:00
Akihiro Suda 60344aa592
Merge pull request #442 from tonistiigi/runmount
dockerfile: add run --mount support
2018-06-09 02:35:34 +09:00
Tõnis Tiigi 7943598281
Merge pull request #439 from AkihiroSuda/vendor-containerd-20180606
update containerd library
2018-06-08 10:33:10 -07:00
Akihiro Suda 47a00b84fe update containerd library
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-08 21:44:17 +09:00
Tonis Tiigi 055dcb6c09 local: allow followpaths for local source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-07 23:23:13 -07:00
Tonis Tiigi 479419abf2 llbsolver: don’t error on readonly scratch mount
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-07 16:23:53 -07:00
Akihiro Suda 06d81be140
Merge pull request #401 from tonistiigi/relative-wd
llb: fix relative working directory in client
2018-05-22 16:04:24 +09:00
Tonis Tiigi 7e232f5181 llb: fix relative working directory in client
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-21 20:46:37 -07:00
Tonis Tiigi 66488dc6d8 exec: support proxy settings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-21 16:08:11 -07:00
Tonis Tiigi 2bd78c3c6e llbsolver: add support for cached mount type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-15 12:24:20 -07:00
Tonis Tiigi 3ca07f1467 api: allow multiple cache import refs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-14 09:53:34 -07:00
Tonis Tiigi 4ee4ebcb13 cacheimport: fix result checking methods
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-14 09:53:34 -07:00
Tonis Tiigi 75bc38c15b client: add basic cache import test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-14 09:53:34 -07:00
Tonis Tiigi b80f45955a solver: allow exporters to set data to solve results
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-07 20:52:11 -07:00
Ian Campbell ddae5a6ea4 Make llb.ReadonlyRootFS usable with common container images
e.g. with busybox image:

    OCI runtime create failed: container_linux.go:348:
    starting container process caused "process_linux.go:402:
    container init caused \"rootfs_linux.go:58:
    mounting \\\"proc\\\" to rootfs \\\"/.../rootfs\\\" at \\\"/proc\\\"
    caused \\\"mkdir /.../rootfs/proc: read-only file system\\\"\"": unknown

This is because we were setting the underlying snapshot readonly so the various
mountpoints (here /proc) cannot be created. This would not be necessary if
those mountpoints were present in images but they typically are not.

The right way to get around this (used e.g. by `ctr`) is to use a writeable
snapshot but to set root readonly in the OCI spec. In this configuration the
rootfs is writeable when mounts are processed but is then made readonly by the
runtime (runc) just before entering the user specified binary within the
container.

This involved a surprising amount of plumbing.

Use this new found ability in the dockerfile converter's `dispatchCopy`
function.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-04-03 11:04:07 +01:00
Akihiro Suda 3dd4d12796 client: disallow empty output for exportation
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-04-02 13:22:44 +09:00
Akihiro Suda 9ef8233da1 client: support passing io.WriteCloser via SolveOpt for FSSyncTargetFile
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-03-28 15:48:54 +09:00
Ian Campbell ac6598d255 Check that mounts always have a target.
Otherwise the daemon panics when generating the OCI spec.

For belt and braces check in the ExecOp Run function but also when generating the spec.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-22 12:05:12 +00:00
Ian Campbell ae0293c4bf Add an integration test for pulling schema1 images
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-07 15:56:22 +00:00
Tonis Tiigi 23ec7e0239 client: add test for duplicate whiteouts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 16:00:26 -08:00
Tonis Tiigi c71799dff4 client: add test for whiteout parent dirs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 16:00:26 -08:00
Tonis Tiigi d295a16169 client: test duplicate entries in result tarballs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-09 11:47:07 -08:00
Tonis Tiigi 00da260047 client: enable test for parent directories
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-11 17:50:15 -08:00
Tonis Tiigi 1e0b890dd1 client: fix tests to wait snapshots to become releasable
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-08 11:45:53 -08:00
Akihiro Suda 8cd775d108
Merge pull request #254 from tonistiigi/fix-create-time
exported: fix image creation time on export
2018-01-06 15:05:24 +09:00
Tonis Tiigi e0d056f418 exported: fix image creation time on export
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-05 10:51:32 -08:00
Tonis Tiigi b88a98bcad client: add integration tests for prune
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-04 23:09:05 -08:00
Tonis Tiigi 85c0f99ba0 exporter: add Docker compatible exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-18 12:19:17 -08:00
Tonis Tiigi 2e9f0c42f5 client: add test for OCI exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-13 09:57:33 -08:00
Tonis Tiigi 7a5390f355 worker: add support for custom user
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-12 10:26:30 -08:00
Tonis Tiigi 40a0581853 worker: setup own resolvconf and hosts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-10 18:23:24 -08:00
Tonis Tiigi f8e58e359c client: add testcase for exported history array
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-08 20:00:36 -08:00
Akihiro Suda 41cd660444
Merge pull request #197 from tonistiigi/test-parallel
set more tests to parallel
2017-12-09 12:59:38 +09:00
Tonis Tiigi e4f6a5e752 set more tests to parallel
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-08 18:19:08 -08:00
Tonis Tiigi f5f3b39228 client: add tests for differ and pushed data
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-08 14:37:38 -08:00
Tonis Tiigi e0af9d1218 source: add more properties to http source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-04 12:00:46 -08:00
Tonis Tiigi 90d728e194 client: add http source integration test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-02 19:52:15 -08:00
Tonis Tiigi e3f85cc1ac integration: detect test names with reflect
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-11-29 18:49:04 -08:00
Tonis Tiigi f343fc30ec buildctl: add sample cli test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-11-29 18:34:43 -08:00
Tonis Tiigi e1ced023df update intergration tests for reuse
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-11-29 17:42:28 -08:00
Vincent Demeester 5986fa9947
Allow to use TCP for buildkit daemon and client communication
The next step is to allow TLS configuration.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-10-07 22:02:15 +02:00
Akihiro Suda f89ffc2ab4 llb: per-vertex metadata (e.g. IgnoreCache)
cache invalidation itself it not implemented yet

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-10-03 05:36:24 +00:00
Tonis Tiigi cb168bc954 source: add multiple dir support for local source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-20 21:17:23 -07:00