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

Run tests used in various high-level container runtimes #331

Closed
utam0k opened this issue Sep 25, 2021 · 11 comments
Closed

Run tests used in various high-level container runtimes #331

utam0k opened this issue Sep 25, 2021 · 11 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@utam0k
Copy link
Member

utam0k commented Sep 25, 2021

Overview

The actual use of youki is high-level container runtime. So the ci should be included to make sure that it can be used with some of the major high-level container runtimes.

Target

  • Docker
  • Podman
  • containerd
  • cri-o
@utam0k utam0k added the help wanted Extra attention is needed label Sep 25, 2021
@nasirhm
Copy link

nasirhm commented Sep 27, 2021

Sure, I would like to work on it.

@utam0k
Copy link
Member Author

utam0k commented Sep 28, 2021

@nasirhm Sure! I assigned you. This issue is very abstract. If you have any questions, please let me.

@nasirhm
Copy link

nasirhm commented Sep 28, 2021

Thank You @utam0k , Are we planning to set up CI Pipelines to test Youki with Docker, Podman, Containerd and CRI-O ?

@utam0k
Copy link
Member Author

utam0k commented Sep 29, 2021

Are we planning to set up CI Pipelines to test Youki with Docker, Podman, Containerd and CRI-O ?

Yes, however, if you have a better way, that is fine.

@utam0k
Copy link
Member Author

utam0k commented Oct 18, 2021

@nasirhm Hello. Do you have any problems? I can help you ;)

@Yuan-Zhuo
Copy link

Sorry for replying in this instead of opening a new one.(I think my question is very similar to this one. )

I am trying to find a way to tell containerd to use the youki instead of runc. But I don’t know how to do. Is there some relevant documents?

@utam0k
Copy link
Member Author

utam0k commented Oct 26, 2021

@Yuan-Zhuo
I'm not familiar with containerd, however, this document may help you. You may be able to use it by changing runtime to the path of the youki binary.
If you succeed in getting it to work, I'd like to add documentation on how to do it.

I am trying to find a way to tell containerd to use the youki instead of runc. But I don’t know how to do. Is there some relevant documents?

@Yuan-Zhuo
Copy link

Thanks for your reply! I also tried to modify the runtime in /etc/containerd/config.toml before, but it didn't work.
I just asked for help discussions-6162 in the containerd community and got a reply. Their approach is to simply replace runc with another runtime. I tested Youki and crun and it works.

> sudo cp ./youki /usr/sbin/runc
> sudo ctr run --rm --memory-limit 1 docker.io/library/fedora:latest test
ctr: failed to create shim: OCI runtime create failed: unable to retrieve OCI runtime error (invalid character 'D' looking for beginning of value): runc did not terminate successfully: exit status 1: unknown

It can be seen from the error message that the replacement is successful, because the error report of runc will be

> sudo ctr run --rm --memory-limit 1 docker.io/library/fedora:latest test      
ctr: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: unable to set memory limit to 1 (current usage: 1122304, peak usage: 3268608): unknown

But it seems that we cannot get the real runtime from the go program( I am not sure about the mechanism of this package)

package main

import (
	"fmt"
	"log"

	"github.com/containerd/containerd"
)

func main() {
	if err := testCrun(); err != nil {
		log.Fatal(err)
	}
}

func testCrun() error {
	client, err := containerd.New("/run/containerd/containerd.sock")
	if err != nil {
		return err
	}
	defer client.Close()
        
        # get runtime
	fmt.Println(client.Runtime())
	return nil
}

No matter it is runc, crun or youki, the output is always like this

io.containerd.runc.v2

@utam0k
Copy link
Member Author

utam0k commented Jan 1, 2022

Duplicate #584 #585

@utam0k utam0k closed this as completed Jan 1, 2022
@gattytto
Copy link

gattytto commented Jan 1, 2022

@Yuan-Zhuo I'm not familiar with containerd, however, this document may help you. You may be able to use it by changing runtime to the path of the youki binary. If you succeed in getting it to work, I'd like to add documentation on how to do it.

I am trying to find a way to tell containerd to use the youki instead of runc. But I don’t know how to do. Is there some relevant documents?

for the specifics of testing I think the best fit would be tekton-cd as it supports using the runtimeClassName annotation for cloud-native ci/cd tasks.

example:

apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: pipeline-test-auth
  namespace: default
spec:
  params:
    - name: revision
      value: v1alpha1
  serviceAccountName: build-bot
  podTemplate:
    securityContext:
      runAsNonRoot: true
      runAsUser: 1724
    runtimeClassName: kata

@utam0k
Copy link
Member Author

utam0k commented Jan 8, 2022

Sorry for replying in this instead of opening a new one.(I think my question is very similar to this one. )

I am trying to find a way to tell containerd to use the youki instead of runc. But I don’t know how to do. Is there some relevant documents?

@gattytto
Thanks for your advice. Now, I'm trying this!
#514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants