feat: add CentOS Stream support to deployment and maintenance scripts
This commit is contained in:
+25
-14
@@ -4,13 +4,13 @@
|
||||
|
||||
"""Idempotent vLLM deployment script for AMD ROCm GPUs.
|
||||
|
||||
Deploys vLLM behind nginx with self-signed TLS on Fedora or openEuler.
|
||||
Deploys vLLM behind nginx with self-signed TLS on Fedora, CentOS Stream, or openEuler.
|
||||
vLLM binds to ::1 (IPv4 loopback fallback) on port 8000, internal only;
|
||||
nginx proxies :443 → the loopback upstream with streaming (SSE) support.
|
||||
The endpoint requires an API key, delivered to the service via a 0600
|
||||
EnvironmentFile; nginx→vLLM proxying is allowed through SELinux on
|
||||
enforcing systems. Fedora gets ROCm from its native repositories;
|
||||
openEuler falls back to AMD's amdgpu-install (unsupported by AMD).
|
||||
CentOS Stream and openEuler fall back to AMD's amdgpu-install (unsupported by AMD).
|
||||
|
||||
No external dependencies — stdlib and system tools only. Every operation
|
||||
checks current state before acting; running the script repeatedly produces
|
||||
@@ -46,10 +46,11 @@ GREEN = "\033[32m"
|
||||
YELLOW = "\033[33m"
|
||||
DIM = "\033[2m"
|
||||
RESET = "\033[0m"
|
||||
VERSION = "1.1.0"
|
||||
VERSION = "1.2.0"
|
||||
|
||||
SUPPORTED_OS: dict[str, str] = {
|
||||
"fedora": "Fedora",
|
||||
"centos": "CentOS Stream",
|
||||
"openeuler": "openEuler",
|
||||
}
|
||||
|
||||
@@ -297,8 +298,17 @@ def _systemctl_is_enabled(service: str) -> bool:
|
||||
return result.returncode == 0
|
||||
|
||||
|
||||
def _map_to_el_major(version_id: str) -> str:
|
||||
"""Map an openEuler version to the closest RHEL major ("8"/"9") for AMDGPU repos."""
|
||||
def _map_to_el_major(os_id: str, version_id: str) -> str:
|
||||
"""Map an OS version to the closest RHEL major ("8"/"9") for AMDGPU repos.
|
||||
|
||||
CentOS Stream VERSION_ID is already the RHEL major (e.g. "9", "10");
|
||||
openEuler uses its own numbering (≥24 → "9", otherwise "8").
|
||||
"""
|
||||
if os_id.startswith("centos"):
|
||||
try:
|
||||
return str(int(version_id.split(".")[0]))
|
||||
except (ValueError, IndexError):
|
||||
return "9"
|
||||
try:
|
||||
major_ver = int(version_id.split(".")[0])
|
||||
except (ValueError, IndexError):
|
||||
@@ -556,19 +566,20 @@ def _install_rocm_fedora(dry_run: bool) -> None:
|
||||
_status_done("ok")
|
||||
|
||||
|
||||
def _install_rocm_openeuler(version_id: str, dry_run: bool) -> None:
|
||||
"""Install ROCm on openEuler via AMD's amdgpu-install script.
|
||||
def _install_rocm_openeuler(os_id: str, version_id: str, dry_run: bool) -> None:
|
||||
"""Install ROCm on CentOS Stream / openEuler via AMD's amdgpu-install script.
|
||||
|
||||
AMD does not list openEuler as a supported ROCm platform — the RHEL
|
||||
packages are installed strictly on a best-effort basis and may fail.
|
||||
The RHEL point-release directory and RPM filename are resolved
|
||||
AMD does not list CentOS Stream or openEuler as supported ROCm platforms —
|
||||
the RHEL packages are installed strictly on a best-effort basis and may
|
||||
fail. The RHEL point-release directory and RPM filename are resolved
|
||||
dynamically from the repository (nothing is hardcoded).
|
||||
"""
|
||||
_warn(
|
||||
"AMD does not support ROCm on openEuler — amdgpu-install targets RHEL. "
|
||||
"Continuing best-effort; this may fail or produce a broken install."
|
||||
"AMD does not support ROCm on CentOS Stream / openEuler — "
|
||||
"amdgpu-install targets RHEL. Continuing best-effort; this may fail "
|
||||
"or produce a broken install."
|
||||
)
|
||||
el_major = _map_to_el_major(version_id)
|
||||
el_major = _map_to_el_major(os_id, version_id)
|
||||
|
||||
_status(f"Resolving latest amdgpu-install release for el{el_major}")
|
||||
listing = _fetch_text(f"{AMDGPU_INSTALL_URL}/")
|
||||
@@ -695,7 +706,7 @@ def preflight_checks(os_id: str, version_id: str, dry_run: bool = False) -> dict
|
||||
if os_id == "fedora":
|
||||
_install_rocm_fedora(dry_run)
|
||||
else:
|
||||
_install_rocm_openeuler(version_id, dry_run)
|
||||
_install_rocm_openeuler(os_id, version_id, dry_run)
|
||||
results["rocm"] = True
|
||||
|
||||
# GPU verification via rocm-smi.
|
||||
|
||||
Reference in New Issue
Block a user