generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conformance display profiles on gatewayapi docs (#2874)
* Conformance display profiles on gatewayapi docs * Update requirements.txt for pandas and tabulate * Change np requirement * Adjust pandas for python version * Remove unused imports * Clean up requirements.txt * Changed display per comments * Switched axis, display the mesh and gateway profiles * Updated axis, small fixes * Addressed comments * nits, created standalone py for conformance reports * remove conformance report code from copy-geps.py
- Loading branch information
Showing
8 changed files
with
200 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
document$.subscribe(function() { | ||
var tables = document.querySelectorAll("article table:not([class])") | ||
tables.forEach(function(table) { | ||
new Tablesort(table) | ||
}) | ||
}) | ||
|
||
|