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

Remove tag_version from kiwi #1973

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
133 changes: 76 additions & 57 deletions src/bci_build/package/kiwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,80 @@
from bci_build.package.versions import format_version
from bci_build.package.versions import get_pkg_version

KIWI_CONTAINERS = [
DevelopmentContainer(
name="kiwi",
pretty_name="KIWI Appliance Builder (kiwi)",
custom_description="{pretty_name} container {based_on_container}. {privileged_only}",
os_version=os_version,
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
# kiwi is not L3 supported
# support_level=SupportLevel.L3,
version=format_version(
kiwi_ver := get_pkg_version("python-kiwi", os_version), ParseVersion.PATCH
),
version_in_uid=False,
additional_versions=[
format_version(kiwi_ver, ParseVersion.MAJOR),
kiwi_minor := format_version(kiwi_ver, ParseVersion.MINOR),
],
license="GPL-3.0-or-later",
package_list=(
[
"checkmedia",
"dracut-kiwi-oem-repart",
"enchant-devel",
"gcc",
"glibc-devel",
"iproute2",
"java-21-openjdk-headless",
"jing",
"kiwi-systemdeps-filesystems",
"kpartx",
"libxml2-devel",
"lvm2",
"make",
"netcat-openbsd",
"python3-devel",
"python3-kiwi",
"python3-pip",
"tack",
"timezone",
"xorriso",
"xz",
*os_version.release_package_names,
]
+ os_version.common_devel_packages
),
custom_end=f"{generate_package_version_check('python3-kiwi', kiwi_minor, ParseVersion.MINOR)}",
build_recipe_type=BuildType.DOCKER,
_min_release_counter=(15 if os_version.is_sle15 else None),
extra_labels={
"usage": "This container requires an openSUSE/SUSE host kernel for full functionality.",
},
extra_files={
# kiwi pulls in a ton of dependencies and fails on 4GB disk workers
"_constraints": generate_disk_size_constraints(8)
},
KIWI_CONTAINERS = []

for os_version in list(set(ALL_NONBASE_OS_VERSIONS) | set((OsVersion.SLE16_0,))):
kiwi_ver = format_version(
get_pkg_version("python-kiwi", os_version), ParseVersion.PATCH
)
kiwi_major = format_version(kiwi_ver, ParseVersion.MAJOR)
use_kpartx = int(kiwi_major) >= 10
Copy link
Member

Choose a reason for hiding this comment

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

you can do that with the kiwi_minor below as well, and if you avoid the extra "use_kpartx" environment variable (which is weirdly named because it is always using kpartx), you can avoid the whole rewrite to a for loop..

Copy link
Member

Choose a reason for hiding this comment

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

I made #1974 for this. breaking this out of the tag_version mess..


KIWI_CONTAINERS.append(
DevelopmentContainer(
name="kiwi",
pretty_name="KIWI Appliance Builder (kiwi)",
custom_description="{pretty_name} container {based_on_container}. {privileged_only}",
os_version=os_version,
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
# kiwi is not L3 supported
# support_level=SupportLevel.L3,
version=kiwi_ver,
version_in_uid=False,
additional_versions=[
kiwi_major,
kiwi_minor := format_version(kiwi_ver, ParseVersion.MINOR),
],
license="GPL-3.0-or-later",
package_list=(
[
"checkmedia",
"dracut-kiwi-oem-repart",
"enchant-devel",
"gcc",
"glibc-devel",
"iproute2",
"java-21-openjdk-headless",
"jing",
"kiwi-systemdeps-filesystems",
"kpartx",
"libxml2-devel",
"lvm2",
"make",
"netcat-openbsd",
"python3-devel",
"python3-kiwi",
"python3-pip",
"tack",
"timezone",
"xorriso",
"xz",
*os_version.release_package_names,
]
+ (["kpartx"] if use_kpartx else [])
+ os_version.common_devel_packages
),
custom_end=(
generate_package_version_check(
"python3-kiwi", kiwi_minor, ParseVersion.MINOR
)
+ r"""
SHELL ["/bin/bash", "-c"]
RUN echo $'mapper: \n\
- part_mapper: kpartx\n\
' > /etc/kiwi.yml
"""
if use_kpartx
else ""
),
build_recipe_type=BuildType.DOCKER,
_min_release_counter=(15 if os_version.is_sle15 else None),
extra_labels={
"usage": "This container requires an openSUSE/SUSE host kernel for full functionality.",
},
extra_files={
# kiwi pulls in a ton of dependencies and fails on 4GB disk workers
"_constraints": generate_disk_size_constraints(8)
},
)
)
for os_version in list(set(ALL_NONBASE_OS_VERSIONS) | set((OsVersion.SLE16_0,)))
]