Bug 267184 - port dfr's podman + buildah + conmon + CNI plugins
Summary: port dfr's podman + buildah + conmon + CNI plugins
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dave Cottlehuber
URL: https://reviews.freebsd.org/D37324
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-18 19:43 UTC by Dave Cottlehuber
Modified: 2023-01-09 15:58 UTC (History)
7 users (show)

See Also:


Attachments
build & install script from 1a67b6322081831320347abde2ef901a7059ccc8 (1.38 KB, application/x-shellscript)
2022-10-18 19:43 UTC, Dave Cottlehuber
no flags Details
notes from 1a67b6322081831320347abde2ef901a7059ccc8 (1.94 KB, text/plain)
2022-10-18 19:44 UTC, Dave Cottlehuber
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Cottlehuber freebsd_committer freebsd_triage 2022-10-18 19:43:51 UTC
Created attachment 237441 [details]
build & install script from 1a67b6322081831320347abde2ef901a7059ccc8

https://gist.github.com/dfr/ac4dc043ee3780b690c5887a61f53494
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2022-10-18 19:44:43 UTC
Created attachment 237442 [details]
notes from 1a67b6322081831320347abde2ef901a7059ccc8
Comment 2 dfr 2022-10-19 07:17:35 UTC
The dependency tree is fairly simple - both podman and buildah depend on containers-networking and require an OCI runtime. Podman also requires conmon which monitors a running container, capturing logs and managing access to the container's terminal (if it has one).

For the runtime, I'm suggesting my ocijail since I built it specifically to support podman and I can turn around bugs quicker there. Longer term, runj will also work - I am coordinating with Samuel Karp on the changes needed there.

Both buildah and podman come with extensive manpages and common manpage documentation is in github.com/containers/{common,storage,image}. On Linux, these are all part of the containers-common package.
Comment 3 dfr 2022-10-21 12:40:15 UTC
I'm going to suggest building things from git rather than waiting for a stable release - the only component with released freebsd support is buildah v1.27.0 and later.

I spent a little time testing clean build+install for various things and this set builds cleanly:

github.com/dfr/ocijail hash 31a81abcb949b1a038201e386a5959f5fd450d67
github.com/dfr/plugins hash e87cc30501dd87000fdc92f76ceaf5fe8df3ed76
github.com/containers/conmon hash 534b2aa377b74e48063a2df7c79b9e407bce8cf2
github.com/containers/buildah hash 79f41e3235ecc17d711a9aa06ec769234ec95399
github.com/containers/podman hash a77ac5be83496878d1d3f39dbda3a2ac4e62d0b1

When things stabilise a little and the necessary changes are in numbered releases, we can settle down to tracking releases.
Comment 4 dfr 2022-10-24 14:09:39 UTC
I made a set of draft ports for this. I'm sure I've broken many style guides and best practices but the result builds in poudriere and I have successfully run a simple container in podman on a test vm. The code is here: https://github.com/dfr/freebsd-ports/tree/containers.

The containers-common port is kind of messy since it cherry picks files from several repos but the result is more or less doing the same thing as the Linux rpm. The ocijail port was a giant pain since I use bazel to build and thats pretty rare in the ports tree.
Comment 5 Dmitry Wagin 2022-11-03 12:57:34 UTC
Good work, Doug!

What do you think about adding a port prefix?

> PKGNAMEPREFIX= containers-
Comment 6 dfr 2022-11-03 13:37:21 UTC
I am trying to follow the package naming used for Linux which uses:

  containers-common
  containernetworking-plugins
  conmon
  buildah
  podman

I'm not sure that it makes sense to call the packages containers-buildah, containers-podman and we don't do this for the docker/moby equivalents.
Comment 7 Dave Cottlehuber freebsd_committer freebsd_triage 2022-11-10 12:06:43 UTC
Added a phab review for this now. Doug's done an amazing job on the port,
I just want to add a couple more lines of pkg-message so this is usable
from scratch, and then we are good to go!

https://reviews.freebsd.org/D37324
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e9f00fb662475f6090eb10e2ab7e52a0c3f3df09

commit e9f00fb662475f6090eb10e2ab7e52a0c3f3df09
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:30 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:30 +0000

    sysutils/buildah: new port

    The buildah package provides a command line tool which can be used to
    * create a working container from scratch
    or
    * create a working container from an image as a starting point
    * mount/umount a working container's root file system for manipulation
    * save container's root file system layer to create a new image
    * delete a working container or an image.

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile                  |  1 +
 sysutils/buildah/Makefile (new)    | 27 +++++++++++++++++++++++++
 sysutils/buildah/distinfo (new)    |  3 +++
 sysutils/buildah/pkg-descr (new)   |  7 +++++++
 sysutils/buildah/pkg-message (new) |  8 ++++++++
 sysutils/buildah/pkg-plist (new)   | 41 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 87 insertions(+)
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=780bdacd97a480633443458b5ceb576fbbf35353

