-
Notifications
You must be signed in to change notification settings - Fork 21
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
Introduce a ObsPackage class for grouping Container Images #1815
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
from bci_build.container_attributes import PackageType | ||
from bci_build.container_attributes import SupportLevel | ||
from bci_build.containercrate import ContainerCrate | ||
from bci_build.os_version import CAN_BE_LATEST_OS_VERSION | ||
from bci_build.os_version import OsVersion | ||
from bci_build.package import DOCKERFILE_RUN | ||
|
@@ -13,6 +12,7 @@ | |
from bci_build.package import Package | ||
from bci_build.package import Replacement | ||
from bci_build.package import _build_tag_prefix | ||
from bci_build.package.obs_package import MultiBuildObsPackage | ||
from bci_build.registry import publish_registry | ||
|
||
# last version needs to be the newest | ||
|
@@ -51,14 +51,11 @@ def _get_sac_supported_until( | |
) | ||
|
||
|
||
TOMCAT_CONTAINERS = [ | ||
ApplicationStackContainer( | ||
def _create_tomcat_container( | ||
os_version: OsVersion, tomcat_ver: str, jre_version: int | ||
) -> ApplicationStackContainer: | ||
return ApplicationStackContainer( | ||
name="apache-tomcat", | ||
package_name=( | ||
f"apache-tomcat-{tomcat_ver.partition('.')[0]}-image" | ||
if os_version.is_tumbleweed | ||
else f"sac-apache-tomcat-{tomcat_ver.partition('.')[0]}-image" | ||
), | ||
_publish_registry=publish_registry(os_version, app_collection=True), | ||
pretty_name="Apache Tomcat", | ||
custom_description=( | ||
|
@@ -125,15 +122,29 @@ def _get_sac_supported_until( | |
entrypoint_user="tomcat", | ||
logo_url="https://tomcat.apache.org/res/images/tomcat.png", | ||
) | ||
for tomcat_ver, os_version, jre_version in ( | ||
("10.1", OsVersion.TUMBLEWEED, 23), | ||
("10.1", OsVersion.TUMBLEWEED, 21), | ||
("10.1", OsVersion.TUMBLEWEED, 17), | ||
("9", OsVersion.TUMBLEWEED, 17), | ||
("10.1", OsVersion.SP6, 21), | ||
("10.1", OsVersion.SP6, 17), | ||
# (10.1, OsVersion.SP7, 21), | ||
) | ||
] | ||
|
||
TOMCAT_CRATE = ContainerCrate(TOMCAT_CONTAINERS) | ||
|
||
TOMCAT_CONTAINERS: list[MultiBuildObsPackage | ApplicationStackContainer] = [ | ||
MultiBuildObsPackage.from_bcis( | ||
Comment on lines
+127
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this comes down to a matter of personal taste, but looking at this, this makes the for me, keeping the custom, repetitive boilerplate in the container definitions at a minimum should be a goal of the dockerfile generator. this implementation turns the inner guts outside, so you constantly have to deal with the can of worms for every container that you want to convert to multibuild (and I can see that we have several candidates for that, e.g. the openjdks, potentially the pythons and other language containers). |
||
bcis=[ | ||
_create_tomcat_container(os_version, tomcat_ver, jre_version) | ||
for tomcat_ver, os_version, jre_version in ( | ||
("10.1", OsVersion.TUMBLEWEED, 23), | ||
("10.1", OsVersion.TUMBLEWEED, 21), | ||
("10.1", OsVersion.TUMBLEWEED, 17), | ||
) | ||
], | ||
package_name="apache-tomcat-10-image", | ||
), | ||
_create_tomcat_container(OsVersion.TUMBLEWEED, "9", 17), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should also be a multibuildobspackage, imho. |
||
MultiBuildObsPackage.from_bcis( | ||
package_name="sac-apache-tomcat-image", | ||
bcis=[ | ||
_create_tomcat_container(os_version, tomcat_ver, jre_version) | ||
for tomcat_ver, os_version, jre_version in ( | ||
("10.1", OsVersion.SP6, 21), | ||
("10.1", OsVersion.SP6, 17), | ||
) | ||
], | ||
), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that change seems unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is required, because
ObsPackageBase
doesn't have aname
property