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

[WIP] Implement additional OCI Runtime functionality for Conmon-rs #14930

Closed

Conversation

jakecorrenti
Copy link
Member

So far I have implemented start, stop, and kill. There is an issue where
when you run and start a container, do podman inspect <ctr>, it throws
the error Error: could not find any cgroup in "/proc/$PID/cgroup" even
though /proc/$PID/cgroup contains a path.

Additionally, when stopping a container, it times-out every time:

WARN[0010] StopSignal SIGTERM failed to stop container gallant_mahavira in 10 seconds, resorting to SIGKILL

Does this PR introduce a user-facing change?

None

Currently the create functionality of the OCI Runtime Interface is
working at the bare minimum. It only works for rootful execution.

However, the currently lines that integrate Podman with Conmon-rs have
been commented out to prevent breaking main. Additionally, there is a
significant issue with CPU utilization that I need to figure out.

I also moved shared code between `libpod/oci_conmon_linux.go` and
`libpod/oci_conmon_rs_linux.go` into `libpod/conmon_utils.go`.

Additional Notes:
- Arguments need to get passed to either ConmonServerConfig or
  CreateContainerConfig. If an argument does nothing, it is indicative
  of functionality required on the conmon-rs side.
- There is currently no way to configure the environment of the
  conmon-rs process. This will need to be added on the conmon-rs side.
  Similar situation exists with storing extra files dealt with by the
  conmon-rs process.
- [This](https://github.com/containers/podman/blob/b00e65aa9c071428579a55f91a92f3702765ed85/libpod/oci_conmon_linux.go#L1199-L1228) code is going to need some pretty significant adapting
- Need to wire
  [startCommand](https://github.com/containers/podman/blob/b00e65aa9c071428579a55f91a92f3702765ed85/libpod/oci_conmon_linux.go#L1233)
  into conmon-rs as well.
- [readConmonPipeData](https://github.com/containers/podman/blob/b00e65aa9c071428579a55f91a92f3702765ed85/libpod/oci_conmon_linux.go#L1250)
is going to have to be put in conmon-rs, most likely the
`ConmonServerConfig` struct.
- I speculate the CLI sets the old conmon path by default, and this is
  causing issues with finding the conmon-rs path.
- users will need to install conmon-rs using their `get` script to get
  the binary

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none labels Jul 13, 2022
@jakecorrenti jakecorrenti force-pushed the start-container-conmon-rs branch 6 times, most recently from 948b396 to 4abf10a Compare July 19, 2022 18:10
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2022
@openshift-merge-robot
Copy link
Collaborator

@jakecorrenti: PR needs rebase.

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
Copy link
Contributor

openshift-ci bot commented Jul 20, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jakecorrenti
Once this PR has been reviewed and has the lgtm label, please assign jwhonce for approval by writing /assign @jwhonce in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

}
defer errorhandling.CloseQuiet(parentSyncPipe)

childStartPipe, parentStartPipe, err := newPipe()
Copy link
Member

Choose a reason for hiding this comment

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

I think these are completely unused now. Can probably be removed.

// client.
func (r *ConmonRsOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http.ResponseWriter, streams *HTTPAttachStreams, detachKeys *string, cancel <-chan bool, hijackDone chan<- bool, streamAttach, streamLogs bool) error {
//return httpAttach(ctr, req, w, streams, detachKeys, cancel, hijackDone, streamAttach, streamLogs)
return nil
Copy link
Member

Choose a reason for hiding this comment

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

Can you make all the not-implemented stuff return define.ErrNotImplemented?

@mheon
Copy link
Member

mheon commented Jul 20, 2022

Few comments but on the whole looking good.

Current functionality implemented:
- StartContainer
- StopContainer
- KillContainer
- UpdateContainerStatus
- PauseContainer
- UnpauseContainer
- DeleteContainer
- Attach

There is an issue where when you run and start a container, do `podman inspect <ctr>`,
it throws the error `Error: could not find any cgroup in "/proc/$PID/cgroup"` even
though `/proc/$PID/cgroup` contains a path. However, the above problem
does not occur when you start the container, stop it, and then do
`podman inspect`.

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Aug 22, 2022

@giuseppe Could you take this over?

@github-actions github-actions bot removed the stale-pr label Aug 23, 2022
@cdoern cdoern self-assigned this Sep 20, 2022
cdoern added a commit to cdoern/podman that referenced this pull request Nov 1, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Nov 4, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Nov 4, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Nov 4, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Nov 16, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Nov 16, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
cdoern added a commit to cdoern/podman that referenced this pull request Dec 5, 2022
reworking the original conmon-rs work.

relates to containers#14930

Signed-off-by: Charlie Doern <cdoern@redhat.com>
Signed-off-by: Charlie Doern <cbddoern@gmail.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants