From 8c50aa1f292f17c1eb9c0081ec29436a28a534e7 Mon Sep 17 00:00:00 2001 From: Smyja Date: Sat, 20 Dec 2025 15:57:10 +0100 Subject: [PATCH 1/2] feat: Added Volcano Compatibility and scraper --- static/compatibilities/manifest.yaml | 3 +- static/compatibilities/volcano.yaml | 59 +++++++++++ utils/compatibility/scrapers/volcano.py | 132 ++++++++++++++++++++++++ 3 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 static/compatibilities/volcano.yaml create mode 100644 utils/compatibility/scrapers/volcano.py diff --git a/static/compatibilities/manifest.yaml b/static/compatibilities/manifest.yaml index 25bcdedb9e..73671292db 100644 --- a/static/compatibilities/manifest.yaml +++ b/static/compatibilities/manifest.yaml @@ -29,4 +29,5 @@ names: - gatekeeper - tigera-operator - argo-cd -- vector \ No newline at end of file +- vector +- volcano \ No newline at end of file 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.py b/utils/compatibility/scrapers/volcano.py new file mode 100644 index 0000000000..68da0ac2a6 --- /dev/null +++ b/utils/compatibility/scrapers/volcano.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" +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) + + # 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) From 183cc9dd9cde6e53a1f828614b1cb8057dbc368f Mon Sep 17 00:00:00 2001 From: Smyja Date: Sat, 20 Dec 2025 20:15:45 +0100 Subject: [PATCH 2/2] update --- static/compatibilities/manifest.yaml | 2 +- .../compatibilities/volcano-controller.yaml | 59 +++++++++++++++++++ .../{volcano.py => volcano-controller.py} | 4 +- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 static/compatibilities/volcano-controller.yaml rename utils/compatibility/scrapers/{volcano.py => volcano-controller.py} (97%) diff --git a/static/compatibilities/manifest.yaml b/static/compatibilities/manifest.yaml index 73671292db..6b18199a19 100644 --- a/static/compatibilities/manifest.yaml +++ b/static/compatibilities/manifest.yaml @@ -30,4 +30,4 @@ names: - tigera-operator - argo-cd - vector -- volcano \ No newline at end of file +- volcano-controller 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/utils/compatibility/scrapers/volcano.py b/utils/compatibility/scrapers/volcano-controller.py similarity index 97% rename from utils/compatibility/scrapers/volcano.py rename to utils/compatibility/scrapers/volcano-controller.py index 68da0ac2a6..5c7d029847 100644 --- a/utils/compatibility/scrapers/volcano.py +++ b/utils/compatibility/scrapers/volcano-controller.py @@ -9,7 +9,7 @@ validate_semver, ) -APP_NAME = "volcano" +APP_NAME = "volcano-controller" README_URL = "https://raw.githubusercontent.com/volcano-sh/volcano/master/README.md" TARGET_FILE = f"../../static/compatibilities/{APP_NAME}.yaml" @@ -105,7 +105,7 @@ def scrape(): markdown = content.decode("utf-8", errors="replace") - chart_versions = get_chart_versions(APP_NAME) + 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