Commit Graph

111 Commits (67953d67c0c36477c54f60e398d19e8b6fcb6668)

Author SHA1 Message Date
Vlad A. Ionescu 60d38f972c Move config under worker config. Add new integration test to GHA matrix.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-13 14:55:36 +03:00
Vlad A. Ionescu b3cf7c43cf Switch to Acquire API.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-12 13:41:33 +03:00
Vlad A. Ionescu 489e17aea9 Add a configuration item to limit parallelism.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-10 15:47:59 +03:00
Akihiro Suda ad681c0154
AkihiroSuda/containerd-fuse-overlayfs -> containerd/fuse-overlayfs-snapshotter
The repo has been moved.

Also bumps up containerd library to v1.5.0-beta.4.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-23 18:43:01 +09:00
Brian Goff d9834f872c
Add support for apparmor/selinux
Set's an apparmor profile on the OCI spec if one is configred on the
worker.
Adds selinux labels to containers (only added if selinux is enabled on
the system).

This assumes that the specified apparmor profile is already loaded on
the system and does not try to load it or even check if it is loaded.

SELinux support requires the `selinux` build tag to be added.
Likewise, `runc` would require both the `apparmor` and `selinux` build
tags.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Vendored go-selinux to v1.8.0
Fixed tests

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 68bb095353)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-04 22:01:34 +01:00
Anders F Björklund 0028c5ed7f Add support for fd:// for socket activation
Used go-systemd code from moby/moby daemon

Only added `buildkitd --addr fd://` for now.

Don't do systemd fds for windows buildkitd

Add buildkit systemd units README/examples

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2020-12-30 16:57:23 +01:00
ktock ae1b79bbc6 Bump github.com/containerd/stargz-snapshotter to v0.2.0
This enables BuildKit to lazily pull eStargz with new footer format.

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-12-10 15:20:57 +09:00
Sebastiaan van Stijn 0da7d8fdaa
vendor: github.com/docker/docker v20.10.0-beta1.0.20201030232932-c2cc352355d4
full diff: 4634ce647c...c2cc352355

also adds github.com/cilium/ebpf as a dependency, which I set to the same
version as is set in containerd/cgroups version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-31 00:34:53 +01:00
ktock 0872ddf6aa Delay decoding stargz config for avoiding extra dependency for config pkg
`cmd/buildkitd/config` pkg is imported and used by other packages including
moby/moby.

Though stargz snapshotter configuration is currently effective only with
buildkitd + OCI worker, `cmd/buildkitd/config` consumer needs to introduce an
indirect dependency to stargz snapshotter's config pkg
(`github.com/containerd/stargz-snapshotter/stargz/config`), which is too much.

This commit solves this by delaying decoding the stargz config until OCI
worker's initialization phase.

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-10-29 23:44:43 +09:00
ktock e3f6e0d249 Bump stargz-snapshotter and partial registry logic integration
Current stargz snapshotter pkg doesn't contain registry configuration and the
client of that pkg needs to pass it to that pkg. So this commit includes changes
of propagating buildkitd's registry configuration to stargz snapshotter.

But this is a partial integration of registry logic between buildkitd and stargz
snapshotter because buildkitd's session-based authentication logic is still not
applied to stargz snapshotter. This means private images that require
`~/.docker/config.json` creds can't be lazily pulled yet.

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-10-29 12:37:03 +09:00
Tonis Tiigi 34343949b9 debug: enable gc triggers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-25 21:49:41 -07:00
ktock fb7fe99311 Enable to use stargz snapshotter without spawning plugin process
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-09-03 14:13:26 +09:00
ktock c975424deb Enable to use remote snapshots for refs
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-08-24 08:44:00 +09:00
Paul "TBBle" Hampson 883c726bd5 Compile containerd worker on Windows
It's not fully-functional at this time, but it now compiles, which means
we are getting nearer to the point where we can start enabling tests.

This will ensure that it _stays_ compilable over time.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-31 02:49:39 +10:00
Tonis Tiigi 06c4197c05 rename binfmt_misc to archutil
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07:00
Tonis Tiigi f825fea268 buildkitd: ensure stack traces on logging errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-17 19:18:49 -07:00
Sebastiaan van Stijn 932c39505b
use containerd/sys to detect UserNamespaces
The implementation in libcontainer/system is quite complicated,
and we only use it to detect if user-namespaces are enabled.

