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

Use default {ib-}sriov-cni entrypoint script #581

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

zeeke
Copy link
Member

@zeeke zeeke commented Jan 10, 2024

Avoid overriding entrypoint script for sriov-cni and ib-sriov-cni. It is more robust to rely on the image logic, as the source image can change the path where the binary is stored.

Move the copy logic back to the containers: section, as the image's entrypoint script ends with a "sleep forever" [1].

Mount /etc/os-release file to let the copy logic to make decision on which binary it should copy depending on the operating system.

refs:
[1] https://github.com/k8snetworkplumbingwg/sriov-cni/blob/07ecbf9b6ee867054df47423e51a800034ef4e05/images/entrypoint.sh#L63

cc @SchSeba

Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

coveralls commented Jan 10, 2024

Pull Request Test Coverage Report for Build 7974655862

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 34.481%

Files with Coverage Reduction New Missed Lines %
pkg/daemon/daemon.go 1 38.06%
Totals Coverage Status
Change from base Build 7974112157: 0.03%
Covered Lines: 4135
Relevant Lines: 11992

💛 - Coveralls

@mlguerrero12
Copy link
Contributor

LGTM

volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: os-release
Copy link
Collaborator

Choose a reason for hiding this comment

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

who is using this mount ? sriov cni entrypoint does not use it AFAIK

volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
- name: os-release
Copy link
Collaborator

Choose a reason for hiding this comment

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

same Q as above :)

@adrianchiris
Copy link
Collaborator

Move the copy logic back to the containers: section, as the image's entrypoint script ends with a "sleep forever" [1].

we could extend sriov-cni and ib-sriov-cni with a --oneshot flag which will avoid the sleep. WDYT ?
then we can keep in init containers

@zeeke
Copy link
Member Author

zeeke commented Jan 10, 2024

we could extend sriov-cni and ib-sriov-cni with a --oneshot flag which will avoid the sleep. WDYT ?
then we can keep in init containers

I like that! Going to file a PR in sriov-cni and ib-sriov-cni.

Regarding the /etc/os-release, I need it to implement an openshift only change to support running the cni on multiple RHEL versions. I'm trying to keep the community changes as low as possible: the idea is to pass that file to the cni image entrypoint, where there can be multiple sriov-cni binaries. Then a script will copy the right binary to the host.

This logic is also present in other multus cni plugin:
https://github.com/openshift/cluster-network-operator/blob/873b3290a2de28fb7fb41ad498fc9872dcb1a93b/bindata/network/multus/multus.yaml#L13

Copy link

github-actions bot commented Feb 2, 2024

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke
Copy link
Member Author

zeeke commented Feb 2, 2024

@github-actions github-actions bot added the hold label Feb 2, 2024
@zeeke zeeke force-pushed the use-cni-image-entrypoint branch from 63dedfa to a7012c8 Compare February 12, 2024 14:37
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke zeeke force-pushed the use-cni-image-entrypoint branch from a7012c8 to 0241f36 Compare February 12, 2024 16:31
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke
Copy link
Member Author

zeeke commented Feb 13, 2024

There's still a problem with ib-sriov-cni. Waiting for

@zeeke
Copy link
Member Author

zeeke commented Feb 20, 2024

/hold cancel

related work on sriov-cni and ib-sriov-cni has been merged

@zeeke zeeke requested a review from adrianchiris February 20, 2024 07:11
Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

nice work!

LGTM

Copy link
Collaborator

@adrianchiris adrianchiris left a comment

Choose a reason for hiding this comment

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

overall LGTM,

can you amend the commit msg.

i think this part is no longer true:

Move the copy logic back to the `containers:` section, as the image's
entrypoint script ends with a "sleep forever" [1].

we keep copy of cni bin in initContainer still, the cni image entrypoint now supports --no-sleep flag which allows it to function as init container.

Avoid overriding entrypoint script for sriov-cni and
ib-sriov-cni. It is more robust to rely on the image logic,
as the source image can change the path where the binary is
stored.

Mount `/etc/os-release` file to let the copy logic to make decision
on which binary it should copy depending on the operating system.

refs:
[1] https://github.com/k8snetworkplumbingwg/sriov-cni/blob/07ecbf9b6ee867054df47423e51a800034ef4e05/images/entrypoint.sh#L63

Signed-off-by: Andrea Panattoni <[email protected]>
@zeeke zeeke force-pushed the use-cni-image-entrypoint branch from 0241f36 to 0a74848 Compare February 20, 2024 13:59
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@adrianchiris
Copy link
Collaborator

@zeeke feel free to remove the hold label and merge this one, thx for working on it !

@zeeke zeeke removed the hold label Feb 20, 2024
@zeeke zeeke merged commit 6d52067 into k8snetworkplumbingwg:master Feb 20, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants