diff --git a/conformance/reports/v1.0.0/cilium/v1.15.0-pre.3-report.yaml b/conformance/reports/v1.0.0/cilium/v1.15.0-pre.3-report.yaml index f0bdb99677..3c99766be3 100644 --- a/conformance/reports/v1.0.0/cilium/v1.15.0-pre.3-report.yaml +++ b/conformance/reports/v1.0.0/cilium/v1.15.0-pre.3-report.yaml @@ -38,7 +38,7 @@ profiles: - HTTPRouteRequestTimeout - HTTPRouteResponseHeaderModification - HTTPRouteSchemeRedirect - name: HTTP + name: HTTP - core: result: success statistics: diff --git a/hack/mkdocs-copy-geps.py b/hack/mkdocs-copy-geps.py index 81fdc3a33c..4ee4d846a3 100644 --- a/hack/mkdocs-copy-geps.py +++ b/hack/mkdocs-copy-geps.py @@ -18,7 +18,8 @@ log = logging.getLogger('mkdocs') + @plugins.event_priority(100) def on_pre_build(config, **kwargs): log.info("copying geps") - shutil.copytree("geps","site-src/geps", dirs_exist_ok=True) + shutil.copytree("geps", "site-src/geps", dirs_exist_ok=True) diff --git a/hack/mkdocs-generate-conformance.py b/hack/mkdocs-generate-conformance.py new file mode 100644 index 0000000000..c7f01d449c --- /dev/null +++ b/hack/mkdocs-generate-conformance.py @@ -0,0 +1,133 @@ +# Copyright 2023 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from mkdocs import plugins +import yaml +import pandas +from fnmatch import fnmatch +import glob + +log = logging.getLogger('mkdocs') + + +@plugins.event_priority(100) +def on_pre_build(config, **kwargs): + log.info("generating conformance") + + yamlReports = getYaml() + + generate_conformance_tables(yamlReports) + + +desc = """ +The following tables are populated from the conformance reports [uploaded by project implementations](https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/reports). They are separated into the extended features that each project supports listed in their reports. +Implementations only appear in this page if they pass Core conformance for the resource type, and the features listed should be Extended features. +""" + +warning_text = """ +???+ warning + + + This page is under active development and is not in its final form, + especially for the project name and the names of the features. + However, as it is based on submitted conformance reports, the information is correct. +""" + +# NOTE: will have to be updated if new (extended) features are added +httproute_extended_conformance_features_list = ['HTTPRouteBackendRequestHeaderModification', 'HTTPRouteQueryParamMatching', 'HTTPRouteMethodMatching', 'HTTPRouteResponseHeaderModification', 'HTTPRoutePortRedirect', 'HTTPRouteSchemeRedirect', + 'HTTPRoutePathRedirect', 'HTTPRouteHostRewrite', 'HTTPRoutePathRewrite', 'HTTPRouteRequestMirror', 'HTTPRouteRequestMultipleMirrors', 'HTTPRouteRequestTimeout', 'HTTPRouteBackendTimeout', 'HTTPRouteParentRefPort'] + + +def generate_conformance_tables(reports): + + gateway_http_table = generate_profiles_report(reports, 'HTTP') + gateway_http_table = gateway_http_table.rename_axis('Organization') + + # Currently no implementation has extended supported features listed. + # Can uncomment once a list is needed to keep track + # gateway_tls_table = generate_profiles_report(reprots,'TLS') + + mesh_http_table = generate_profiles_report(reports, 'MESH') + mesh_http_table = mesh_http_table.rename_axis('Organization') + + with open('site-src/implementation-table.md', 'w') as f: + f.write(desc) + f.write("\n\n") + + f.write(warning_text) + f.write("\n\n") + + f.write("## Gateway Profile\n\n") + f.write("### HTTPRoute\n\n") + f.write(gateway_http_table.to_markdown()+'\n\n') + + f.write("## Mesh Profile\n\n") + f.write("### HTTPRoute\n\n") + f.write(mesh_http_table.to_markdown()) + + +def generate_profiles_report(reports, route): + + http_reports = reports.loc[reports["name"] == route] + http_reports.set_index('organization') + http_reports.sort_values(['organization', 'version'], inplace=True) + + http_table = pandas.DataFrame( + columns=http_reports['organization']) + http_table = http_reports[['organization', 'project', + 'version', 'extended.supportedFeatures']].T + http_table.columns = http_table.iloc[0] + http_table = http_table[1:].T + + for row in http_table.itertuples(): + for feat in row._3: + http_table.loc[row.Index, feat] = ':white_check_mark:' + http_table = http_table.fillna(':x:') + http_table = http_table.drop(['extended.supportedFeatures'], axis=1) + + http_table = http_table.rename( + columns={"project": "Project", "version": "Version"}) + + return http_table + + +# the path should be changed when there is a new version +conformance_path = "conformance/reports/v1.0.0/**" + + +def getYaml(): + log.info("parsing conformance reports ============================") + yamls = [] + + for p in glob.glob(conformance_path, recursive=True): + + if fnmatch(p, "*.yaml"): + + x = load_yaml(p) + profiles = pandas.json_normalize( + x, record_path='profiles', meta=["implementation"]) + + implementation = pandas.json_normalize(profiles.implementation) + yamls.append(pandas.concat([implementation, profiles], axis=1)) + + yamls = pandas.concat(yamls) + return yamls + + +def load_yaml(name): + with open(name, 'r') as file: + x = yaml.safe_load(file) + + return x diff --git a/mkdocs.yml b/mkdocs.yml index 8dfd21bd5c..de572bff26 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,8 +5,12 @@ site_dir: site docs_dir: site-src extra_css: - stylesheets/extra.css +extra_javascript: + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + - js/implementations.js hooks: - hack/mkdocs-copy-geps.py +- hack/mkdocs-generate-conformance.py watch: - geps theme: @@ -75,7 +79,9 @@ nav: Overview: mesh/index.md GAMMA Initiative: mesh/gamma.md Service Facets: mesh/service-facets.md - - Implementations: implementations.md + - Implementations: + List: implementations.md + Comparison: implementation-table.md - FAQ: faq.md - Glossary: concepts/glossary.md - Guides: diff --git a/requirements.txt b/requirements.txt index a59a162ab0..51a3f0a607 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,9 +14,11 @@ mkdocs-material==9.5.19 mkdocs-material-extensions==1.3.1 mkdocs-redirects==1.2.1 mkdocs-mermaid2-plugin==1.1.1 +pandas==2.0.3 pep562==1.1 Pygments==2.17.2 pymdown-extensions==10.8.1 PyYAML==6.0.1 six==1.16.0 +tabulate==0.9.0 tornado==6.4 diff --git a/site-src/implementation-table.md b/site-src/implementation-table.md new file mode 100644 index 0000000000..2d6c7a23bf --- /dev/null +++ b/site-src/implementation-table.md @@ -0,0 +1,40 @@ + +The following tables are populated from the conformance reports [uploaded by project implementations](https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/reports). They are separated into the extended features that each project supports listed in their reports. +Implementations only appear in this page if they pass Core conformance for the resource type, and the features listed should be Extended features. + + + +???+ warning + + + This page is under active development and is not in its final form, + especially for the project name and the names of the features. + However, as it is based on submitted conformance reports, the information is correct. + + +## Gateway Profile + +### HTTPRoute + +| Organization | Project | Version | HTTPRouteMethodMatching | HTTPRouteQueryParamMatching | HTTPRouteResponseHeaderModification | HTTPRouteBackendTimeout | HTTPRouteHostRewrite | HTTPRouteParentRefPort | HTTPRoutePathRedirect | HTTPRoutePathRewrite | HTTPRoutePortRedirect | HTTPRouteRequestMirror | HTTPRouteRequestMultipleMirrors | HTTPRouteRequestTimeout | HTTPRouteSchemeRedirect | +|:---------------|:------------------------------|:--------------|:--------------------------|:------------------------------|:--------------------------------------|:--------------------------|:-----------------------|:-------------------------|:------------------------|:-----------------------|:------------------------|:-------------------------|:----------------------------------|:--------------------------|:--------------------------| +| Kong | kubernetes-ingress-controller | v3.0.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | +| Kong | kubernetes-ingress-controller | v3.1.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | +| cilium | cilium | v1.15.0-pre.3 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| envoyproxy | envoy-gateway | v0.6.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| istio | istio | 1.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| kumahq | kuma | 2.6.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | +| nginxinc | nginx-kubernetes-gateway | v1.1.0 | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | +| nginxinc | nginx-gateway-fabric | v1.2.0 | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | +| projectcontour | contour | v1.28.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| projectcontour | contour | v1.28.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| solo.io | gloo-gateway | v2.0.0-beta1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | + +## Mesh Profile + +### HTTPRoute + +| Organization | Project | Version | HTTPRouteRequestTimeout | HTTPRoutePathRedirect | HTTPRouteRequestMirror | HTTPRoutePathRewrite | HTTPRouteMethodMatching | HTTPRouteRequestMultipleMirrors | HTTPRouteBackendTimeout | HTTPRouteResponseHeaderModification | HTTPRoutePortRedirect | HTTPRouteSchemeRedirect | HTTPRouteHostRewrite | HTTPRouteQueryParamMatching | +|:---------------|:----------|:----------|:--------------------------|:------------------------|:-------------------------|:-----------------------|:--------------------------|:----------------------------------|:--------------------------|:--------------------------------------|:------------------------|:--------------------------|:-----------------------|:------------------------------| +| istio | istio | 1.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| kumahq | kuma | 2.6.0 | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | \ No newline at end of file diff --git a/site-src/implementations.md b/site-src/implementations.md index 55ff211d1e..c3d02b9838 100644 --- a/site-src/implementations.md +++ b/site-src/implementations.md @@ -7,6 +7,11 @@ Implementors and integrators of Gateway API are encouraged to update this document with status information about their implementations, the versions they cover, and documentation to help users get started. + +!!! info "Compare extended supported features across implementations" + + [View a table to quickly compare supported features of projects](/implementation-table). These outline Gateway controller implementations that have passed core conformance tests, and focus on extended conformance features that they have implemented. + ## Gateway Controller Implementation Status - [Acnodal EPIC][1] @@ -85,6 +90,8 @@ cover, and documentation to help users get started. [gamma]:/concepts/gamma/ + + ## Implementations In this section you will find specific links to blog posts, documentation and other Gateway API references for specific implementations. diff --git a/site-src/js/implementations.js b/site-src/js/implementations.js new file mode 100644 index 0000000000..26be6d972d --- /dev/null +++ b/site-src/js/implementations.js @@ -0,0 +1,8 @@ +document$.subscribe(function() { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function(table) { + new Tablesort(table) + }) +}) + +