Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@littlejawa
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

In order to support the peer-pods use case, cri-o needs to be able to relay PullImage requests (at least), and probably other Image-related requests, to the remove VM used for running the container.

In the current implementation using kata containers, the way to do so is to call a new GRPC entry in the kata shim.
From cri-o's standpoint, that involves calling the runtimeVM instance for the container, when processing PullImage.

This PR provides a way to do that: it introduces a list of ImageServer instances, and provides a way to register a new ImageServer, associated to a containerID.
The current implementation of ImageServer is kept separately, as the "default ImageServer". It will be used for most of the workflow, to limit the overhead outside of peer-pods.

The registration of new ImageServer is done in the call to newRuntimeImpl(), where the runtime implementation is created, and where we can decide (depending on the type of runtime) whether or not a different ImageServer should be used, and link this ImageServer to the runtime.

I also included a very basic implementation of the ImageServer interface as part of the runtimeVM definition. This allows to use the runtimeVM object itself as ImageServer, and will simplify calling the kata shim process when performing image-related operations.
It is currently just a wrapper over the default ImageServer, and is used for testing only.
The registration in newRuntimeImpl() is commented out on purpose, and will be uncommented in a later PR, when the actual implementation of the PullImage forward will be done.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

NOTE: I have looked at #5624 which does something similar, but the association of ImageServer to runtimeVM is a requirement that it didn't have, and causes additional complexity. Discussing it with @alicefr, we agreed that I should try my own design.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 10, 2023
@openshift-ci openshift-ci bot requested review from QiWang19 and wgahnagl March 10, 2023 17:12
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 10, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: littlejawa
Once this PR has been reviewed and has the lgtm label, please assign mrunalp for approval. For more information see the Kubernetes Code Review Process.

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

Details 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

@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Merging #6724 (eb37620) into main (4260b21) will increase coverage by 0.04%.
The diff coverage is 57.81%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6724      +/-   ##
==========================================
+ Coverage   44.58%   44.62%   +0.04%     
==========================================
  Files         127      127              
  Lines       14921    15051     +130     
==========================================
+ Hits         6652     6716      +64     
- Misses       7473     7538      +65     
- Partials      796      797       +1     

@TomSweeneyRedHat
Copy link
Contributor

Any adjustments to man pages needed?

@littlejawa littlejawa force-pushed the runtimevm_imageserver branch from 24df7df to 859f860 Compare March 13, 2023 09:12
@littlejawa
Copy link
Contributor Author

force-push: fixing lint and vendor issues

@littlejawa
Copy link
Contributor Author

Any adjustments to man pages needed?

No, I don't think so.
The changes are internal to cri-o. There is no configuration required, nor change in behavior.
This is all preparatory work to be able to plug a different ImageServer in a future PR, but for the moment, I don't think there is anything to document.

A new ImageServerList type is created, which is a map of ImageServers to containerIDs.
Now rather than one single instance of ImageServer, we have possibly one per container.

ImageServer can be registered along with their runtime implementation.
The goal is to provide a way for some runtimes (e.g: peer-pods use case) to process
the Image requests by relaying them to a remote VM, rather than having them
executed on the local host.

Signed-off-by: Julien Ropé <[email protected]>
- Fix tests according to previous changes
- Adding unit tests for ImageServerList

Signed-off-by: Julien Ropé <[email protected]>
as an ImageServer for kata containers.

In Peer-pods use case, this ImageServer will be able to relay the relevant
requests (PullImage typically) to the remote VM's agent, through the
shim GRPC API. This specific implementation is yet to come.

Signed-off-by: Julien Ropé <[email protected]>
@littlejawa littlejawa force-pushed the runtimevm_imageserver branch from 859f860 to eb37620 Compare March 13, 2023 13:35
@littlejawa littlejawa changed the title Setting up a per-container imageserver mapping [WIP] Setting up a per-container imageserver mapping Apr 3, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 3, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 28, 2023
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link

@littlejawa: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/kata-jenkins eb37620 link true /test kata-containers
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@littlejawa
Copy link
Contributor Author

There is a discussion going on regarding how cri-o support for confidential container can happen.
See confidential-containers/confidential-containers#87

Keeping this on hold as we're exploring other leads.

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 25, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 27, 2023

@littlejawa: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn eb37620 link true /test e2e-aws-ovn
ci/prow/images eb37620 link true /test images
ci/prow/periodics-images eb37620 link true /test periodics-images
ci/prow/ci-images eb37620 link true /test ci-images
ci/prow/ci-e2e-conmonrs eb37620 link true /test ci-e2e-conmonrs
ci/prow/ci-fedora-integration eb37620 link true /test ci-fedora-integration
ci/prow/ci-cgroupv2-integration eb37620 link true /test ci-cgroupv2-integration
ci/prow/ci-cgroupv2-e2e-features eb37620 link true /test ci-cgroupv2-e2e-features
ci/prow/ci-cgroupv2-e2e eb37620 link true /test ci-cgroupv2-e2e
ci/prow/ci-e2e eb37620 link true /test ci-e2e
ci/prow/ci-cgroupv2-e2e-crun eb37620 link true /test ci-cgroupv2-e2e-crun
ci/prow/ci-crun-e2e eb37620 link true /test ci-crun-e2e
ci/prow/ci-rhel-critest eb37620 link true /test ci-rhel-critest
ci/prow/ci-rhel-e2e eb37620 link true /test ci-rhel-e2e
ci/prow/ci-fedora-critest eb37620 link true /test ci-fedora-critest
ci/prow/e2e-gcp-ovn eb37620 link true /test e2e-gcp-ovn
ci/kata-jenkins eb37620 link true /test kata-containers
ci/prow/ci-e2e-evented-pleg eb37620 link true /test ci-e2e-evented-pleg
ci/prow/ci-fedora-kata eb37620 link true /test ci-fedora-kata

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@github-actions
Copy link

Closing this PR since it had no activity in the past 90 days.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Sep 26, 2023
@github-actions github-actions bot closed this Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants