Skip to content

Conversation

@mxpv
Copy link
Member

@mxpv mxpv commented Feb 5, 2023

  • Adds a unified (TTRPC + GRPC) clients for TaskService and SandboxService.
  • Shim client support
  • Introduce shim bootstrap params (a JSON payload returned in stdout from Shim.Start to specify protocol, shim caps, etc).

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@mxpv mxpv force-pushed the grpc_shim branch 2 times, most recently from b4810da to 197aa93 Compare February 6, 2023 02:43
@mxpv mxpv marked this pull request as ready for review February 6, 2023 14:52
@mxpv
Copy link
Member Author

mxpv commented Feb 6, 2023

/test pull-containerd-sandboxed-node-e2e

@mxpv mxpv changed the title GRPC shims support Initial GRPC shims support Feb 6, 2023
@mxpv mxpv force-pushed the grpc_shim branch 2 times, most recently from c779519 to 1863842 Compare February 6, 2023 20:12
Copy link
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

Approach makes sense, LGTM

Comment on lines +59 to +62
resp, err := g.client.State(ctx, &v3.StateRequest{
ID: request.GetID(),
ExecID: request.GetExecID(),
})
Copy link
Member

@dcantah dcantah Feb 7, 2023

Choose a reason for hiding this comment

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

Minor nit after looking again, but for all of these that don't return an emptypb we should probably just return nil for the actual responses if we got an error from the original call (g.client.State in this example) to be idiomatic

Copy link
Member Author

@mxpv mxpv Feb 11, 2023

Choose a reason for hiding this comment

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

Once we release 1.7 and switch to v3, we can clean this code (as there will be no need to convert between v2 and v3 contracts), so it'll be a lot slimmer (like sandbox/bridge.go)

Copy link
Member

Choose a reason for hiding this comment

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

Fine with me then

@dcantah
Copy link
Member

dcantah commented Feb 7, 2023

There any plans to make registering the event service as GRPC a reality? Poorly worded, but for the go library I mean (instead of the manager registering as ttrpc always and writing the address to an env var)

ttrpcAddress := os.Getenv(ttrpcAddressEnv)
publisher, err := NewPublisher(ttrpcAddress)
if err != nil {
return err
}
defer publisher.Close()
I suppose it might not even matter as this work is mainly for non-go/non-rust runtimes

@dcantah
Copy link
Member

dcantah commented Feb 10, 2023

Just trialed this, we'll need at least grpc.WithTransportCredentials(insecure.NewCredentials()) on the dialopts for the connection otherwise you get the famed: grpc: no transport security set (use grpc.WithTransportCredentials(insecure.NewCredentials()) explicitly or set credentials)

mxpv added 7 commits February 10, 2023 21:53
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
@mxpv
Copy link
Member Author

mxpv commented Feb 11, 2023

Rebased against main and fixed merge conflicts.

Copy link
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

LGTM again, dummy shim I have makes it to TaskShutdownRequest just fine if that's anything to go by 🤷

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants