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

Image: Update cXs images with missing python library #77

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 75 additions & 69 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -327,71 +327,76 @@ target "osbuild-ci-latest" {
)
}

// Packages removed from base cXs image
//"btrfs-progs", // not available in cXs
//"nbd", // not available in cXs
//"nbd-cli", // not available in cXs
//"pacman", // not available in cXs
//"pylint", // not available in cXs
//"python3.6", // deprecated
//"python3.7", // deprecated
//"python3.8", // deprecated
//"python3.9", // deprecated
//"python3.10", // deprecated
//"python3.12", // deprecated
//"python3-autopep8", // not available in cXs
//"python3-boto3", // not available in cXs
//"python3-botocore", // not available in cXs
//"python3-docutils", // not available in cXsjjk
//"python3-isort", // not available in cXs
//"python3-mypy", // not available in cXs
//"python3-pylint", // not available in cXs
//"python3-pytest", // too old in cXs
//"python3-pytest-cov", // not available in cXs
//"qemu-system-x86", // not available in cXs
//"tox", // not available in cXs
variable "CENTOS_PACKAGES" {
default = <<EOF
bash
bubblewrap
coreutils
cryptsetup
curl
dnf
dnf-plugins-core
dosfstools
e2fsprogs
findutils
git
glibc
iproute
lvm2
make
ostree
policycoreutils
python-rpm-macros
python3
python3-devel
python3-iniparse
python3-jsonschema
python3-librepo
python3-mako
python3-pip
python3-pyyaml
python3-rpm-generators
python3-rpm-macros
qemu-img
rpm
rpm-build
rpm-ostree
rpmdevtools
skopeo
systemd
systemd-container
tar
util-linux
fuse-overlayfs
EOF
}

target "virtual-osbuild-ci-cXs" {
args = {
OSB_DNF_PACKAGES = join(",", [
"bash",
//"btrfs-progs", // not available in cXs
"bubblewrap",
"coreutils",
"cryptsetup",
"curl",
"dnf",
"dnf-plugins-core",
"dosfstools",
"e2fsprogs",
"findutils",
"git",
"glibc",
"iproute",
"lvm2",
"make",
//"nbd", // not available in cXs
//"nbd-cli", // not available in cXs
"ostree",
//"pacman", // not available in cXs
"policycoreutils",
//"pylint", // not available in cXs
"python-rpm-macros",
"python3", // install just the default version
//"python3.6",
//"python3.7",
//"python3.8",
//"python3.9",
//"python3.10",
//"python3.12",
//"python3-autopep8", // not available in cXs
//"python3-boto3", // not available in cXs
//"python3-botocore", // not available in cXs
//"python3-docutils", // not available in cXs
Comment on lines -363 to -366
Copy link
Member

Choose a reason for hiding this comment

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

So, the intention with the commented out items was to keep the list the same with Fedora container, with the packages that are not available in cXs commented out with an explanation. Because it may be confusing to have some tools installed as an RPM package in Fedora, but using pip in centos.

If not a big deal, I would keep it that way.

Copy link
Member

Choose a reason for hiding this comment

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

We probably can't keep comments with the new list, right? 🤔

Copy link
Contributor Author

@elkoniu elkoniu Sep 12, 2024

Choose a reason for hiding this comment

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

Let me describe the whole story:)
For easier modification / review it is the best to keep this as a multi line string (as before). The problem is that bake syntax allows multiline string in here-doc format only. The other problem is that it was impossible in bake to append inherited variable from base image, so the only way to have this common module list was to put it as a separate variable.

There are three possible solutions, each one not perfect:

  1. I will add all the comments on top of the new variable but they will no longer be inline comments
  2. I could add them inline and modify dnf script processing it later to filter them out when it is processing list of packages.
  3. Copy paste the list with comments to each image definition with it own comments (which kills the whole inheritance idea).

I would opt for option (1) as I agree it is worth to keep those comments

"python3-devel",
"python3-iniparse",
//"python3-isort", // not available in cXs
"python3-jsonschema",
"python3-librepo",
"python3-mako",
//"python3-mypy", // not available in cXs
"python3-pip",
//"python3-pylint", // not available in cXs
//"python3-pytest", // too old in cXs
//"python3-pytest-cov", // not available in cXs
"python3-pyyaml",
"python3-rpm-generators",
"python3-rpm-macros",
"qemu-img",
//"qemu-system-x86", // not available in cXs
"rpm",
"rpm-build",
"rpm-ostree",
"rpmdevtools",
"skopeo",
"systemd",
"systemd-container",
"tar",
//"tox", // not available in cXs
"util-linux",
"fuse-overlayfs",
]),
OSB_DNF_PACKAGES = join(",", split("\n", CENTOS_PACKAGES)),
OSB_PIP_PACKAGES = join(",", [
"autopep8",
"boto3",
Expand All @@ -413,24 +418,25 @@ target "virtual-osbuild-ci-cXs" {
}

target "osbuild-ci-c9s-latest" {
args = {
OSB_FROM = "quay.io/centos/centos:stream9",
}
inherits = [
"virtual-osbuild-ci-cXs",
]
args = {
OSB_DNF_PACKAGES = format("%s%s", join(",", split("\n", CENTOS_PACKAGES)), "python3-tomli")
OSB_FROM = "quay.io/centos/centos:stream9",
}
tags = concat(
mirror("osbuild-ci-c9s", "latest", "", OSB_UNIQUEID),
)
}

target "osbuild-ci-c10s-latest" {
args = {
OSB_FROM = "quay.io/centos/centos:stream10-development",
}
inherits = [
"virtual-osbuild-ci-cXs",
]
args = {
OSB_FROM = "quay.io/centos/centos:stream10-development",
}
tags = concat(
mirror("osbuild-ci-c10s", "latest", "", OSB_UNIQUEID),
)
Expand Down
Loading