Commit Graph

51 Commits (5872bf3dd16461a5d44e1e3d563418c594557782)

Author SHA1 Message Date
Erik Sipsma d73e62f878 Add initial MergeOp implementation.
This consists of just the base MergeOp with support for merging LLB
results that include deletions using hardlinks as the efficient path
and copies as fallback.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-18 11:10:48 -08:00
Erik Sipsma 9321ec2f82 Refactor cache record mount cache.
This is mostly just preparation for merge-op. The existing
Extract method is updated to be usable for unlazying any type of refs
rather than just lazy blobs. The way views are created is simplified and
centralized in one location.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-17 11:02:16 -08:00
CrazyMax 54b8ff2fc8
go fmt: add //go:build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-28 13:26:43 +02:00
Koichi Shiraishi 671ae38fb7
all: unify the specs-go package import alias to ocispecs
ocispecs means "O"pen "C"ontainer "I"nitiative image-spec/"specs"-go/v1
                      opencontainers          /image-spec/specs-go/v1

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2021-08-11 08:29:09 +09:00
Tonis Tiigi c8b8d6ce63 exptypes: define empty gz layer digest
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-18 23:39:23 -07:00
Paul "TBBle" Hampson f9b8fc64b1 Give a name to the only mount we care about
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-24 20:40:46 +10:00
Paul "TBBle" Hampson 4e69b50469 Shortcut read-only bind-mounts in Windows, like non-Windows
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-24 20:36:39 +10:00
Paul "TBBle" Hampson cd47186783 Split LocalMounter.Mount into Windows and Unix
Due to current deficiencies in the Windows implementation of
containerd's Mount.Mount, we need different behaviour for mounting on
Windows and Unix platforms.

Specifically:
* Windows mounts can only mount in-place, and hence only one mount
  should be in the list.
* BuildKit doesn't own the mount directory, so should not try and remove
  it on unmount.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-16 17:13:46 +10:00
