Skip to content

Commit

Permalink
Stop generating language pack and application stacks for SP4
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dirkmueller committed Jun 26, 2023
1 parent 9ae6d6a commit cff6d28
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
80 changes: 40 additions & 40 deletions src/bci_build/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,)
)


Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)),
]


Expand Down Expand Up @@ -1496,17 +1503,15 @@ 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),
)
] + [
LanguageStackContainer(
**_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))
]


Expand Down Expand Up @@ -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)
]


Expand Down Expand Up @@ -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 [email protected]"
Expand Down Expand Up @@ -1755,7 +1757,7 @@ def _create_php_bci(
"""
),
)
for os_version in ALL_OS_VERSIONS
for os_version in ALL_BASE_OS_VERSIONS
]


Expand Down Expand Up @@ -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
]


Expand All @@ -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
]


Expand Down Expand Up @@ -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
]


Expand Down Expand Up @@ -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)]
]

Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
]


Expand Down Expand Up @@ -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,
)
]

Expand Down Expand Up @@ -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 = [
Expand All @@ -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 = [
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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] = {
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand Down

0 comments on commit cff6d28

Please sign in to comment.