Commit Graph

614 Commits (12fd7edc2445659818a6e6072f9a24abca1cfe80)

Author SHA1 Message Date
Tonis Tiigi 12fd7edc24 gateway: typo fix
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-03-08 10:13:26 -08:00
Tõnis Tiigi abe6627919
Merge pull request #303 from ijc/vndr-fixes
vendoring: try to catch more vendoring issues & fixup an existing one
2018-03-08 10:03:52 -08:00
Ian Campbell 86912f507e vendor.conf: Readd github.com/morikuni/aec
Accidentally removed in faf258dd2e ("vendor: add go-units").

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-08 14:46:28 +00:00
Ian Campbell 0d34cceeb6 vendoring: try to catch more vendoring issues.
At the moment vendor.conf is missing entries for `github.com/tonistiigi/llb-gobuild`
and `github.com/morikuni/aec` due in part because of a combination of
https://github.com/LK4D4/vndr/issues/62 and https://github.com/LK4D4/vndr/issues/63.

The issue vndr#63 (related to lack of `github.com/morikuni/aec`) can be worked
around by removing the vendor directory before rerunning `vndr`, so do so.

Due to vndr#62 the issue with `github.com/tonistiigi/llb-gobuild` cannot be
detected at the moment, but pass `-strict` to `vndr` in anticipation of a fix
there.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-08 14:46:28 +00:00
Tõnis Tiigi e8dbd3aeb4
Merge pull request #302 from ijc/improved-schema1-support
Improved schema1 support
2018-03-07 09:41:34 -08: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
Tõnis Tiigi 18280e73cc
Merge pull request #289 from ijc/allow-local-image-for-gateway-fe
Use local images if pull fails
2018-03-06 09:59:17 -08:00
Ian Campbell ac5091c10b Use local images if pull fails
When using `--frontend=gateway.v0` in order to use a tagged image as the
frontend it is currently required to push the tag to a registry, so that
buildkit can pull it. One can use the `image@sha256:digest` form but this is
inconvenient for the development cycle.

Instead, introduce a proxy `Resolver` which if the pull fails checks the local
image store (if there is one, which is worker dependent) for a suitable image
and if so uses that.

With this I can now:

    buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --exporter=image --exporter-opt=name=docker.io/ijc25/fe:dev
    builtctl build --frontend=gateway.v0 --frontend-opt=source=ijc25/fe:dev --exporter=image --exporter-opt=name=hello-world:dev

Without any push to a registry.

I am using the containerd worker.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-06 12:19:34 +00:00
Ian Campbell b7632ad036 Correct content-store management after schema1 conversion
The previous code had 3 issues:

- The original schema 1 manifest remained in `ongoing.added` but was not added
  to the content store by the conversion. #296 tried to address this in an
  incorrect way and was reverted by the previous commit. Instead switch in the
  schema2 manifest, which was otherwise missed.
- Empty layers in the schema 1 manifest are not propagated to the schema 2
  version, meaning they are not referenced by anything and hence are never
  freed up and therefore leak
- The new schema 2 image config is generated by the converter and not fetched,
  so it never passes through the `HandlerFunc` which adds things to
  `ongoing.added`.

Two address these last two bullets when processing a schema 1 image walk over
the converted image and together with `ongoing.added` produce lists of used and
unused blobs, use the list of used blobs to perform the GC updates and simply
delete everything on the unused list.

Closes: #301.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-02 16:26:47 +00:00
Ian Campbell 0ff79ec71c Revert "Swallow a NotFound error when deleting content, to support schema 1 manifests"
This reverts commit 92101de156 from #296.

This was the wrong approach a subsequent commit will fix this properly.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-03-02 16:10:19 +00:00
Akihiro Suda 1b31410147
Merge pull request #299 from tonistiigi/cache-release
solver: add support for releasing cached results
2018-02-28 15:46:19 +09:00
Tonis Tiigi 832c140d4a solver: add release support for bolt backend
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-27 15:54:21 -08:00
Tonis Tiigi a9db799188 solver: add support for releasing cached results
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-27 15:53:18 -08:00
Tõnis Tiigi 666a5e4119
Merge pull request #293 from AkihiroSuda/move-llb
llb: update docs
2018-02-27 07:42:03 -08:00
Akihiro Suda ecf2e8dbc9 llb: update docs
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-27 16:06:01 +09:00
Akihiro Suda c5795fea02
Merge pull request #297 from tonistiigi/boltdb-cache
solver: add boltdb cache store and test suite
2018-02-27 12:48:56 +09:00
Tonis Tiigi e8af448b3a solver: add boltdb cache store and test suite
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-26 17:42:10 -08:00
Tõnis Tiigi cd6e788437
Merge pull request #296 from ijc/support-schema1-manifest
Swallow a NotFound error when deleting content, to support schema 1 m…
2018-02-26 11:31:58 -08:00
Ian Campbell 92101de156 Swallow a NotFound error when deleting content, to support schema 1 manifests
The behaviour of `github.com/containerd/containerd/remotes/docker/schema1` is
such that the manifest is not actually in the content store, so attempting to
delete it fails with `NotFound`, which with the `gateway.v0` frontend results
in:

    time="2018-02-26T17:01:15Z" level=error msg="fatal error: rpc error: code = Unknown desc = content digest sha256:178598e51a26abbc958b8a2e48825c90bc22e641de3d31e18aaf55f3258ba93b: not found"
    panic: rpc error: code = Unknown desc = content digest sha256:178598e51a26abbc958b8a2e48825c90bc22e641de3d31e18aaf55f3258ba93b: not found

