From cff6d28214ba04a02d0a994471c5c7c2c9b370e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Mon, 26 Jun 2023 11:17:16 +0200 Subject: [PATCH] Stop generating language pack and application stacks for SP4 We're no longer interested in those since the rollover to SP5. In order to prepare for a potential SP6 beta being introduced, split into a generic ALL_BASE_OS_VERSIONS and ALL_NONBASE_OS_VERSIONS so that this will be less churn going forward. --- src/bci_build/package.py | 80 ++++++++++++++++++++-------------------- src/dotnet/updater.py | 2 +- tests/test_bot.py | 4 +- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/bci_build/package.py b/src/bci_build/package.py index ad1b2db14..f23c08a5e 100755 --- a/src/bci_build/package.py +++ b/src/bci_build/package.py @@ -120,6 +120,8 @@ def __str__(self) -> str: class OsVersion(enum.Enum): """Enumeration of the base operating system versions for BCI.""" + #: SLE 15 Service Pack 6 + SP6 = 6 #: SLE 15 Service Pack 5 SP5 = 5 #: SLE 15 Service Pack 4 @@ -157,7 +159,14 @@ def pretty_os_version_no_dash(self) -> str: #: to ``released``. RELEASED_OS_VERSIONS = [OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED] -ALL_OS_VERSIONS = [OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED] +# For which versions to create Application and Language Containers? +ALL_NONBASE_OS_VERSIONS = [OsVersion.SP5, OsVersion.TUMBLEWEED] + +# For which versions to create Base Container Images? +ALL_BASE_OS_VERSIONS = [OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED] + +# joint set of BASE and NON_BASE versions +ALL_OS_VERSIONS = {v for v in (*ALL_BASE_OS_VERSIONS, *ALL_NONBASE_OS_VERSIONS)} CAN_BE_LATEST_OS_VERSION = [OsVersion.SP5, OsVersion.TUMBLEWEED] @@ -1250,7 +1259,7 @@ def _get_python_kwargs( package_name="python-3.6-image", support_level=SupportLevel.L3, ) - for os_version in (OsVersion.SP4, OsVersion.SP5) + for os_version in (OsVersion.SP5,) ) _PYTHON_TW_VERSIONS = ("3.9", "3.10", "3.11") @@ -1279,7 +1288,7 @@ def _get_python_kwargs( supported_until=datetime.date(2027, 12, 31), is_latest=os_version in CAN_BE_LATEST_OS_VERSION, ) - for os_version in (OsVersion.SP4, OsVersion.SP5) + for os_version in (OsVersion.SP5,) ) @@ -1337,10 +1346,6 @@ def _get_ruby_kwargs(ruby_version: Literal["2.5", "3.2"], os_version: OsVersion) RUBY_CONTAINERS = [ - LanguageStackContainer( - **_get_ruby_kwargs("2.5", OsVersion.SP4), - support_level=SupportLevel.L3, - ), LanguageStackContainer( **_get_ruby_kwargs("2.5", OsVersion.SP5), support_level=SupportLevel.L3, @@ -1391,7 +1396,7 @@ def _get_golang_kwargs(ver: _GO_VER_T, os_version: OsVersion): LanguageStackContainer( **_get_golang_kwargs(ver, os_version), support_level=SupportLevel.L3 ) - for ver, os_version in product(_GOLANG_VERSIONS, ALL_OS_VERSIONS) + for ver, os_version in product(_GOLANG_VERSIONS, ALL_NONBASE_OS_VERSIONS) ] # see https://raw.githubusercontent.com/nodejs/Release/main/README.md @@ -1436,10 +1441,12 @@ def _get_node_kwargs(ver: Literal[16, 18, 20], os_version: OsVersion): NODE_CONTAINERS = [ LanguageStackContainer( - **_get_node_kwargs(ver, os_version), support_level=SupportLevel.L3 - ) - for ver, os_version in list(product((16, 18), (OsVersion.SP4, OsVersion.SP5))) - + [(20, OsVersion.TUMBLEWEED)] + **_get_node_kwargs(16, OsVersion.SP5), support_level=SupportLevel.L3 + ), + LanguageStackContainer( + **_get_node_kwargs(18, OsVersion.SP5), support_level=SupportLevel.L3 + ), + LanguageStackContainer(**_get_node_kwargs(20, OsVersion.TUMBLEWEED)), ] @@ -1496,7 +1503,7 @@ def _get_openjdk_kwargs( **_get_openjdk_kwargs(os_version, devel, 11), support_level=SupportLevel.L3 ) for os_version, devel in product( - ALL_OS_VERSIONS, + ALL_NONBASE_OS_VERSIONS, (True, False), ) ] + [ @@ -1504,9 +1511,7 @@ def _get_openjdk_kwargs( **_get_openjdk_kwargs(os_version=os_version, devel=devel, java_version=17), support_level=SupportLevel.L3, ) - for os_version, devel in product( - (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED), (True, False) - ) + for os_version, devel in product(ALL_NONBASE_OS_VERSIONS, (True, False)) ] @@ -1674,11 +1679,8 @@ def _create_php_bci( PHP_CONTAINERS = [ - _create_php_bci(os_version, variant, 8) - for os_version, variant in product( - (OsVersion.SP4, OsVersion.SP5), - (PhpVariant.cli, PhpVariant.apache, PhpVariant.fpm), - ) + _create_php_bci(OsVersion.SP5, variant, 8) + for variant in (PhpVariant.cli, PhpVariant.apache, PhpVariant.fpm) ] @@ -1725,7 +1727,7 @@ def _create_php_bci( CMD /usr/lib/dirsrv/dscontainer -H """, ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] _DISABLE_GETTY_AT_TTY1_SERVICE = "systemctl disable getty@tty1.service" @@ -1755,7 +1757,7 @@ def _create_php_bci( """ ), ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_BASE_OS_VERSIONS ] @@ -1808,7 +1810,7 @@ def _create_php_bci( {DOCKERFILE_RUN} mkdir /run/mysql """, ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_NONBASE_OS_VERSIONS ] @@ -1832,7 +1834,7 @@ def _create_php_bci( build_recipe_type=BuildType.DOCKER, cmd=["mariadb"], ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_NONBASE_OS_VERSIONS ] @@ -1867,7 +1869,7 @@ def _create_php_bci( {DOCKERFILE_RUN} chmod +x /usr/local/bin/entrypoint.sh """, ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_NONBASE_OS_VERSIONS ] @@ -1929,9 +1931,7 @@ def _create_php_bci( CMD pg_isready -U ${{POSTGRES_USER:-postgres}} -h localhost -p 5432 """, ) - for ver, os_version in list( - product([15, 14], [OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED]) - ) + for ver, os_version in list(product([15, 14], ALL_NONBASE_OS_VERSIONS)) + [(pg_ver, OsVersion.TUMBLEWEED) for pg_ver in (13, 12)] ] @@ -1957,7 +1957,7 @@ def _create_php_bci( volumes=["/var/lib/prometheus"], exposes_tcp=[9090], ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] ALERTMANAGER_PACKAGE_NAME = "golang-github-prometheus-alertmanager" @@ -1982,7 +1982,7 @@ def _create_php_bci( volumes=["/var/lib/prometheus/alertmanager"], exposes_tcp=[9093], ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] BLACKBOX_EXPORTER_PACKAGE_NAME = "prometheus-blackbox_exporter" @@ -2006,7 +2006,7 @@ def _create_php_bci( ], exposes_tcp=[9115], ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] GRAFANA_FILES = {} @@ -2048,7 +2048,7 @@ def _create_php_bci( {DOCKERFILE_RUN} chmod +x /run.sh """, ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] _NGINX_FILES = {} @@ -2106,7 +2106,7 @@ def _create_php_bci( STOPSIGNAL SIGQUIT """, ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_NONBASE_OS_VERSIONS ] @@ -2178,7 +2178,7 @@ def _create_php_bci( ) for rust_version, os_version in product( _RUST_VERSIONS, - (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED), + ALL_NONBASE_OS_VERSIONS, ) ] @@ -2208,7 +2208,7 @@ def _create_php_bci( config_sh_script=""" """, ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_BASE_OS_VERSIONS ] MINIMAL_CONTAINERS = [ @@ -2234,7 +2234,7 @@ def _create_php_bci( for name in ("grep", "diffutils", "info", "fillup", "libzio1") ], ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_BASE_OS_VERSIONS ] BUSYBOX_CONTAINERS = [ @@ -2266,7 +2266,7 @@ def _create_php_bci( ), config_sh_interpreter="/bin/sh", ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_BASE_OS_VERSIONS ] _PCP_FILES = {} @@ -2331,7 +2331,7 @@ def _create_php_bci( CMD /usr/local/bin/healthcheck """, ) - for os_version in ALL_OS_VERSIONS + for os_version in ALL_NONBASE_OS_VERSIONS ] REGISTRY_CONTAINERS = [ @@ -2370,7 +2370,7 @@ def _create_php_bci( exposes_tcp=[5000], support_level=SupportLevel.L3, ) - for os_version in (OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED) + for os_version in ALL_NONBASE_OS_VERSIONS ] ALL_CONTAINER_IMAGE_NAMES: Dict[str, BaseContainerImage] = { diff --git a/src/dotnet/updater.py b/src/dotnet/updater.py index 537118d14..e84ca3344 100644 --- a/src/dotnet/updater.py +++ b/src/dotnet/updater.py @@ -327,7 +327,7 @@ def _is_latest_dotnet(version: _DOTNET_VERSION_T, os_version: OsVersion) -> bool DOTNET_IMAGES: list[DotNetBCI] = [] -for os_version in (OsVersion.SP4, OsVersion.SP5): +for os_version in (OsVersion.SP5,): for ver in _DOTNET_VERSIONS: package_list: list[Package | str] = [ "dotnet-host", diff --git a/tests/test_bot.py b/tests/test_bot.py index df28f025a..fac65ce22 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -3,7 +3,7 @@ import pytest import yaml -from bci_build.package import ALL_OS_VERSIONS +from bci_build.package import ALL_NONBASE_OS_VERSIONS from bci_build.package import OsVersion from staging.bot import StagingBot @@ -16,7 +16,7 @@ def run_in_tmp_path(tmp_path: pathlib.Path): os.chdir(cwd) -@pytest.mark.parametrize("os_version", ALL_OS_VERSIONS) +@pytest.mark.parametrize("os_version", ALL_NONBASE_OS_VERSIONS) @pytest.mark.parametrize("branch", ["", "something"]) @pytest.mark.parametrize("packages", [None, ["pcp-image"]]) @pytest.mark.parametrize(