commit 780bdacd97a480633443458b5ceb576fbbf35353
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:30 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:30 +0000

    sysutils/conmon: new port

    OCI container runtime monitor

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile               |  1 +
 sysutils/conmon/Makefile (new)  | 19 +++++++++++++++++++
 sysutils/conmon/distinfo (new)  |  3 +++
 sysutils/conmon/pkg-descr (new) |  3 +++
 sysutils/conmon/pkg-plist (new) |  2 ++
 5 files changed, 28 insertions(+)
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a521f78f6a37e98a28da2dfd18db2948f1b18795

commit a521f78f6a37e98a28da2dfd18db2948f1b18795
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:31 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:31 +0000

    sysutils/skopeo: new port

    Command line utility to inspect images and repositories directly on Docker
    registries without the need to pull them.

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile               |  1 +
 sysutils/skopeo/Makefile (new)  | 30 ++++++++++++++++++++++++++++++
 sysutils/skopeo/distinfo (new)  |  3 +++
 sysutils/skopeo/pkg-descr (new) |  2 ++
 sysutils/skopeo/pkg-plist (new) | 16 ++++++++++++++++
 5 files changed, 52 insertions(+)
Comment 11 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=da130a1d6225ef328a5592c1149dcb2eb8d12bd5

commit da130a1d6225ef328a5592c1149dcb2eb8d12bd5
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:31 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:31 +0000

    sysutils/podman: new port

    podman (Pod Manager) is a fully featured container engine that is a simple
    daemonless tool.  podman provides a Docker-CLI comparable command line
    that eases the transition from other container engines and allows the
    management of pods, containers and images.  Simply put: alias docker=podman.

    podman uses Buildah(1) internally to create container images.  Both tools
    share image (not container) storage, hence each can use or manipulate
    images (but not containers) created by the other.

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile                 |   1 +
 sysutils/podman/Makefile (new)    |  42 ++++++++
 sysutils/podman/distinfo (new)    |   3 +
 sysutils/podman/pkg-descr (new)   |   9 ++
 sysutils/podman/pkg-message (new) |   4 +
 sysutils/podman/pkg-plist (new)   | 212 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 271 insertions(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f23ec277674d443fdafb42abb19b4679daa27553

commit f23ec277674d443fdafb42abb19b4679daa27553
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:30 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:30 +0000

    net/containernetworking-plugins: new port

    CNI plugins for container networking support

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 net/Makefile                                       |  1 +
 net/containernetworking-plugins/Makefile (new)     | 28 ++++++++++++++++++++++
 net/containernetworking-plugins/distinfo (new)     |  3 +++
 .../files/pf.conf.sample (new)                     |  8 +++++++
 net/containernetworking-plugins/pkg-descr (new)    |  3 +++
 net/containernetworking-plugins/pkg-message (new)  |  8 +++++++
 net/containernetworking-plugins/pkg-plist (new)    |  8 +++++++
 7 files changed, 59 insertions(+)
Comment 13 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0f0152ce11cb8f71fbf14fc2fe51e511f7843932

commit 0f0152ce11cb8f71fbf14fc2fe51e511f7843932
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:29 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:29 +0000

    sysutils/ocijail: new port

    ocijail is an experimental, proof-of-concept OCI-compatible runtime for
    FreeBSD jails similar to runj but focusing on buildah and podman compatibility,

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile                |  1 +
 sysutils/ocijail/Makefile (new)  | 26 ++++++++++++++++++++++++++
 sysutils/ocijail/distinfo (new)  |  3 +++
 sysutils/ocijail/pkg-descr (new) |  3 +++
 4 files changed, 33 insertions(+)
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-11-16 12:47:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0799c6740b8f5b379468cb3a2cff9610ef6d8926

commit 0799c6740b8f5b379468cb3a2cff9610ef6d8926
Author:     Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2022-11-16 12:46:30 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2022-11-16 12:46:30 +0000

    sysutils/containers-common: new port

    Common manpages and config files for podman and buildah

    PR:             267184
    Reviewed by:    arrowd
    Reviewed by:    dch
    Sponsored by:   SkunkWerks, GmbH
    Differential Revision:  https://reviews.freebsd.org/D37324

 sysutils/Makefile                                  |   1 +
 sysutils/containers-common/Makefile (new)          |  55 ++
 sysutils/containers-common/distinfo (new)          |   9 +
 .../containers-common/files/containers.conf (new)  | 642 +++++++++++++++++++++
 sysutils/containers-common/pkg-descr (new)         |   1 +
 sysutils/containers-common/pkg-message (new)       |   9 +
 sysutils/containers-common/pkg-plist (new)         |  21 +
 7 files changed, 738 insertions(+)