It seems safe to just ignore these errors, since `NotFound` is what we wanted
after delete anyway.

This allows support for e.g. `llb.Image("docker.io/docker/whalesay:latest")`

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-02-26 17:08:52 +00:00
Tõnis Tiigi 96ad291c82
Merge pull request #295 from AkihiroSuda/reusable-docker-exporter-
exporter/oci: split reusable dockerexporter
2018-02-26 08:20:11 -08:00
Tõnis Tiigi 9ee3800a08
Merge pull request #290 from tonistiigi/session-prefix
session: clear prefix on lookup
2018-02-26 07:47:58 -08:00
Tõnis Tiigi aa58489e10
Merge pull request #294 from AkihiroSuda/runc-split-snapshotter
worker/oci: allow specifying arbitrary snapshotter factory
2018-02-26 07:33:06 -08:00
Akihiro Suda de73349f01 worker/oci: allow specifying arbitrary snapshotter factory
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-26 18:15:10 +09:00
Akihiro Suda e008553762 exporter/oci: split reusable dockerexporter
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-26 18:02:58 +09:00
Akihiro Suda d99b929a64
Merge pull request #292 from tonistiigi/cache-storage
solver: separate cache metadata storage interface
2018-02-26 14:00:46 +09:00
Tonis Tiigi ff7d75def0 solver: separate cache metadata storage interface
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-23 17:44:56 -08:00
Tonis Tiigi b7424f41fd session: clear prefix on lookup
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-23 10:52:55 -08:00
Akihiro Suda 47af144c29
Merge pull request #288 from tonistiigi/implicit-from
dockerfile: fix copy from implicit stage
2018-02-22 13:19:28 +09:00
Tonis Tiigi cd110f6b10 dockerfile: fix copy from implicit stage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-21 18:17:30 -08:00
Vincent Demeester 40212c5fcd
Merge pull request #286 from AkihiroSuda/oci-worker-overlay-false
worker/oci: allow using naive snapshotter
2018-02-20 14:38:47 +01:00
Akihiro Suda 622d4a442a worker/oci: allow using naive snapshotter
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-20 12:13:18 +09:00
Akihiro Suda f1d48b453a
Merge pull request #285 from tonistiigi/cache-export
solver: add cache export support
2018-02-20 09:36:13 +09:00
Tonis Tiigi fcacfc8152 solver: add cache export support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-16 11:30:40 -08:00
Akihiro Suda 481371a99d
Merge pull request #284 from tonistiigi/cache-selector
solver: implement selector for cachemap
2018-02-14 11:35:39 +09:00
Akihiro Suda 794d61c1e6
Merge pull request #280 from tonistiigi/update-containerd
vendor: update containerd to v1.0.2
2018-02-14 11:34:55 +09: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 7906fb3085 vendor: update containerd to v1.0.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 16:00:09 -08:00
Tonis Tiigi 0197a6eaea solver: add tests with selector cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 09:59:53 -08:00
Tonis Tiigi 71774ae35f solver: add selector support to cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-13 09:59:48 -08:00
Tõnis Tiigi c2920e66b4
Merge pull request #283 from tonistiigi/subbuild
solver: add tests for subbuild
2018-02-12 17:38:52 -08:00
Tonis Tiigi 61e81153e7 solver: add tests for subbuild
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-12 11:52:56 -08:00
Akihiro Suda 32cd102781
Merge pull request #281 from tonistiigi/duplicates-test
client: test duplicate entries in result tarballs
2018-02-10 18:33:05 +09:00
Vincent Demeester 5676c633a3
Merge pull request #282 from tonistiigi/test-usage
buildctl: add test for usage
2018-02-10 10:02:00 +01:00
Tonis Tiigi a0d98d3e6b buildctl: add test for usage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-09 17:16:00 -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
Akihiro Suda 787af956e3
Merge pull request #279 from tonistiigi/ignore-cache
solver: add ignore-cache vertex options
2018-02-09 13:19:30 +09:00
Akihiro Suda da21a0d1ee
Merge pull request #277 from tonistiigi/copy-fix
dockerfile: fix issues with duplicate copy instructions
2018-02-09 11:18:35 +09:00
Tonis Tiigi 40316d68d2 solver: add ignore-cache vertex options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-08 16:58:20 -08:00
Tonis Tiigi ad6ab8aba2 dockerfile: new tests for copy
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-05 14:33:48 -05:00