diff --git a/static/compatibilities/manifest.yaml b/static/compatibilities/manifest.yaml index b800a06c0c..e998890ce0 100644 --- a/static/compatibilities/manifest.yaml +++ b/static/compatibilities/manifest.yaml @@ -31,6 +31,7 @@ names: - tigera-operator - argo-cd - vector +- volcano-controller - victoria-metrics-operator - gpu-operator - elastic-agent diff --git a/static/compatibilities/volcano-controller.yaml b/static/compatibilities/volcano-controller.yaml new file mode 100644 index 0000000000..6ef46e64b9 --- /dev/null +++ b/static/compatibilities/volcano-controller.yaml @@ -0,0 +1,59 @@ +icon: https://raw.githubusercontent.com/volcano-sh/volcano/master/docs/images/volcano-logo.png +git_url: https://github.com/volcano-sh/volcano +release_url: https://github.com/volcano-sh/volcano/releases/tag/v{vsn} +helm_repository_url: https://volcano-sh.github.io/helm-charts +chart_name: volcano +versions: +- version: 1.13.0 + kube: ['1.33', '1.32', '1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', + '1.23'] + requirements: [] + incompatibilities: [] + chart_version: 1.13.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.13.0', 'docker.io/volcanosh/vc-scheduler:v1.13.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.13.0'] +- version: 1.12.0 + kube: ['1.32', '1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', + '1.22', '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.12.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.12.0', 'docker.io/volcanosh/vc-scheduler:v1.12.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.12.0'] +- version: 1.11.0 + kube: ['1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', + '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.11.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.11.0', 'docker.io/volcanosh/vc-scheduler:v1.11.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.11.0'] +- version: 1.10.0 + kube: ['1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.10.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.10.0', 'docker.io/volcanosh/vc-scheduler:v1.10.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.10.0'] +- version: 1.9.0 + kube: ['1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21'] + requirements: [] + incompatibilities: [] +- version: 1.8.0 + kube: ['1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21', '1.20', '1.19'] + requirements: [] + incompatibilities: [] +- version: 1.7.0 + kube: ['1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21', '1.20', '1.19'] + requirements: [] + incompatibilities: [] + chart_version: 1.7.0 + images: ['volcanosh/vc-controller-manager:v1.7.0', 'volcanosh/vc-scheduler:v1.7.0', + 'volcanosh/vc-webhook-manager:v1.7.0'] +- version: 1.6.0 + kube: ['1.23', '1.22', '1.21', '1.20', '1.19', '1.18', '1.17'] + requirements: [] + incompatibilities: [] + chart_version: 1.6.0 + images: ['volcanosh/vc-controller-manager:v1.6.0', 'volcanosh/vc-scheduler:v1.6.0', + 'volcanosh/vc-webhook-manager:v1.6.0'] diff --git a/static/compatibilities/volcano.yaml b/static/compatibilities/volcano.yaml new file mode 100644 index 0000000000..6ef46e64b9 --- /dev/null +++ b/static/compatibilities/volcano.yaml @@ -0,0 +1,59 @@ +icon: https://raw.githubusercontent.com/volcano-sh/volcano/master/docs/images/volcano-logo.png +git_url: https://github.com/volcano-sh/volcano +release_url: https://github.com/volcano-sh/volcano/releases/tag/v{vsn} +helm_repository_url: https://volcano-sh.github.io/helm-charts +chart_name: volcano +versions: +- version: 1.13.0 + kube: ['1.33', '1.32', '1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', + '1.23'] + requirements: [] + incompatibilities: [] + chart_version: 1.13.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.13.0', 'docker.io/volcanosh/vc-scheduler:v1.13.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.13.0'] +- version: 1.12.0 + kube: ['1.32', '1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', + '1.22', '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.12.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.12.0', 'docker.io/volcanosh/vc-scheduler:v1.12.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.12.0'] +- version: 1.11.0 + kube: ['1.31', '1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', + '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.11.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.11.0', 'docker.io/volcanosh/vc-scheduler:v1.11.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.11.0'] +- version: 1.10.0 + kube: ['1.30', '1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21'] + requirements: [] + incompatibilities: [] + chart_version: 1.10.0 + images: ['docker.io/volcanosh/vc-controller-manager:v1.10.0', 'docker.io/volcanosh/vc-scheduler:v1.10.0', + 'docker.io/volcanosh/vc-webhook-manager:v1.10.0'] +- version: 1.9.0 + kube: ['1.29', '1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21'] + requirements: [] + incompatibilities: [] +- version: 1.8.0 + kube: ['1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21', '1.20', '1.19'] + requirements: [] + incompatibilities: [] +- version: 1.7.0 + kube: ['1.28', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22', '1.21', '1.20', '1.19'] + requirements: [] + incompatibilities: [] + chart_version: 1.7.0 + images: ['volcanosh/vc-controller-manager:v1.7.0', 'volcanosh/vc-scheduler:v1.7.0', + 'volcanosh/vc-webhook-manager:v1.7.0'] +- version: 1.6.0 + kube: ['1.23', '1.22', '1.21', '1.20', '1.19', '1.18', '1.17'] + requirements: [] + incompatibilities: [] + chart_version: 1.6.0 + images: ['volcanosh/vc-controller-manager:v1.6.0', 'volcanosh/vc-scheduler:v1.6.0', + 'volcanosh/vc-webhook-manager:v1.6.0'] diff --git a/utils/compatibility/scrapers/volcano-controller.py b/utils/compatibility/scrapers/volcano-controller.py new file mode 100644 index 0000000000..5c7d029847 --- /dev/null +++ b/utils/compatibility/scrapers/volcano-controller.py @@ -0,0 +1,132 @@ +import re +from collections import OrderedDict + +from utils import ( + fetch_page, + get_chart_versions, + print_error, + update_compatibility_info, + validate_semver, +) + +APP_NAME = "volcano-controller" +README_URL = "https://raw.githubusercontent.com/volcano-sh/volcano/master/README.md" +TARGET_FILE = f"../../static/compatibilities/{APP_NAME}.yaml" + + +def parse_markdown_table(markdown: str, head_version: str | None = None) -> list[OrderedDict]: + if "## Kubernetes compatibility" not in markdown: + print_error("Could not find 'Kubernetes compatibility' section in README.") + return [] + + section = markdown.split("## Kubernetes compatibility", 1)[-1] + if "Key:" in section: + section = section.split("Key:", 1)[0] + + lines = [ + line.strip() + for line in section.splitlines() + if line.strip().startswith("|") and line.strip().endswith("|") + ] + if len(lines) < 3: + print_error("Kubernetes compatibility table is missing or malformed.") + return [] + + def parse_row(row: str) -> list[str]: + return [cell.strip() for cell in row.strip().strip("|").split("|")] + + header_cells = parse_row(lines[0]) + kube_headers: list[str] = [] + for cell in header_cells[1:]: + match = re.search(r"(\d+\.\d+)", cell) + kube_headers.append(match.group(1) if match else cell) + + versions: list[OrderedDict] = [] + separator_chars = {"-", " "} + for row in lines[2:]: + test_row = row.replace("|", "").strip() + if test_row and set(test_row) <= separator_chars: + continue + + cells = parse_row(row) + if not cells or len(cells) < 2: + continue + + label = cells[0] + match = re.search(r"v(\d+\.\d+)", label, re.IGNORECASE) + version = None + if match: + version = match.group(1) + elif head_version and "head" in label.lower(): + version = head_version + else: + continue + + as_semver = validate_semver(version) + if as_semver: + version = str(as_semver) + else: + continue + + kube_list: list[str] = [] + for kube, status in zip(kube_headers, cells[1:]): + marker = status.strip() + if marker and marker != "-": + kube_list.append(kube) + + if not kube_list: + continue + + kube_list = sorted( + set(kube_list), + key=lambda v: tuple(map(int, v.split("."))), + reverse=True, + ) + + versions.append( + OrderedDict( + [ + ("version", version), + ("kube", kube_list), + ("requirements", []), + ("incompatibilities", []), + ] + ) + ) + + return versions + + +def scrape(): + content = fetch_page(README_URL) + if not content: + print_error("Failed to download Volcano README.") + return + + markdown = content.decode("utf-8", errors="replace") + + chart_versions = get_chart_versions(APP_NAME, chart_name="volcano") + + # Use the latest stable appVersion from the chart index for the HEAD row. + latest_chart_version = None + if chart_versions: + parsed_versions = [ + validate_semver(v) for v in chart_versions.keys() if validate_semver(v) + ] + stable_versions = [v for v in parsed_versions if not v.prerelease] + target = max(stable_versions, default=None) or max(parsed_versions, default=None) + if target: + latest_chart_version = str(target) + + versions = parse_markdown_table(markdown, latest_chart_version) + if not versions: + print_error("No Volcano compatibility data extracted.") + return + + if chart_versions: + for entry in versions: + chart_version = chart_versions.get(entry["version"]) + if chart_version: + entry["chart_version"] = chart_version + + update_compatibility_info(TARGET_FILE, versions)