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

Feat/support containerd #1975

Merged
merged 6 commits into from
Feb 6, 2023
Merged

Conversation

VinceCui
Copy link
Collaborator

Describe what this PR does / why we need it

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>
Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2023

Codecov Report

Base: 17.71% // Head: 17.82% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (60a5eb4) compared to base (32c71ec).
Patch coverage: 51.21% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1975      +/-   ##
==========================================
+ Coverage   17.71%   17.82%   +0.11%     
==========================================
  Files         105      105              
  Lines        9468     9497      +29     
==========================================
+ Hits         1677     1693      +16     
- Misses       7563     7573      +10     
- Partials      228      231       +3     
Impacted Files Coverage Δ
pkg/cluster-runtime/installer.go 0.00% <0.00%> (ø)
pkg/clusterfile/decoder.go 54.03% <52.50%> (-1.35%) ⬇️
build/kubefile/parser/line_parsers.go 18.81% <0.00%> (+0.40%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Distributor: distributor,
ImageEngine: imageEngine,
Plugins: plugins,
ContainerRuntimeConfig: cluster.Spec.ContainerRuntime,
Copy link
Member

Choose a reason for hiding this comment

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

could we get ContainerRuntime from image spec(image extension) as default value, using cluster.Spec.ContainerRuntime to ovewrite it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think after we add ContainerRuntime info in image spec, then modify here.

pkg/runtime/kubernetes/join_masters.go Show resolved Hide resolved
pkg/container-runtime/installer.go Outdated Show resolved Hide resolved
Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>
…nerd

Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>

# Conflicts:
#	common/common.go
#	pkg/runtime/kubernetes/join_masters.go
@VinceCui VinceCui force-pushed the feat/support-containerd branch 3 times, most recently from 2e58535 to f007706 Compare February 2, 2023 07:13
@github-actions github-actions bot added the test label Feb 2, 2023
@VinceCui VinceCui force-pushed the feat/support-containerd branch 2 times, most recently from e2ddd5f to 780bdbe Compare February 2, 2023 08:17
return d.Info, nil
}

func (d *DefaultInstaller) getInstallScriptName() string {
return fmt.Sprintf("%s.sh", d.Type)
Copy link
Member

Choose a reason for hiding this comment

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

if container runtime shell file renamed ,is the corresponding rootfs files also need to renamed ?, how to ensure compatibility for the old sealer image.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's make a statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the cluster image provider should make sure the script for installing container runtime use the same name with container runtime type.

Signed-off-by: huaiyou <huaiyou.cyz@alibaba-inc.com>
registryURL := net.JoinHostPort(regConfig.Domain, strconv.Itoa(regConfig.Port))
if regConfig.Port == 0 {
registryURL = regConfig.Domain
}
cluster.Spec.Env = append(cluster.Spec.Env, fmt.Sprintf("%s=%s", common.EnvRegistryURL, registryURL))

if cluster.Spec.ContainerRuntime.Type != "" {
cluster.Spec.Env = append(cluster.Spec.Env, fmt.Sprintf("%s=%s", common.EnvContainerRuntime, cluster.Spec.ContainerRuntime.Type))
Copy link
Member

Choose a reason for hiding this comment

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

@VinceCui I think read container runtime type by clusterfile is a little complex. if user didn't specify CRI in clusterfile, What will happended? Then if user specify a wrong CRI type in clusterfile which different from clusterimage had, what will happeded?
Here is my suggestion:
now we have LABEL in Kubefile, so we can get CRI info from it. When user use offical image, the CRI info will natural included. If CRI info is not specified in Kubefile, we use docker as a default CRI and give user a hint, if CRI info is wrong, we hint the default CRI info and return error for user.
RFC @starnop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the review.

The first question, if user didn't specify CRI, the default value now is docker, but it may be changed to containerd in future.

The second question, it is no problem to specify the default container runtime by LABEL in the build phase. This does not conflict with the ability to specify the container runtime at runtime. But consider a scenario, what if the image supports multiple container runtimes? ? At this time, it is necessary to allow users to specify at runtime.

感谢review。
第一个问题,如果置为空,默认为docker,但后面可能会改成默认containerd。
第二个问题,在build阶段里LABEL指定默认的容器运行时是没有问题的,这和运行时可以指定容器运行时也是不冲突的,但是考虑一个场景,如果该镜像支持多个容器运行时呢?此时允许使用者在运行时可以指定就是必要的了。

Copy link
Member

@kakaZhou719 kakaZhou719 left a comment

Choose a reason for hiding this comment

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

LGTM

@kakaZhou719 kakaZhou719 merged commit 897e33e into sealerio:main Feb 6, 2023
@VinceCui VinceCui deleted the feat/support-containerd branch February 27, 2023 07:39
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.

None yet

4 participants