Skip to content

Enable to use stargz snapshotter without spawning plugin process#1666

Merged
AkihiroSuda merged 2 commits into
moby:masterfrom
ktock:sgz-oci
Sep 17, 2020
Merged

Enable to use stargz snapshotter without spawning plugin process#1666
AkihiroSuda merged 2 commits into
moby:masterfrom
ktock:sgz-oci

Conversation

@ktock
Copy link
Copy Markdown
Collaborator

@ktock ktock commented Sep 2, 2020

Fixes: #1663

This commit embeds stargz snapshotter Go package to OCI worker.

In go.mod, this commit adds the following changes for making the build succeed:

  • imports stargz snapshotter package
  • adds a new replace() directive for google.golang.org/genproto. This is because go mod tidy tries to update this to the version that is incompatible with github.com/golang/protobuf. github.com/golang/protobuf is already specified in replace() as v1.3.5 corresponding to containerd. This commit fixed this by adding google.golang.org/genproto to replace() as v0.0.0-20200224152610-e50cd9704f63 which also corresponds to containerd(v1.4.1-0.20200827124858-efa0e809135e).
  • udpates github.com/uber/jaeger-client-go to the latest (full diff: jaegertracing/jaeger-client-go@v2.11.2...v2.25.0). This is because go mod tidy updates github.com/apache/thrift to the version that is incompatible with v2.11.2 (older version) of github.com/uber/jaeger-client-go.

cc @AkihiroSuda @tonistiigi

Copy link
Copy Markdown
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should run integration tests with this configuration. If it is too much to do it in every PR we can configure it so it at least runs on master build (maybe also if stargz files change or stargz is mentioned in the commit message).

Comment thread vendor/modules.txt Outdated
@@ -422,3 +486,163 @@ gotest.tools/v3/internal/difflib
gotest.tools/v3/internal/format
gotest.tools/v3/internal/source
gotest.tools/v3/poll
# k8s.io/api v0.19.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too much. What needs it and how can we get rid of it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for CRI compatibility (secret-based registry auth: doc). I think we can get rid of this in buildkit. I'll work on this.

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
@ktock ktock force-pushed the sgz-oci branch 2 times, most recently from 1c4dd68 to 90ca005 Compare September 3, 2020 06:52
Comment thread Dockerfile Outdated
# musl is needed to directly use the registry binary that is built on alpine
ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.3=/opt/containerd-alt/bin"
ENV BUILDKIT_INTEGRATION_CONTAINERD_STARGZ=1
ENV BUILDKIT_INTEGRATION_STARGZ_SNAPSHOTTER=1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILDKIT_INTEGRATION_SNAPSHOTTER=stargz ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support multiple snapshotters? (e.g. BUILDKIT_INTEGRATION_SNAPSHOTTER="stargz snapshotter-b snapshotter-c")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially in future

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the test to make the snapshotter configurable through BUILDKIT_INTEGRATION_SNAPSHOTTER. For keeping the scope of this PR narrower, the test currently supports specifying single snapshotter through that envvar. But it shouldn't be difficult to extend this for multiple snapshotters if needed in the future.

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
@ktock
Copy link
Copy Markdown
Collaborator Author

ktock commented Sep 3, 2020

@tonistiigi
Got rid of the k8s.io pkg and enabled "OCI worker + stargz snapshotter" config in the integration test as well. Some lazyref-related tests in client/client_test.go still relies on containerd worker because they need to check the content existence through containerd API. PTAL.

@ktock
Copy link
Copy Markdown
Collaborator Author

ktock commented Sep 16, 2020

@tonistiigi PTAL?

@tonistiigi
Copy link
Copy Markdown
Member

@AkihiroSuda merge if ready

Comment thread vendor/modules.txt
# github.com/google/go-cmp v0.4.0
github.com/google/go-cmp/cmp
github.com/google/go-cmp/cmp/internal/diff
github.com/google/go-cmp/cmp/internal/flags
github.com/google/go-cmp/cmp/internal/function
github.com/google/go-cmp/cmp/internal/value
# github.com/google/go-containerregistry v0.0.0-20200425101607-48f605c3b60a
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume from this dependency that stargz makes its own registry connections (i guess expected) that are not compatible with what buildkit does through containerd libraries and I guess missing all the extra config+token logic? Not ideal

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. Yes, the snapshotter makes its own registry connections and the logic isn't using containerd lib. I agree with that the logic should have compatibility with buildkit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened containerd/stargz-snapshotter#149 as a reminder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add stargz snapshotter to moby/buildkit image

3 participants