Commit Graph

535 Commits (master)

Author SHA1 Message Date
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
Sebastiaan van Stijn dcb25c53b8
util/tracing: remove incorrect import enforcing comment
This import comment caused compilation of buildx to fail if `GO111MODULE` was
set to `off`:

Without `GO111MODULE` set (but with `-mod=vendor`:

    echo $GO111MODULE

    export PKG=github.com/docker/buildx
    export LDFLAGS="-X ${PKG}/version.Version=$(git describe --match 'v[0-9]*' --always --tags) -X ${PKG}/version.Revision=$(git rev-parse HEAD) -X ${PKG}/version.Package=${PKG}"
    GOFLAGS=-mod=vendor go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx
    bin/docker-buildx version
    github.com/docker/buildx v0.6.0 d9ee3b134cbc2d09513fa7fee4176a3919e05887

When setting `GO111MODULE=off`, it fails on the incorrect import path in the
vendored file (looks like GO111MODULE=on ignores import-path comments?):

    export GO111MODULE=off
    root@5a55ec1c1eed:/go/src/github.com/docker/buildx# GOFLAGS=-mod=vendor go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx
    vendor/github.com/moby/buildkit/client/client.go:20:2: code in directory /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc expects import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
    vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/connection/connection.go:33:2: found import comments "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" (options.go) and "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" (optiontypes.go) in /go/src/github.com/docker/buildx/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-28 13:09:49 +02:00
Tõnis Tiigi dc397eae4a
Merge pull request #2238 from tonistiigi/http-tracing
tracing: update to otelhttp roundtripper
2021-07-15 19:35:03 -07:00
Tõnis Tiigi 3790ea3f71
Merge pull request #2259 from tonistiigi/conn-limit2
new implementation for limiting tcp connections
2021-07-15 19:34:39 -07:00
Tonis Tiigi 30188347a3 contentutil: change offset to int64 to simplify
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-15 00:01:30 -07:00
Akihiro Suda 66d30551db
Merge pull request #2242 from tonistiigi/idle-conns
resolver: increase default idle conns reuse
2021-07-15 13:44:52 +09:00
Tonis Tiigi eaa3e100eb ensure wrappers support seeking to continue partial downloads
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-14 20:41:10 -07:00
Tonis Tiigi dc37a052b4 limited: allow extra high-priority connection for json requests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-14 20:41:10 -07:00
Tonis Tiigi f269d00f28 new implementation for limiting tcp connections
The previous implementation had many issues. Eg. on fetch, even if
the data already existed and no remote connections were needed
the request would still be waiting in the queue. Or if two fetches
of same blob happened together they would take up two places in queue
although there was only one remote request.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-14 20:41:02 -07:00
Tonis Tiigi 5a318dd017 tracing: update to otelhttp roundtripper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-13 23:29:03 -07:00
Tonis Tiigi a558ac4cce add per domain semaphore to limit concurrent connections
This is a safer alternative until we figure out why
http.Transport based limiting fails.

Some connections like cache export/import do not have a
domain key atm and these connections use global pool.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-13 14:08:03 -07:00
Tõnis Tiigi 06e8602caa
Merge pull request #2236 from morlay/master
refactor to use `util/bklog.G(ctx)` instead `logrus.` directly
2021-07-13 00:25:22 -07:00
Morlay 18b49fd7dc refactor to use util/bklog instead of using logurs directly
Signed-off-by: Morlay <morlay.null@gmail.com>
2021-07-13 11:42:31 +08:00
Tonis Tiigi 782010121e resolver: increase default idle conns reuse
The current default were even lower than stdlib defaults.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-12 00:29:30 -07:00
Tonis Tiigi 936df190af remove tracetransform package
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-11 20:22:43 -07:00
Morlay 1ed2d45894 log with traceID and spanID
Signed-off-by: Morlay <morlay.null@gmail.com>
2021-07-09 12:53:57 +08:00
Tõnis Tiigi 9df59934cd
Merge pull request #2218 from tonistiigi/error-suggest
dockerfile: add suggestions to how to fix certain errors
2021-07-07 10:52:07 -07:00
Tonis Tiigi 277517e2a3 add error suggest pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-02 17:29:27 -07:00
Akihiro Suda 1a7543a105
Merge pull request #2163 from tonistiigi/detect-otel-env 2021-07-03 01:01:34 +09:00
Akihiro Suda edc28d1b02
Merge pull request #2214 from tonistiigi/plain-error-logs
progressui: print logs for failed step as summary in plain mode
2021-07-01 17:09:15 +09:00
Tonis Tiigi 460ba750fd grpcerrors: avoid rpc error wrapping in error messages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-30 20:27:36 -07:00
Tonis Tiigi 600d2837b5 progressui: print logs for failed step as summary in plain mode
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-30 20:23:20 -07:00
Cory Bennett b1d441b175 [#2112] progress.FromContext returns a writer factory
this allows progress.Controller to manage the writer lifecycle

Signed-off-by: Cory Bennett <cbennett@netflix.com>
2021-06-28 18:58:29 +00:00
Cory Bennett 1da8b671c4 [#2112] progress.Controller should own the progress.Writer to prevent leaks
Signed-off-by: Cory Bennett <cbennett@netflix.com>
2021-06-28 18:56:45 +00:00
Tonis Tiigi 3eec4287f6 flightcontrol: reduce contention between goroutines
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-22 22:10:47 -07:00
Tonis Tiigi 1d0597e85a handle unconfigured spans without errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-22 08:27:35 -07:00
Tonis Tiigi 14d606c289 client: pass delegated exporter as parameter
Avoid client package having dependency on global detect package.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:41 -07:00
Tonis Tiigi d512920c24 support collecting traces from llb.Exec
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:35 -07:00
Tonis Tiigi d8fc4e15f9 enable collecting traces via control api
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:35 -07:00
Tonis Tiigi 750f9af97c otlgrpc: provide a way to get otlp client from grpc conn
Hopefully this can be removed with a future upstream change
that could make this configurable. The package also needs
internal dependency that is copied in.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:35 -07:00
Tonis Tiigi b873f0b5f1 tracing: add delegated exporter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:35 -07:00
Tonis Tiigi 723ea5795c add transform package to convert from otlp
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-20 21:57:35 -07:00
Tonis Tiigi 69a8caa3be add current tracing context detection and exec propagation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit bc9a83144c83e9fd78007b7bfe92e8082c59d40e)
2021-06-20 21:57:35 -07:00
Tonis Tiigi 7489cc8be0 vendor: update opentelemetry to 1.0.0-rc
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-19 10:02:26 -07:00
Tonis Tiigi c773a215c1 integration: add common context base to all integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-18 20:49:49 -07:00
Sebastiaan van Stijn c325f89fa1
replace uses of deprecated containerd/sys.RunningInUserNS()
This utility was moved to a separate package, which has no dependencies.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-18 11:14:26 +02:00
Tonis Tiigi 7849ab58eb retryhandler: use net.ErrClosed for error check
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-17 16:55:37 -07:00
Tonis Tiigi b10f25944b correctly validate span from context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi 8f50bae3f1 replace opentracing with opentelemetry tracers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi 292f1faf12 add support for opentelemetry
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:22 -07:00
Tonis Tiigi b97d0f7dab vendor: update vt100 to fork and remove replace rule
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 19:30:51 -07:00
Akihiro Suda 59d2f76e5e
Merge pull request #2161 from tonistiigi/auth-context
session: make sure all token request keep correct context
2021-06-11 14:38:40 +09:00
ktock 1764b3b249 Enable stargz snapshotter to use session for snapshot auth
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2021-06-09 16:10:08 +09:00
Tonis Tiigi 53e7116197 session: make sure all token request keep correct context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-08 21:17:35 -07:00
Tõnis Tiigi 03af083def
Merge pull request #2144 from thaJeztah/bump_golang
update to go 1.16
2021-06-08 10:30:33 -07:00
Sebastiaan van Stijn 12c9920fb5
move RegistryConfig to resolver package
This allows using the resolver package without having to import
the buildkit daemon configuration.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-08 12:59:46 +02:00
Tonis Tiigi 19453d5acc test: fix mirror cache handling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-07 18:59:32 -07:00
Sebastiaan van Stijn 22dd74ae93
update to go 1.16
This updates all occurrences of Go 1.13 to Go 1.16; also updated
the code that's used to redact credentials in URLs to use the Go
implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-02 00:31:57 +02:00
Sebastiaan van Stijn 056afec140
generated files: update google/protobuf v1.3.5, and fix install for go modules
This patch updates the script and Dockerfile to prevent issues when using go
modules.

The first change is to use a plain `git clone` instead of `go get -d` to download
the source. While (like "pre go-modules") `go get -d` won't *build* the binaries
when go modules are used, it *will* use go modules to download the package
(and dependencies); as a result:

- no git repository will be cloned in gopath
- go modules will be downloaded for "master" (not the version that we specify
  to build)

Note: Once we update to Go 1.16, this script could be updated to use `go install <repo>@version`

The second change is an update to the `update-generated-files` script to detect
the correct version of google/protobuf to use from the `go.mod`'s  `replace` rule,
to make sure we generate (and verify) using the correct version.

The Dockerfile was also updated to update the default versions specified in the
PROTOBUF_VERSION and GOGO_VERSION build-args (although not strictly necessary).

Regenerating the files with this version resulted in a minor formatting change.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-01 23:23:53 +02:00
Tonis Tiigi 2bba968fc5 progressui: don't print vertex digest
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-05-20 18:45:34 -07:00
Tõnis Tiigi 75f3315583
Merge pull request #2017 from AkihiroSuda/containerd-15
Dockerfile: update containerd to v1.5.0-rc.2 / v1.4.4
2021-04-26 16:31:08 -07:00
Corey Larson 9b7a5fc618 Remove potentially expired tokens.
Some registries (notably Quay) issue tokens that expire without providing an `expires in` value in the authorization payload. Therefore, if a token produces a 401, we should remove it and re-fetch.

Signed-off-by: Corey Larson <corey@earthly.dev>
2021-04-21 14:13:58 -06:00
Akihiro Suda 19fd8ca54f
go.mod: containerd v1.5.0-rc.2
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-21 03:43:35 +09:00
Tõnis Tiigi 33b56587e9
Merge pull request #2069 from AkihiroSuda/carry-2001
[Carry 2001] Dockerfile: update containerd to 1.4.3  + fix testutil
2021-04-09 10:42:42 -07:00
Akihiro Suda b77f42c611
testutil: fix specifying shim binary
The `plugins.linux.shim` section in the `config.toml` in the previous code
is meaningless for runtime v2.

For runtime v2, we need to just override `$PATH` to ensure the shim
binary path.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-09 15:39:51 +09:00
Alex Couture-Beil ca151bceaf Move git protocol detection into seperate util
- the git protocol detection is required by buildx, and should reside in
a seperate exported gitutil package.

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-03-31 12:42:57 -07:00
Aaron Lehmann d3b96f4e31 Add retry on image push 5xx errors
Some registries can be flaky and return intermittent 5xx errors. This
change allows those errors to be retried, similarly to network-level
errors.

Note that this needs the upstream containerd fix
https://github.com/containerd/containerd/pull/5276 to work reliably.

This was tested with a registry that was modified to return 504 on every
other manifest PUT. Without the change, exports to the registry fail
every other attempt.  With the change and the related containerd change,
exports to the registry always succeed.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-03-26 18:13:45 -07:00
Akihiro Suda 2219e6bf42
Merge pull request #2036 from earthly/vlad/retry
Retry on temporary network failures
2021-03-24 12:52:29 +09:00
Vlad A. Ionescu ab76674b24 Retry on temporary network failures.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-03-23 17:28:04 -07:00
Akihiro Suda 8effd45b99
Merge pull request #2031 from tonistiigi/caps-contains
caps: add contains method
2021-03-22 15:36:34 +09:00
Tonis Tiigi 1d982af3b4 caps: add contains method
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-03-21 22:53:27 -07:00
Akihiro Suda 4eca10a46c
Merge pull request #2020 from tonistiigi/push-tags
push: avoid overwriting tags on push
2021-03-16 10:47:52 +09:00
Sebastiaan van Stijn 1b4affddcd
security/entitlements.WithInsecureSpec() remove redundant loop
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-14 13:09:09 +01:00
Tonis Tiigi 1d7526b1bb push: avoid overwriting tags on push
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-03-12 13:45:01 -08:00
Akihiro Suda 13ea18ad08
vendor containerd (requred for rootless overlayfs on kernel 5.11)
Required for rootless overlayfs on kernel 5.11
https://github.com/containerd/containerd/pull/5076

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-10 13:51:27 +09:00
Tonis Tiigi 49c4ab46ad Revert "resolver: fix tcp connections limit"
This reverts commit 58dc579d57.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-02-20 12:15:25 -08:00
Tonis Tiigi 58dc579d57 resolver: fix tcp connections limit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-02-18 23:04:37 -08:00
zhangwenlong 7cd6a5feaf add support for mips64el and mips64
Signed-off-by: zhangwenlong <zhangwenlong8911@163.com>
2021-02-02 10:54:17 +08:00
Tonis Tiigi 3a2c03052f resolver: avoid error caching on token fetch
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-01-28 00:37:31 -08:00
Tonis Tiigi f3e6120a6b logs: increase default allowed log size
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-01-05 21:31:20 -08:00
Tonis Tiigi 18821ec794 logs: fix clipping configuration
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-01-05 21:30:22 -08:00
Alex Couture-Beil 3a5bdf0710 Move prefix check to isGitTransport
- rename IsSSHTransport to IsImplicitSSHTransport
- add testing for NewGitIdentifier

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-01-04 11:09:56 -08:00
Alex Couture-Beil 0dff0fdab4 Check for explicit ssh git URL
- fix IsSSHTransport to also check for explicitly-defined ssh-based git repos

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-15 13:31:35 -08:00
Tibor Vass 07029de618
Merge pull request #1879 from tonistiigi/foreign-mediatype
handle foreign mediatypes on push
2020-12-11 11:48:55 -08:00
Tonis Tiigi e56e7ba46b flightcontrol: fix possible invalid cancellation
There was a race with context getting cancelled and new request
arriving that could resulted new request to receive cancelled result
as well. This happened because lock was held when getting the Done()
channel but it could have been already released by the time returned
channel was closed.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-12-11 00:57:12 -08:00
Tibor Vass fbf8ed15a8 sshutil: allow uppercase usernames (thinking of you thaJeztah)
Signed-off-by: Tibor Vass <tibor@docker.com>
2020-12-11 05:19:39 +00:00
Alex Couture-Beil 201482bba9 Allow for usersnames with hyphens or underscores
- usernames could have - or _
- expand testing cases

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-10 17:10:38 -08:00
Alex Couture-Beil 3fa063dcf3 move ssh regexp test to common location
- include testing
- improve hostname checking

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-10 17:10:38 -08:00
Tonis Tiigi aabdec1778 handle foreign mediatypes on push
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-12-05 23:16:44 -08:00
Alex Couture-Beil 88580ad989 Fix sshkeyscan to work with ipv6
- make use of standard net.SplitHostPort and net.JoinHostPort functions

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-18 09:19:49 -08:00
Alex Couture-Beil ccac4d664e fix assumption that ssh port must be 2 digits
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-16 17:02:40 -08:00
Alex Couture-Beil 3c73a22430 Add default ssh mount and keyscans when missing
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-16 13:23:37 -08:00
Tonis Tiigi cf8babde54 progress: refactor logger handler to better reuse
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-15 13:33:58 -08:00
Tonis Tiigi aa29e77294 fix import cycle in integration test pulls
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-11 21:21:08 -08:00
Tonis Tiigi ffe71a1ea9 add retry handlers to push/pull
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-11 20:39:01 -08:00
Akihiro Suda 4011b6ef1c
Merge pull request #1754 from tonistiigi/log-clipping
progress: add log limits and clipping
2020-11-06 13:53:38 +09:00
Tonis Tiigi 378fce2290 logs: show log limit in the clipping message
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-05 10:47:25 -08:00
Tõnis Tiigi e48da241dc
Merge pull request #1761 from tonistiigi/session-remote
add session injection to remote ref loading
2020-11-03 08:33:28 -08:00
Tonis Tiigi e3b05289d8 add session injection to remote loading
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-02 22:20:44 -08:00
Tõnis Tiigi 35f41e9db4
Merge pull request #1775 from earthly/vlad/cni-bug
Fix race in CNI namespaces
2020-11-02 17:48:09 -08:00
Vlad A. Ionescu 03987d2a75 Rename nativeID to nsPath. Simplify.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2020-11-02 11:39:17 -08:00
Vlad A. Ionescu 39fd96d2dd Fix race in CNI namespaces.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2020-11-02 11:23:28 -08:00
Sebastiaan van Stijn fbe1346912
replace github.com/docker/docker/pkg/locker with moby/locker v1.0.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-30 09:25:05 +01:00
Tonis Tiigi 6a3d6e983b source: fix puller error caching on cancellation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-27 13:21:49 -07:00
Tonis Tiigi 38ec47c981 progress: add log limits and clipping
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-26 14:51:47 -07:00
Tonis Tiigi ecf070a027 exec: use platform specific default path
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-23 15:30:23 -07:00
Akihiro Suda a340d4171d
Merge pull request #1730 from tonistiigi/gcr-400
exporter: avoid descriptor annotations on docker manifests
2020-10-20 13:49:19 +09:00
Tonis Tiigi c7f5979dd4 exporter: avoid descriptor annotations on docker manifests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-19 12:54:47 -07:00
Tonis Tiigi ca46949277 stack: remove helper functions from error stack traces
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-18 23:36:38 -07:00
Kees Cook fd11490560 Update binfmt_misc tests to have non-executable stack
Fix: #1737

On Linux v5.6+ docker start-up would trigger the exec-stack warning:

process 'docker/tmp/qemu-check490284163/check' started with executable stack

Mark all the binfmt_mist tests as having a non-executable stack, and
regenerate the *_binary.go files.

Additionally fix trailing whitespace and add missing end-of-file newlines.

Signed-off-by: Kees Cook <keescook@chromium.org>
2020-10-17 22:53:27 -07:00
Tõnis Tiigi be424a99ea
Merge pull request #1728 from earthly/vlad/authorizer-errors
Prevent context canceled errors from being permanent in authorizer
2020-10-15 17:46:14 -07:00
Vlad A. Ionescu d127edf990 Prevent context canceled errors from being permanent in authorizer
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>

Check if context is canceled before returning cached token or err.

Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>

Fix possible race conditions

Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>

Fix block

Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2020-10-15 15:11:59 -07:00
Tõnis Tiigi 4177e7ca28
Merge pull request #1660 from tonistiigi/token-fetch
auth: fetch tokens from client side
2020-10-12 16:13:19 -07:00
Tonis Tiigi b4fad847ac frontend: support for subrequests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-07 13:36:51 -07:00
Tonis Tiigi 44f27708b3 frontend: make sure inputs support for frontends is detectable from client
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-04 10:44:16 -07:00
Akihiro Suda 6361c6bad2
Merge pull request #1666 from ktock/sgz-oci
Enable to use stargz snapshotter without spawning plugin process
2020-09-17 16:00:19 +09:00
Tonis Tiigi 1f94445456 auth: fetch tokens from client side
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-09-15 13:40:30 -07:00
Ilya Dmitrichenko 6e8fde8431
vendor: update containerd to d4e7820
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2020-09-07 10:40:09 +01:00
ktock cf3d695cc2 Enable to run integration tests with stargz snapshotter
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-09-03 16:52:21 +09:00
Erik Sipsma a57f8a2dcc
Merge pull request #1402 from ktock/remote-snapshotter
Support stargz snapshotter for dev stages
2020-08-31 10:41:11 -07:00
Tonis Tiigi d33756e17b vendor: update containerd to efa0e809
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-30 23:04:25 -07:00
ktock 76189201a8 Add integration test for containerd and stargz snapshotter
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2020-08-27 15:50:11 +09:00
Miguel Ángel Jimeno 6e1d460d4c
cni: remove duplicate error check
Signed-off-by: Miguel Ángel Jimeno <miguelangel4b@gmail.com>
2020-08-23 21:51:01 +02:00
Jon Zeolla 4f966cc3da Fix platform typo
Signed-off-by: Jon Zeolla <zeolla@gmail.com>
2020-08-17 19:31:02 -04:00
Tonis Tiigi e6500927d2 resolver: handle nil group properly
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:25 -07:00
Tonis Tiigi e322304c07 resolver: avoid retrying fatal error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:25 -07:00
Tonis Tiigi 8f8dccf837 resolver: add docs to new functions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:25 -07:00
Tonis Tiigi 5f69909037 resolver: switch post/get order on requesting token
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:25 -07:00
Tonis Tiigi b474dbf55f resolver: clean up unused resolver pool
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:18 -07:00
Tonis Tiigi 21c4ab8621 resolver: fix token expiring issues
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:18 -07:00
Tonis Tiigi f1cd79bf65 resolver: add better pooling and custom authenticator
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:11 -07:00
Tõnis Tiigi 545532ab0e
Merge pull request #1475 from sipsma/lazy-ref
Add support for lazily-pulled blobs in cache manager.
2020-08-06 12:54:45 -07:00
Tonis Tiigi 862387445e grpcerrors: use full typeurl registration
Also switches current types to json.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-06 12:28:48 -07:00
Erik Sipsma 926ca1804c pull: de-pointer non-optional platform field
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-08-05 17:18:43 -07:00
Erik Sipsma cdcf49fd18 Fix progress in schema1 pull.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-08-05 17:18:43 -07:00
Erik Sipsma 55cbd19dec Add support for lazily-pulled blobs in cache manager.
This allows the layers of images to only be pulled if/once they are actually
required.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-08-05 17:18:43 -07:00
Tonis Tiigi 22061b1ec9 resolver: reenable keep-alive
Was disabled with http2 but shouldn’t have been.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-02 09:32:46 -07:00
Tonis Tiigi 5e08a24e88 resolver: make sure authorizer is not regenerated
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-02 09:32:40 -07:00
Tonis Tiigi 3278f8d6d7 pull: fix counter for ensuremanifestloaded check
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-01 22:08:22 -07:00
Tonis Tiigi cdf424f677 resolver: enable tracing on default transport
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-29 23:19:52 -07:00
Akihiro Suda 594ebbfac0
Merge pull request #1601 from tonistiigi/insecure-fix
push: reenable setting insecure exporter opt
2020-07-29 13:55:36 +09:00
Tonis Tiigi 942c39adfd add testing for containerd 1.4-beta2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-28 18:13:15 -07:00
Paul "TBBle" Hampson e48eaf9619 Log HostComputeNamespace name instead of the whole object
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-28 18:07:20 +10:00
Paul "TBBle" Hampson 0c9d862645 Fix undefined variable in Windows-specific test
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-28 18:07:20 +10:00
Paul "TBBle" Hampson b5e6d54910 Add errors-on-non-Linux ToRootless implementation
`go test` complains about this tree because the package ends up with no
symbols on non-Linux platforms, e.g., Windows, even though this API is
never be called on non-Linux platforms, according to the compiler.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-28 18:07:20 +10:00
Paul "TBBle" Hampson f617b0828a Fix testutil/integration build on Windows
Although we don't run any integration tests on Windows at this time,
this does mean that the SKIP_INTEGRATION_TESTS env-var works, so we can
run a wider range of non-integration tests without spurious failures.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-28 13:50:48 +10:00
Tonis Tiigi 846142df61 push: reenable setting insecure exporter opt
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-26 23:27:19 -07:00
Tonis Tiigi 67044875c4 resolver: allow setting both insecure tls and http
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-26 18:29:45 -07:00
Tonis Tiigi 9cb0654ce4 integration: lock buffer for concurrent writes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-23 12:04:14 -07:00
Paul "TBBle" Hampson 50c5d4ce51 Don't add loopback CNI configuration on Windows
There's no Loopback CNI plugin for Windows as far as I can see, so I'm
assuming it's not needed.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-21 16:31:32 +10:00
Paul "TBBle" Hampson 1fedff0e4b Reorder CNI config to set options before consumers
The `WithLoNetwork` and `WithConfFile` options consume the
`WithPluginDir` and `WithInterfacePrefix` settings, so they must come
first.

This fixes the issue that the provided plugin directory was not used for
the provided configuration file. This would have been more visible, but
the default `InterfacePrefix` is already "eth".

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-21 16:31:31 +10:00
Paul "TBBle" Hampson dc2574ceae Implement separate handling for Windows Network namespaces
The Windows API is completely different, so the common code cannot
create the unique identifier, but must accept what the OS-specific code
does.

For Linux, it's a pathname. In Windows, it's a GUID string.

This pulls in direct usage of Microsoft/hcsshim, which previously was
only an indirect usage via containerd calls from, e.g., localMounter on
Windows.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-21 16:31:31 +10:00
Paul "TBBle" Hampson 1645a1e2ca Provide separate NetProviders map for Windows
This enforces the lack of host networking support on Windows.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-21 16:31:31 +10:00
Tonis Tiigi 94c202bfb9 handle error returns more properly
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07:00
Tonis Tiigi 5da4a40ae8 lint: enable more linters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07: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 c8190b1518 lint: enable golint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:24 -07:00
Tonis Tiigi 57a88b0afb lint: add misspell and unused
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-18 08:13:57 -07:00
Tonis Tiigi 04233f90b3 replace gometalinter with golangci linter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-18 08:13:48 -07:00
Tonis Tiigi 55e29c1abe integration: fix rootless worker binaries closing after tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-17 19:30:40 -07:00