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: detect runtime automatically #244

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Conversation

zwpaper
Copy link
Member

@zwpaper zwpaper commented Feb 1, 2023

Signed-off-by: WeiZhang kweizh@gmail.com

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #224 (comment)

Special notes for your reviewer:

  1. drop default runtime args value docker
  2. check docker,kind executable, nerdctl minimal version, kind in linux
  3. automatically use runtime by order: docker, nerdctl, binary, kind
  4. nerdctl v1.2.0 support compose start and stop, used as minimal supported

Does this PR introduce a user-facing change?

Automatically detect runtime in order: docker, nerdctl, binary

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 1, 2023
@netlify
Copy link

netlify bot commented Feb 1, 2023

Deploy Preview for k8s-kwok canceled.

Name Link
🔨 Latest commit e769d00
🔍 Latest deploy log https://app.netlify.com/sites/k8s-kwok/deploys/63e52866d4450d00084591fc

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @zwpaper. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 1, 2023
@zwpaper
Copy link
Member Author

zwpaper commented Feb 1, 2023

cc @wzshiming

@wzshiming
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 1, 2023
@zwpaper zwpaper force-pushed the main branch 2 times, most recently from 1d70e52 to 79a6426 Compare February 2, 2023 16:50
@zwpaper zwpaper requested review from wzshiming and removed request for Huang-Wei and yibozhuang February 2, 2023 17:20
@zwpaper
Copy link
Member Author

zwpaper commented Feb 2, 2023

@wzshiming added an Available function to detect whether a runtime is available, now this PR should resolve all the comments you mentioned

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 4, 2023
@zwpaper zwpaper requested a review from wzshiming February 4, 2023 16:34
@zwpaper zwpaper force-pushed the main branch 5 times, most recently from 72d4eb4 to bb1c269 Compare February 9, 2023 05:40
if len(conf.Runtimes) == 0 {
conf.Runtimes = []string{
consts.RuntimeTypeDocker,
consts.RuntimeTypeNerdctl,
Copy link
Member

Choose a reason for hiding this comment

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

#255 tried to add e2e for nerdctl under darwin, but it doesn't seem to work, so better to just add it for Linux?

Copy link
Member Author

Choose a reason for hiding this comment

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

previously I was trying to add nerdctl for mac, because I thought it would be suitable for the runtime detection, but your idea using configure file seems easier, would use this way for runtime detection

Will raise another PR for mac nerdctl, I am a mac nerdctl user, it should be easy to add it

Copy link
Member

@wzshiming wzshiming Feb 9, 2023

Choose a reason for hiding this comment

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

note: Nerdctl as a secondary option, if e2e is not enabled under darwin before the next release, I plan to change it to be used only under Linux, just like the binary.

#246

1. drop default runtime args value `docker`
2. check docker,nerdctl version, kind in linux by default
3. use config to specify runtimes order

Signed-off-by: Wei Zhang <kweizh@gmail.com>
Signed-off-by: WeiZhang <kweizh@gmail.com>
@zwpaper zwpaper force-pushed the main branch 3 times, most recently from 188d91f to 3e7af6c Compare February 9, 2023 16:28
@zwpaper
Copy link
Member Author

zwpaper commented Feb 9, 2023

@wzshiming this should be finally good to go, please help to restart the 2 failed test and check whether we are good to go

Copy link
Member

@wzshiming wzshiming left a comment

Choose a reason for hiding this comment

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

Looks like it's almost ready!

Signed-off-by: Wei Zhang <kweizh@gmail.com>
Copy link
Member

@wzshiming wzshiming left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution!

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 9, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wzshiming, zwpaper

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 9, 2023
@k8s-ci-robot k8s-ci-robot merged commit b34a051 into kubernetes-sigs:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proposal: auto detect docker or nerdctl runtime when not specified a runtime flag
3 participants