youki icon indicating copy to clipboard operation
youki copied to clipboard

[FEATURE]: Define Linux Network Devices

Open nayuta723 opened this issue 7 months ago • 12 comments
trafficstars

Background

In this issue https://github.com/opencontainers/runtime-spec/issues/1239 and PR https://github.com/opencontainers/runtime-spec/pull/1271 on runtime-spec, support for the netdevices field in the OCI specification is being added.

Feature Request

We are upgrading oci-spec-rs by supporting the netdevices field and adding the feature of moving existing network devices into the container namespace.

Is the request related to some problem running youki?

No response

Proposed Solution

No response

Considerations

No response

Additional Context

Since it's a recently added field, neither runc nor runtime-tools has implemented it yet. A pull request is currently open for runc. As for runtime-tools, the implementation is still missing, so additional test implementations will be necessary.

nayuta723 avatar Apr 07 '25 12:04 nayuta723

@utam0k I created an issue regarding the netdevices field. Please let me know if I misunderstood anything. I'm also interested in working on this issue and would appreciate it if I could be assigned.

nayuta723 avatar Apr 07 '25 12:04 nayuta723

Hey @nayuta-ai , thanks for opening this. I'm not familiar with this yet, but as this has landed in spec, we can start support for it. I think first we need to update oci-spec-rs to have this definition in it. Then we can upgrade oci-spec crate in youki, but not implement this ; and once youki has upgraded the oci-spec, we can start implementation here.

May I ask you to open a corresponding issue on oci-spec , and if you are interested in it, open a PR for that? I'll assign that issue and this one to you as well if you are interested.

YJDoc2 avatar Apr 08 '25 04:04 YJDoc2

Also, because this is so new , I think we would be the first ones to implement this, along with runc i.e. we won't have any reference implementation. In such case, maybe we should either gate it via features or note it in release notes that this is still experimental and there can be bugs or accidental vulnerabilities. wdyt?

YJDoc2 avatar Apr 08 '25 04:04 YJDoc2

FYI: runc has already had the PoC by @aojea, the author of this OCI Runtime's PR. https://github.com/opencontainers/runc/pull/4538

utam0k avatar Apr 08 '25 10:04 utam0k

Anyway, since it's worth starting to implement this feature in production or experimental, I'll assign it to you.

utam0k avatar Apr 08 '25 10:04 utam0k

May I ask you to open a corresponding issue on oci-spec , and if you are interested in it, open a PR for that? I'll assign that issue and this one to you as well if you are interested.

Acknowledged! I've created an issue, and as I'm interested in this, I plan to submit a PR. Thank you for your consideration!

nayuta723 avatar Apr 09 '25 14:04 nayuta723

oci-spec-rs has been merged, and I have a question regarding the continued work.

  • What is the best way to proceed? For example, there is no implementation in runtime-tools, so I think we have to test and implement contest implementation to guarantee the operation.I would like to get your opinion whether I should maintain it as one PR or separate them.
  • Also, I feel that oci-spec-rs is crate managed and cannot be used on the youki side without releasing it.What kind of development system do you have?

Please take care of the above!

nayuta723 avatar Apr 23 '25 11:04 nayuta723

I would like to get your opinion whether I should maintain it as one PR or separate them.

I prefer one PR.

Also, I feel that oci-spec-rs is crate managed and cannot be used on the youki side without releasing it.What kind of development system do you have?

I'm going to release the new version.

utam0k avatar Apr 23 '25 11:04 utam0k

Thank you for your quick response! I understood the above!

nayuta723 avatar Apr 23 '25 11:04 nayuta723

Done ✅ https://crates.io/crates/oci-spec/0.8.0

utam0k avatar Apr 23 '25 12:04 utam0k

@utam0k A problem occurred with the get method in LinuxNetDevice, so I have created an issue and a PR for the fix. Additionally, I have added tests to prevent similar problems in the future. Please review it!

https://github.com/youki-dev/oci-spec-rs/issues/277 https://github.com/youki-dev/oci-spec-rs/pull/278

nayuta723 avatar Apr 26 '25 03:04 nayuta723

@utam0k Please reopen this issue.

nayuta723 avatar Jun 20 '25 13:06 nayuta723