Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce protocol between RuntimeManager and RuntimeHookServer #76

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

honpey
Copy link
Contributor

@honpey honpey commented Apr 15, 2022

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

apis/runtime/v1alpha1/api.proto Outdated Show resolved Hide resolved
apis/runtime/v1alpha1/api.proto Outdated Show resolved Hide resolved
scripts/generate_runtime.sh Show resolved Hide resolved
// Pod namespace of the sandbox. Same as the pod namespace in the Pod ObjectMeta.
string namespace = 3;
// Attempt number of creating the sandbox. Default: 0.
uint32 attempt = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this filed

Copy link
Contributor Author

@honpey honpey Apr 18, 2022

Choose a reason for hiding this comment

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

remove this filed

reverve for subsequence features, such as ingoring core adjustment when attempt > 1

*/

// To regenerate api.pb.go run scripts/generate_runtime.sh
syntax = "proto3";
Copy link
Contributor

Choose a reason for hiding this comment

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

for the docker proxy, we need to transfer the http request to grpc request? I think it's a little complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the request body has no difference between grpc and http when talking to RuntimeHookServer, so it should NOT be more complicated under docker scenario?

the request body has no difference between grpc and http when talking to RuntimeHookServer, so it should NOT be more complicated under docker scenario?

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

map<string, string> annotations = 2;
// RuntimeHookSever may modify cgroup_parent to construct customized cgroup topology.
string cgroup_parent = 3;
// RuntimeHookServer may modify the linux resource config.
Copy link
Member

@hormes hormes Apr 18, 2022

Choose a reason for hiding this comment

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

overhead&resources wont be modified, so remove those fields from response ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

overhead&resources wont be modified, so remove those fields from response ?

resources info would be assigned to pod-level cgroup.
so it makes sense to allow HookServert to change pod-level cgroup config here.

overhead can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

when do you need to change this resource, to make response.resources different than request.resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when do you need to change this resource, to make response.resources different than request.resources?

for batch pod, lower cpu preemption priority by setting pod's pod-level cgroup cpu.shares to 2

// Metadata of the sandbox. This information will uniquely identify the sandbox.
PodSandboxMetadata pod_meta = 1;
// Named runtime to use for podSandbox.
string runtime_handler = 2;
Copy link
Member

Choose a reason for hiding this comment

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

What scenarios need to reveal the internal runtime type? If this is the case, maybe we should leave an extension field, such as a map, to avoid frequent modification of the protocol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What scenarios need to reveal the internal runtime type? If this is the case, maybe we should leave an extension field, such as a map, to avoid frequent modification of the protocol

for container info sampling example, under which kata-containers cgroups are inside guest kernel while runc-containers cgroups exist on host.
runtime type exists in PodSandboxHookRequest only and is readonly, so it seems nowhere comes frequent modification?

Copy link
Member

Choose a reason for hiding this comment

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

is this a conventional concept in container community, as it is called runtimeclass in kubernetes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kubernetes

yup. the 'runtime_handler' comes from CRI,
See https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1/api.proto#L413

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@09acf38). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #76   +/-   ##
=======================================
  Coverage        ?   40.66%           
=======================================
  Files           ?       66           
  Lines           ?     5144           
  Branches        ?        0           
=======================================
  Hits            ?     2092           
  Misses          ?     2804           
  Partials        ?      248           
Flag Coverage Δ
unittests 40.66% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09acf38...27f8933. Read the comment docs.

Signed-off-by: pengyang.hpy <honpey@gmail.com>
@ZYecho
Copy link
Contributor

ZYecho commented Apr 18, 2022

LGTM

@hormes
Copy link
Member

hormes commented Apr 19, 2022

/lgtm
/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hormes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit ccd8ff7 into koordinator-sh:main Apr 19, 2022
Copy link
Member

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

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

/lgtm

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

Successfully merging this pull request may close these issues.

[feature request] protocol design between runtime-manager and hook server
6 participants