In addition, the implementation in containerd uses a sync.Once,
so that detection (and reading/parsing `/proc/self/uid_map`) is
only performed once.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-15 12:51:20 +02:00
Akihiro Suda eb8c8eeb67 buildkitd: prohibit --oci-worker-rootless for real root
Specifying `--oci-worker-rootless` for real root is meaningless and
should be prohibited

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-05-17 10:16:43 +09:00
Tonis Tiigi 90288ab716 errdefs: update to new packages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-24 11:25:44 -07:00
Tonis Tiigi 725f5e1207 grpc interceptors for errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-22 18:31:32 -07:00
Tonis Tiigi cce301badd solver: attach causing vertex in an error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-21 23:46:17 -07:00
Tonis Tiigi ae3b75d56d errdefs: report component version in stack
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-21 23:46:17 -07:00
Tonis Tiigi e2835e55ad dockerfile: store error location in instructions parser
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-19 20:56:31 -07:00
Tonis Tiigi 37b8832d00 upgrade errors checks to Is()
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-18 22:53:38 -07:00
Tonis Tiigi 56f76a5621 resolver: support self signed certificates
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-03-16 22:09:27 -07:00
Darren Shepherd 6cc8a72665 fix containerd-cni-config-path typo
Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2020-03-13 09:39:55 -07:00
Tonis Tiigi 2c3cf11fde resolver: update to new registryhosts based config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-03-05 19:56:43 -08:00
Akihiro Suda 9f90f5a985 rootless: support fuse-overlayfs
While real overlayfs is available only in Ubuntu and Debian kernels,
fuse-overlayfs is universally available for kernel >= 4.18.

For dockerized deployment, `--device /dev/fuse` needs to be added to
`docker run` flags.

Kubernetes deployment needs a custom device plugin that enables
`/dev/fuse`, e.g. https://github.com/honkiko/k8s-hostdev-plugin

Instead of a device plugin, the device can be also enabled by setting
`securityContext.privileged` to `true`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 11:30:29 +09:00
Tonis Tiigi d1458a6587 update supported platforms without restart
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-02-26 08:15:42 -08:00
Tonis Tiigi e0e29722e2 file: fix compilation on windows
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-01-30 20:21:40 -08:00
Paul "TBBle" Hampson 2bee17a65a Don't always fail euid check on Windows
The check for running as a non-admin euid() doesn't work on Windows,
always returning -1.

For now, treat -1 as "Probably root", and let the failures happen later.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-01-30 00:34:44 +11:00
Paul "TBBle" Hampson 1036fafffa Support npipe the same way we support Unix sockets
The same function used to support Unix sockets automatically supports
Named Pipes on Windows.

This makes the default configuration option for the daemon address work
correctly on Windows.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-01-30 00:34:43 +11:00
Tõnis Tiigi e7304e9a51
Merge pull request #1283 from jeffreyhuang23/issue-1230
Fix issue #1230 (add --oci-worker-binary)
2019-12-12 20:57:59 -08:00
Nikhil Pandeti cb237bf24e Gofmt and goimports config.go, add documentation
Signed-off-by: Nikhil Pandeti <nikhil.pandeti@utexas.edu>
2019-12-12 12:32:47 -06:00
Jeffrey Huang 20258652b3 Fix issue #1230
To support switching the OCI worker binary via buildkitd and without modifying the Dockerfile, an optional command-line flag was added to main_oci_worker.go that allowed for input the name of an OCI worker binary (ex. crun). This OCI worker binary would then replace the current buildkit-runc with a symbolic link to that binary. The above was done using the os/exec package's Command func.

Signed-off-by: Jeffrey Huang <jeffreyhuang23@gmail.com>
2019-12-12 04:33:24 -06:00
Sam Whited 00bfbab039 all: bump the systemd dep to use Go Modules
Signed-off-by: Sam Whited <sam@samwhited.com>
2019-11-11 10:45:43 -05:00
Akihiro Suda c239629fd9 buildkitd: disable TLS for UNIX sockets
Fix #1199

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-12 23:05:01 +09:00
Tonis Tiigi 481d39c176 add cross-repo push support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-22 17:25:13 -07:00
Tonis Tiigi e86374886a util: check for localhost for plainhttp
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-20 17:03:04 -07:00
Tonis Tiigi 57d19b1208 network: refactor cni support to multiple packages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-06 12:52:37 -07:00
Tonis Tiigi 954b73dae1 network: move ns creation from reexec to linkname
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-12 14:57:10 -07:00
Tonis Tiigi e7759a861b client: add cni network tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-10 18:00:06 -07:00
Tonis Tiigi bc7a6f2556 add cni networking support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-07-10 14:42:30 -07:00
Tibor Vass 8e692507ee executor: allow setting DNSConfig to be used by resolvconf
This patch allows downstream code to pass a DNSConfig that is
then used by executor/oci.GetResolvConf.

This would allow the BuildKit-based builder in Docker to honor
the docker daemon's DNS configuration, thus fixing a feature gap
with the legacy builder.

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-17 20:43:33 +00:00
Tonis Tiigi bffb08a1c4 buildkitd: use asyncremove on overlay
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-05-14 14:35:13 -07:00
Akihiro Suda 0dee033264 buildkitd: support sd_notify
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-05-09 03:06:29 +09:00
Akihiro Suda 5225a66020 buildkitd: create buildkitd.lock under root
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-05-08 12:11:57 +09: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
Tõnis Tiigi 758c61e873
Merge pull request #570 from kunalkushwaha/entirlement-revised
security entitlement support
2019-03-28 16:14:06 -07:00
Kunal Kushwaha a2bbb5ff39 security entitlement support
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2019-03-27 13:57:03 +09:00