Code Monkey home page Code Monkey logo

Comments (7)

jmillikin-stripe avatar jmillikin-stripe commented on May 11, 2024

PR: #20

from gvisor-containerd-shim.

Random-Liu avatar Random-Liu commented on May 11, 2024

@jmillikin-stripe Are you using gvisor-containerd-shim with Kubernetes + containerd? Or just containerd?

With "Kubernetes + containerd", CreateOptions should never be used.
With just containerd, I don't think containerd client options are designed for non-runc runtimes right now, e.g. https://github.com/containerd/containerd/blob/master/task_opts_unix.go#L31

from gvisor-containerd-shim.

jmillikin-stripe avatar jmillikin-stripe commented on May 11, 2024

I'm using it with containerd directly, not via Kubernetes or CRI.

It works fine except for this one particular missing type assertion, and the referenced PR does work for the subset of CreateOptions that gVisor supports.

from gvisor-containerd-shim.

ianlewis avatar ianlewis commented on May 11, 2024

@jmillikin-stripe can you share your config.toml? Also, what exactly are you doing to get this error? I suppose you are creating a container via the containerd API rather than CRI?

from gvisor-containerd-shim.

ianlewis avatar ianlewis commented on May 11, 2024

@Random-Liu I think the relevant code is here since it's 1.2.x. In this case there aren't any runtime checks since it wasn't implemented yet. I feel like we should probably handle this case.
https://github.com/containerd/containerd/blob/release/1.2/task_opts_unix.go

from gvisor-containerd-shim.

jmillikin-stripe avatar jmillikin-stripe commented on May 11, 2024

I'm using the containerd API directly. The config.toml file has no effect on this behavior; the reproduction is in the following client code:

	var stdout, stderr bytes.Buffer
	task, err := container.NewTask(
		containerCtx,
		cio.NewCreator(
			cio.WithFIFODir(fifoDir),
			cio.WithStreams(
				nil, // stdin
				&stdout,
				&stderr,
			),
		),
		containerd.WithNoNewKeyring,
	)

The containerd.WithNoNewKeyring option is an optimization for runc containers. If set, the shim's creation request options will be set to a *runctypes.CreateOptions. I would like it if I could set that option unconditionally and let the shim ignore unknown options, but the failing type check here prevents that.

from gvisor-containerd-shim.

Random-Liu avatar Random-Liu commented on May 11, 2024

I'm using it with containerd directly, not via Kubernetes or CRI.

No wonder. That's what I guessed. :)

I think the relevant code is here since it's 1.2.x. In this case there aren't any runtime checks since it wasn't implemented yet. I feel like we should probably handle this case.

I'm fine with handling that :)
Just want to confirm this is caused by a directly use with containerd, not a bug in Kubernetes integration.

from gvisor-containerd-shim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.