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

Aim to drop containers/podman as a dependency #7866

Open
7 tasks done
kannon92 opened this issue Mar 11, 2024 · 4 comments
Open
7 tasks done

Aim to drop containers/podman as a dependency #7866

kannon92 opened this issue Mar 11, 2024 · 4 comments
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@kannon92
Copy link
Contributor

kannon92 commented Mar 11, 2024

As we were working on ##7865, I noticed that we have some dependencies on podman.

@haircommander mentioned that we should start phasing that out or moving components that we need to c/common.

From a quick search, we use rootless, annotations, criu, and errorhandling.

Maybe we can start moving what we need to c/common so we can drop this as a library.
kehannon@kehannon-thinkpadp1gen4i:~/Work/cri-o$ grep -r 'podman' * --exclude-dir=vendor

internal/config/cgmgr/cgroupfs_linux.go:        "github.com/containers/podman/v4/pkg/rootless"
internal/config/cgmgr/systemd_linux.go: "github.com/containers/podman/v4/pkg/rootless"
internal/config/device/device_linux.go: createconfig "github.com/containers/podman/v4/pkg/specgen/generate"
internal/factory/container/container_test.go:   "github.com/containers/podman/v4/pkg/annotations"
internal/factory/container/container.go:        "github.com/containers/podman/v4/pkg/annotations"
internal/lib/checkpoint.go:     "github.com/containers/podman/v4/pkg/annotations"
internal/lib/checkpoint.go:     "github.com/containers/podman/v4/pkg/checkpoint/crutils"
internal/lib/checkpoint.go:     // To correctly track deleted files, let's go through the output of 'podman diff'
internal/lib/restore.go:        "github.com/containers/podman/v4/pkg/annotations"
internal/lib/restore.go:        "github.com/containers/podman/v4/pkg/checkpoint/crutils"
internal/lib/checkpoint_test.go:        "github.com/containers/podman/v4/pkg/criu"
internal/lib/container_server.go:       "github.com/containers/podman/v4/pkg/annotations"
internal/lib/container_server_freebsd.go:       "github.com/containers/podman/v4/pkg/annotations"
internal/lib/container_server_test.go:// Right now these are the only dependency for podman/v4/pkg/annotations
internal/lib/restore_test.go:   "github.com/containers/podman/v4/pkg/criu"
internal/oci/oci_test.go:       "github.com/containers/podman/v4/pkg/criu"
internal/oci/runtime_oci.go:    "github.com/containers/podman/v4/pkg/checkpoint/crutils"
internal/oci/runtime_oci.go:    "github.com/containers/podman/v4/pkg/criu"
internal/oci/runtime_vm.go:     "github.com/containers/podman/v4/pkg/annotations"
internal/storage/utils.go:// by CRI-O sandboxes and containers differ from podman container and
internal/storage/image_linux.go:        "github.com/containers/podman/v4/pkg/rootless"
internal/storage/image.go:      "github.com/containers/podman/v4/pkg/rootless"
Makefile:CONTAINER_RUNTIME ?= podman
pkg/config/config.go:   "github.com/containers/podman/v4/pkg/rootless"
README.md:and [Podman](https://github.com/containers/podman).
README.md:[You can configure CRI-O][podman-hooks] to inject
README.md:[podman-hooks]: https://github.com/containers/podman/blob/v3.0.1/pkg/hooks/README.md
server/container_checkpoint_test.go:    "github.com/containers/podman/v4/pkg/criu"
server/container_restore.go:    "github.com/containers/podman/v4/pkg/annotations"
server/container_restore.go:    "github.com/containers/podman/v4/pkg/errorhandling"
server/container_restore_test.go:       "github.com/containers/podman/v4/pkg/criu"
server/nri-api.go:      stdannotations "github.com/containers/podman/v4/pkg/annotations"
server/container_create_linux.go:       "github.com/containers/podman/v4/pkg/rootless"
server/container_create_linux.go:       selinux "github.com/containers/podman/v4/pkg/selinux"
server/sandbox_run_freebsd.go:  "github.com/containers/podman/v4/pkg/annotations"
server/sandbox_run_freebsd.go:  selinux "github.com/containers/podman/v4/pkg/selinux"
server/sandbox_run_linux.go:    "github.com/containers/podman/v4/pkg/annotations"
server/sandbox_run_linux.go:    "github.com/containers/podman/v4/pkg/rootless"
server/sandbox_run_linux.go:    selinux "github.com/containers/podman/v4/pkg/selinux"
test/checkcriu/checkcriu.go:    "github.com/containers/podman/v4/pkg/criu"
test/copyimg/copyimg.go:        "github.com/containers/podman/v4/pkg/rootless"
test/testdata/Dockerfile:# Placing it here to avoid saving its contents by podman.
test/crio-wipe.bats:# podman.
test/crio-wipe.bats:PODMAN_BINARY=${PODMAN_BINARY:-$(command -v podman || true)}
test/crio-wipe.bats:function run_podman_with_args() {
test/crio-wipe.bats:    run_podman_with_args stop -a
test/crio-wipe.bats:    run_podman_with_args rm -fa
test/crio-wipe.bats:@test "don't clear podman containers" {
test/crio-wipe.bats:    run_podman_with_args run --name test -d quay.io/crio/fedora-crio-ci:latest top
test/crio-wipe.bats:    run_podman_with_args container exists test
test/crio-wipe.bats:@test "do clear podman containers when shutdown file not found" {
test/crio-wipe.bats:    run_podman_with_args run --name test quay.io/crio/fedora-crio-ci:latest ls
test/crio-wipe.bats:    # all podman containers would be stopped after a reboot
test/crio-wipe.bats:    run_podman_with_args stop -a
test/crio-wipe.bats:    run ! run_podman_with_args container exists test
test/crio-wipe.bats:@test "fail to clear podman containers when shutdown file not found but container still running" {
test/crio-wipe.bats:    # all podman containers would be stopped after a reboot
test/crio-wipe.bats:    run_podman_with_args run --name test -d quay.io/crio/fedora-crio-ci:latest top
test/crio-wipe.bats:@test "internal_wipe don't clear podman containers" {
test/crio-wipe.bats:    run_podman_with_args run --name test -d quay.io/crio/fedora-crio-ci:latest top
test/crio-wipe.bats:    run_podman_with_args ps -a | grep test
transfer.md:recommended to leverage additional tools like [Podman](https://github.com/containers/podman).
transfer.md:commands to perform actions like executing commands within a container (`podman exec`),
transfer.md:inspecting container metadata (`podman inspect`),
transfer.md:viewing container logs (`podman logs`), and many others.
transfer.md:| `docker inspect` | `podman inspect`                             |
transfer.md:| `docker logs`    | `podman logs`                                |
transfer.md:| `docker stats`   | `podman stats`                               |
tutorials/tracing.md:podman run -it --rm --network host jaegertracing/all-in-one:1.41.0
tutorials/tracing.md:podman run -it --rm --network host \
utils/utils_test.go:    "github.com/containers/podman/v4/pkg/rootless"
utils/utils.go: "github.com/containers/podman/v4/pkg/lookup"
@saschagrunert saschagrunert added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Mar 12, 2024
@adrianreber
Copy link
Member

When implementing the checkpoint/restore support I tried to share code between Podman and CRI-O as much as possible. I can move some code to go-criu if that makes more sense to CRI-O.

@saschagrunert
Copy link
Member

@adrianreber would the code fit into c/common? Or is it used by other tools than Podman and CRI-O?

saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
We now maintain the annotations directly in CRI-O rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
We now maintain the annotations directly in CRI-O rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@adrianreber
Copy link
Member

@adrianreber would the code fit into c/common? Or is it used by other tools than Podman and CRI-O?

I also started to use some of it in containerd. It probably depends, some code depends on

	"github.com/containers/storage/pkg/archive"
	"github.com/opencontainers/selinux/go-selinux/label"

That is code I would not put in go-criu because I would not want those dependencies.

I think "github.com/containers/podman/v4/pkg/criu" could definitely move to go-criu.

"github.com/containers/podman/v4/pkg/checkpoint/crutils" that would need to be in c/common and go-criu.

saschagrunert added a commit to saschagrunert/common that referenced this issue Mar 12, 2024
The annotations are used by CRI-O, but also by Podman. To relax the
dependencies between both projects we now add them to c/common which is
vendored by both.

Refers to:
- cri-o/cri-o#7866
- cri-o/cri-o#7867

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/common that referenced this issue Mar 12, 2024
The annotations are used by CRI-O, but also by Podman. To relax the
dependencies between both projects we now add them to c/common which is
vendored by both.

Refers to:
- cri-o/cri-o#7866
- cri-o/cri-o#7867

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/common that referenced this issue Mar 12, 2024
The annotations are used by CRI-O, but also by Podman. To relax the
dependencies between both projects we now add them to c/common which is
vendored by both.

Refers to:
- cri-o/cri-o#7866
- cri-o/cri-o#7867

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
We now maintain the annotations directly in c/common rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
We now maintain the annotations directly in c/common rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
The utility function can be used directly in CRI-O and there is no need
to directly depend on `github.com/containers/podman/v4/pkg/errorhandling`.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
The utility function can be used directly in CRI-O and there is no need
to directly depend on `github.com/containers/podman/v4/pkg/errorhandling`.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 12, 2024
We now maintain the annotations directly in CRI-O rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@adrianreber
Copy link
Member

adrianreber commented Mar 13, 2024

Part of the checkpoint/restore related code is available in c/common now: containers/common#1904

Another part of the checkpoint/restore related code will be available via go-criu: checkpoint-restore/go-criu#165

saschagrunert added a commit to saschagrunert/cri-o that referenced this issue Mar 14, 2024
We now maintain the annotations directly in CRI-O rather than Podman.

Refers to cri-o#7866

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

3 participants