Sebastiaan van Stijn 3ddd1fc23c
Fix goimports linting
```
[5/5] RUN --mount=target=/go/src/github.com/moby/buildkit 	gometalinter ...
0.435 util/rootless/specconv/specconv_linux.go:1:⚠️ file is not goimported (goimports)
1.320 cache/manager.go:1:⚠️ file is not goimported (goimports)
1.335 cache/manager_test.go:1:⚠️ file is not goimported (goimports)
1.337 cache/migrate_v2.go:1:⚠️ file is not goimported (goimports)
1.342 cache/refs.go:1:⚠️ file is not goimported (goimports)
1.454 cache/remotecache/registry/registry.go:1:⚠️ file is not goimported (goimports)
2.285 cmd/buildctl/build.go:1:⚠️ file is not goimported (goimports)
3.082 executor/oci/user.go:1:⚠️ file is not goimported (goimports)
4.333 session/content/content_test.go:1:⚠️ file is not goimported (goimports)
4.614 snapshot/containerd/content.go:1:⚠️ file is not goimported (goimports)
4.721 solver/errdefs/vertex.go:1:⚠️ file is not goimported (goimports)
6.066 util/network/cniprovider/cni.go:1:⚠️ file is not goimported (goimports)
ERROR: executor failed running [/bin/sh -c gometalinter --config=gometalinter.json ./...]: buildkit-runc did not terminate successfully
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-13 17:38:56 +02:00
Akihiro Suda 7b579cdb98 vendor: update containerd (and various packages)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-28 10:24:10 +09:00
Tonis Tiigi 3cedd2c0e5 cache: fix image share checker ref leak
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:34:53 -07:00
Tonis Tiigi 6be136db6e cleanup unused code
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:33:01 -07:00
Tonis Tiigi 688e2c2272 cache: update components to new lease based cache manager
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:32:04 -07:00
Tonis Tiigi b9ec2bc4d4 cache: update manager to use leases instead of root labels
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:31:51 -07:00
Tonis Tiigi b8284301fd integration: detect double released and leaked mountpoints
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-16 08:03:26 -07:00
Tonis Tiigi a0dead0809 fix possible double release on mountable
Refactor the interface to avoid such issues in the future.

BuildKit own mounts are stateless and not affected but
a different mountable implementation could get confused.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-16 08:03:16 -07:00
Tonis Tiigi 8e25187cc7 pull: fix content blobs deletion on pull race
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-28 14:39:05 -07:00
Wei Fu ffad8ada79 exporter: support unpack opt for image exporter
It is enhancement which allows to unpack image into containerd
snapshotter storage by `--output type=image,<.>=<.>,unpack=true`.

In order to support this feature, we needs to extend the Snapshotter
witwh `Name() string` function. Because we needs to set gc label for
snapshotter which need snapshotter name.

fix: #908

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-04-24 21:24:06 +08:00
Tonis Tiigi 6921dbe0f6 snapshot: base for userns remapping
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-02 18:23:46 -07:00
Tonis Tiigi 2dc7a133a2 content: fix setting wrong gc labels on config query
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-18 12:00:09 -07:00
Derek McGowan edd603e4cd Update containerd vendor
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-02-13 11:03:48 -08:00
Iskander (Alex) Sharipov e9fc4f63f1
snapshot: fix impossible condition
The `err == nil` is probably a typo of `err1 != nil`.
Found using gocritic linter `badCond` checker.
2018-12-11 01:36:13 +03:00
Tonis Tiigi 89e8097d4c fix setting uncompressed label on content
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-10-08 23:11:25 -07:00
Tonis Tiigi e210ffc72e imagerefchecker: fix concurrent map access
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-27 17:12:35 -07:00
John Howard 2de2c04c8e Revendoring to move boltdb to bbolt
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-09-18 11:18:08 -07:00
Tonis Tiigi d1ad6961e3 cache: detect refs shared with image store
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-27 14:08:50 -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
Akihiro Suda 1269bc5682 snapshot: wrap mount err
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-02 15:33:26 +09:00
Tonis Tiigi 138d2d5a3d containerd: avoid contentstore race
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-05-07 13:14:09 -07:00
Tõnis Tiigi cd0e7e8fd6
Merge pull request #355 from tonistiigi/mounts-update
snapshot: update mounts to mountable interface
2018-05-01 17:56:46 -07:00
Tonis Tiigi d7f8a4e1a4 snapshotter: avoid snapshot removal race
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-04-30 15:46:01 -07:00
Tonis Tiigi 566e28c174 snapshot: update mounts to mountable interface
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-04-27 17:58:24 -07:00
Tonis Tiigi b0679c66db snapshot: clean up snapshot interface
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-04 23:09:05 -08:00
Tonis Tiigi 56353f99a8 snapshot: combine nogc snapshotting helpers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-04 23:09:05 -08:00
Tonis Tiigi fdfa6bcb59 vendor: update containerd to 1.0.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-12-04 23:34:25 -08:00
Tonis Tiigi 6c076f5d6a cleanup linter warnings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-11-16 18:09:35 -08:00
Akihiro Suda c71a1ca768 bump up containerd (v1.0.0-beta.3)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-13 05:36:59 +00:00
Tonis Tiigi 5f4b51d0c9 blobmap: fix diffid storing on pull
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-10-13 15:38:08 -07:00
Tonis Tiigi 9f6d9a9e78 exporter: add local exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-08-04 17:12:19 -07:00
Derek McGowan 9ce5053a8b Update containerd version
Fix for logrus rename, use fork until fixed in moby.
Removed unused tar stream.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-26 11:07:45 -07:00
Tonis Tiigi eac79f7c7e cache: refactor reference reuse and caching
Replaces previous mutable.Freeze logic with
commits that can live together with mutable data.
Finalize method is added if the implementation
needs to make sure that the immutable ref is
flushed to the driver. Refs are automaitcally
finalized when writable layers are created on
top of them.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-18 16:01:01 -07:00
Tonis Tiigi 44415841c9 make blobmapping use metadata package
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-04 21:55:27 -07:00
Tonis Tiigi 08134677cd worker: runc worker exection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-06-02 10:20:05 -07:00
Tonis Tiigi f4695e7b4e blobmapping: account blob size in disk usage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-31 16:52:53 -07:00
Tonis Tiigi 1c5dbe562a cachemanager: size reporting in diskusage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-31 16:45:04 -07:00
Tonis Tiigi 5a0f803917 imagesource: fill blob map on pull
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-31 15:36:04 -07:00
Tonis Tiigi 490ac15654 snapshot: add tracking for content blobs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-31 15:09:48 -07:00
Tonis Tiigi fdde46f7ff cachemanager: check pulled snapshot
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-30 14:17:04 -07:00
Tonis Tiigi fb5d216beb cachemanager: add commit support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-26 11:57:18 -07:00
Tonis Tiigi f2739f0728 cachemanager: new active creation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-26 10:20:41 -07:00