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

Refactor of taking container creation pieces from server to internal/factory #7275

Open
saschagrunert opened this issue Sep 6, 2023 · 14 comments · May be fixed by #7859
Open

Refactor of taking container creation pieces from server to internal/factory #7275

saschagrunert opened this issue Sep 6, 2023 · 14 comments · May be fixed by #7859
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@saschagrunert
Copy link
Member

@haircommander can provide more input about this refactoring item. Feel free to edit the description of this roadmap topic.

@saschagrunert saschagrunert added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Sep 6, 2023
@haircommander
Copy link
Member

similar to #4868, we would like more of the container and sandbox container creation to be moved to the respective factory package and unit tested. Ideally this would also involve less code duplication

@saschagrunert saschagrunert added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Sep 6, 2023
@hasan4791
Copy link
Contributor

/assign

@hasan4791
Copy link
Contributor

Have skimmed through the code & also the reference PR and here is what I've decided to do. I'm planning to move the code parts which are related to namespaces like mount/process/nw/..etc to internal/factory/container. Also here we would create files with "_OS" to support other platforms as well. WDYT? @haircommander @saschagrunert

@haircommander
Copy link
Member

yup that sounds good @hasan4791 . I would say a goal is to be able to remove the call to c.Spec() in server/container_create_linux.go and have all of the spec generation operations go through the container factory object

@hasan4791
Copy link
Contributor

@dfr Can you take a look at the above approach inorder to avoid rework of segregating platform specific stuffs.

@dfr
Copy link
Contributor

dfr commented Sep 19, 2023

Looking at #4645 and comparing my container_create_freebsd.go with container_create_linux.go, it seems clear that at least for mounts, we will need some parts to be linux only - anything involving sysfs or cgroupfs for instance. For mounting files and directories from the host into the container, I use nullfs on FreeBSD - to improve sharing for this kind of thing in buildah and podman I used platform-specific types to avoid using "bind" in the code, e.g. https://github.com/containers/podman/blob/main/libpod/define/mount_freebsd.go

@dfr
Copy link
Contributor

dfr commented Sep 19, 2023

Other platform-specific things being added to the OCI spec include the apparmor profile, blockio and other resources, cgroups path, capabilities and anything else which touches specgen.Config.Linux

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 20, 2023
@hasan4791
Copy link
Contributor

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 8, 2023
@hasan4791
Copy link
Contributor

Unit test cases needs to be moved. WIP

Copy link

github-actions bot commented Dec 9, 2023

A friendly reminder that this issue had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 9, 2023
@saschagrunert saschagrunert removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 30, 2024
Copy link

github-actions bot commented Mar 1, 2024

A friendly reminder that this issue had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 1, 2024
@hasan4791
Copy link
Contributor

/remove-lifecycle stale
Working on UTs as we need to write test cases for all the mount related methods

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

A friendly reminder that this issue had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 5, 2024
@saschagrunert saschagrunert removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 7, 2024
@saschagrunert saschagrunert added the kind/feature Categorizes issue or PR as related to a new feature. label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: In Progress
4 participants