Skip to content

Commit ac9b711

Browse files
Introduce GREP template and a refactored TAS GREP (#362)
* Introduced GREP template. * Added sections on monitoring and PodGang API * Added support for generating table of contents for GREPs * Added support to verify if the table of contents are up to date. * Added license headers to update-toc and verify-toc scripts * Added verify-toc to check make target * Added Alternatives section to TAS GREP Signed-off-by: Madhav Bhargava <madhav.bhargava@sap.com> Co-authored-by: Sanjay Chatterjee <sanjay.chatterjee@gmail.com> --------- Signed-off-by: Madhav Bhargava <madhav.bhargava@sap.com> Co-authored-by: Sanjay Chatterjee <sanjay.chatterjee@gmail.com>
1 parent 4a43258 commit ac9b711

File tree

10 files changed

+972
-828
lines changed

10 files changed

+972
-828
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tidy:
2929

3030
# Checks the entire codebase by linting and formatting the code base, and checking for uncommitted changes
3131
.PHONY: check
32-
check: generate add-license-headers format generate-api-docs lint
32+
check: generate add-license-headers format generate-api-docs lint verify-toc
3333
@echo "> Checking for uncommitted changes"
3434
@if [ -n "$$(git status --porcelain)" ]; then \
3535
echo "ERROR: Git tree is dirty after running validation steps."; \
@@ -116,3 +116,13 @@ test-e2e:
116116
.PHONY: test
117117
test: test-unit test-envtest
118118
@echo "> All tests passed"
119+
120+
# Updates the docs/proposals table of contents
121+
.PHONY: update-toc
122+
update-toc: $(MDTOC)
123+
@$(REPO_HACK_DIR)/update-toc.sh
124+
125+
# Verifies that the docs/proposals table of contents is up to date
126+
.PHONY: verify-toc
127+
verify-toc: $(MDTOC)
128+
@$(REPO_HACK_DIR)/verify-toc.sh

docs/designs/topology.md

Lines changed: 0 additions & 826 deletions
This file was deleted.

docs/proposals/244-topology-aware-scheduling/README.md

Lines changed: 696 additions & 0 deletions
Large diffs are not rendered by default.
197 KB
Loading
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# GREP-NNNN: Short descriptive title
2+
3+
<!-- toc -->
4+
- [Summary](#summary)
5+
- [Motivation](#motivation)
6+
- [Goals](#goals)
7+
- [Non-Goals](#non-goals)
8+
- [Proposal](#proposal)
9+
- [User Stories (<em>Optional</em>)](#user-stories-optional)
10+
- [Story 1 (<em>Optional</em>)](#story-1-optional)
11+
- [Story 2 (<em>Optional</em>)](#story-2-optional)
12+
- [Limitations/Risks &amp; Mitigations](#limitationsrisks--mitigations)
13+
- [Design Details](#design-details)
14+
- [Monitoring](#monitoring)
15+
- [Dependencies (<em>Optional</em>)](#dependencies-optional)
16+
- [Test Plan](#test-plan)
17+
- [Graduation Criteria](#graduation-criteria)
18+
- [Implementation History (<em>Optional</em>)](#implementation-history-optional)
19+
- [Alternatives (<em>Optional</em>)](#alternatives-optional)
20+
- [Appendix (<em>Optional</em>)](#appendix-optional)
21+
<!-- /toc -->
22+
23+
<!--
24+
Include a table of contents as it helps to navigate easily in the document.
25+
26+
Ensure the TOC is wrapped with
27+
<code>&lt;!-- toc --&gt;&lt;!-- /toc --&gt;</code>
28+
tags, and then generate by invoking the make target `update-toc`.
29+
30+
-->
31+
32+
## Summary
33+
34+
<!--
35+
This section should contain user-focused documentation such as release notes or a development roadmap. It should also have a summary of functional increment that is being introduced as part of this GREP. A good summary should address a wider audience and should ideally be a single paragraph.
36+
-->
37+
38+
## Motivation
39+
40+
<!--
41+
This section explicitly lists the motivation which consists of goals and the non-goals of this GREP. Use this section to describe why the change introduced in this GREP is important and what benefits it brings to the users.
42+
-->
43+
44+
### Goals
45+
46+
<!--
47+
Lists specific goals of this GREP. What is it trying to achieve.
48+
-->
49+
50+
### Non-Goals
51+
52+
<!--
53+
Lists what all is out of scope of this GREP. Listing non-goals helps to clearly define the scope within which the discussions should happen.
54+
-->
55+
56+
## Proposal
57+
58+
<!--
59+
Contains the specifics of the proposal. Sufficient details should be provided to help reviewers clearly understand the proposal. It should not include API design, low level design and implementation details which should be mentioned under 'Design Details' section instead.
60+
-->
61+
62+
### User Stories (*Optional*)
63+
64+
<!--
65+
This section provides detailed use cases descibing how changes introduced in this GREP are going to be used. The intent is to carve out real-world scenarios which serve as additional motivation providing clarity/context for the changes proposed.
66+
-->
67+
68+
#### Story 1 (*Optional*)
69+
70+
#### Story 2 (*Optional*)
71+
72+
### Limitations/Risks & Mitigations
73+
74+
<!--
75+
What are the current set of limitations or risks of this proposal? Think broadly by considering the impact of the changes proposed on kubernetes ecosystem. Optionally mention ways to mitigate these.
76+
-->
77+
78+
## Design Details
79+
80+
<!--
81+
This section may include API specifications (GO API/YAML) and certain flow control diagrams that will help reviewers to know how the proposal will be implemented.
82+
-->
83+
84+
### Monitoring
85+
86+
<!--
87+
This section contains details of events, metrics, status conditions and other status fields that will aid in determining health of the feature, or help measure any service level objectives that might be optionally defined.
88+
-->
89+
90+
### Dependencies (*Optional*)
91+
92+
<!--
93+
Are there any dependencies for this feature to work? If yes then those should be clearly listed with optional links on how to ensure that the dependencies are setup.
94+
-->
95+
96+
### Test Plan
97+
98+
<!--
99+
For the functionality an epic (issue) should be created. Along with a sub-issue for the GREP, there should be a dedicated issue created for integration and e2e tests. This issue should have details of all scenarios that needs to be tested. Provide a link to issue(s) in this section.
100+
-->
101+
102+
### Graduation Criteria
103+
104+
<!--
105+
In this section graduation milestones should be defined. The progression of the overall feature can be evaluated w.r.t API maturity, staged sub-feature implementation or some other criteria.
106+
107+
In general we try to use the same stages (alpha, beta, GA), regardless of how the
108+
functionality is accessed. Refer to these for more details:"
109+
110+
* [Feature Gates](https://git.k8s.io/community/contributors/devel/sig-architecture/feature-gates.md)
111+
* [Maturity levels](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#alpha-beta-and-stable-versions)
112+
* [Deprecation Policy](https://kubernetes.io/docs/reference/using-api/deprecation-policy/ )
113+
114+
**Note:** Generally we also wait at least two releases between beta and
115+
GA/stable, because there's no opportunity for user feedback, or even bug reports,
116+
in back-to-back releases.
117+
-->
118+
119+
## Implementation History (*Optional*)
120+
121+
<!--
122+
Major milestones in the lifecycle of a GREP should be tracked in this section.
123+
Major milestones might include:
124+
125+
- The date proposal was accepted and merged.
126+
- The date implementation started.
127+
- The date of Alpha release for the feature.
128+
- The date the feature graduated to beta/GA
129+
130+
-->
131+
132+
## Alternatives (*Optional*)
133+
134+
<!--
135+
What are the alternative approaches considered and reasons to rule those out. This section should have sufficient details (not too much) to express the alternative idea and why it was not accepted.
136+
-->
137+
138+
## Appendix (*Optional*)
139+
140+
<!--
141+
Use this section to put any prerequisite reading links or helpful information/data that supplements the proposal, thus providing additional context to the reviewer.
142+
-->
143+
144+
> NOTE: This GREP template has been inspired by [KEP Template](https://github.com/kubernetes/enhancements/blob/f90055d254c356b2c038a1bdf4610bf4acd8d7be/keps/NNNN-kep-template/README.md).
145+

docs/proposals/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Grove Enhancement Proposal (GREP)
2+
3+
A Grove Enhancement Proposal (GREP) is a structure way to suggest improvements, new features or changes to Grove. It helps you to clearly explain the proposed change(s) conceptually, and to outline the concrete steps needed to reach this goal. It helps the Grove maintainers as well as the community to understand the motivation and scope around your proposed change(s) and encourages their contribution to discussions and future pull requests.
4+
5+
## How to file a GREP
6+
7+
GREPs should be created as Markdown `.md` files and should be submitted for review via Github pull request. Please follow the following rules:
8+
* It is mandatory to create a tracking issue [here](https://github.com/ai-dynamo/grove/issues) whose issue number will also be used as the GREP number.
9+
* All GREPs should have an appropriately named directory under `docs/proposals`. The GREP's file name should be `README.md` to be consistent.
10+
* Use the GREP template at `docs/proposals/NNNN-template/README.md`
11+
* Ensure that you always generate the table of contents. Use the make target `make update-toc`.
12+
* You can locally verify if the table of contents for your GREP are up-to-date by running `make verify-toc`.
13+
14+
> NOTE: GREP is heavily inspired from Kubernetes KEP template.
15+
16+
### What is the number at the beginning of the GREP name?
17+
18+
GREPs are prefixed with their associated tracking issue number. This gives both the GREP a unique identifier and provides an easy breadcrumb for people to find the issue where the current state of the GREP is being updated.

hack/.notableofcontents

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/proposals/README.md

hack/tools.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ YQ := $(TOOLS_BIN_DIR)/yq
2727
GO_ADD_LICENSE := $(TOOLS_BIN_DIR)/addlicense
2828
SKAFFOLD := $(TOOLS_BIN_DIR)/skaffold
2929
CRD_REF_DOCS := $(TOOLS_BIN_DIR)/crd-ref-docs
30+
MDTOC := $(TOOLS_BIN_DIR)/mdtoc
3031

3132
# default tool versions
3233
# -------------------------------------------------------------------------
@@ -38,6 +39,7 @@ YQ_VERSION ?= v4.48.1
3839
GO_ADD_LICENSE_VERSION ?= v1.2.0
3940
SKAFFOLD_VERSION ?= v2.16.1
4041
CRD_REF_DOCS_VERSION ?= v0.2.0
42+
MDTOC_VERSION ?= latest
4143

4244
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
4345

@@ -85,4 +87,7 @@ $(SKAFFOLD):
8587
chmod +x $(SKAFFOLD)
8688

8789
$(CRD_REF_DOCS):
88-
GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install github.com/elastic/crd-ref-docs@$(CRD_REF_DOCS_VERSION)
90+
GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install github.com/elastic/crd-ref-docs@$(CRD_REF_DOCS_VERSION)
91+
92+
$(MDTOC):
93+
GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install sigs.k8s.io/mdtoc@latest

hack/update-toc.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
# /*
3+
# Copyright 2026 The Grove Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# */
17+
18+
19+
set -o errexit
20+
set -o nounset
21+
set -o pipefail
22+
23+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
24+
REPO_ROOT="$(dirname $SCRIPT_DIR)"
25+
26+
echo "> Updating table of contents for docs/proposals..."
27+
28+
# Process each markdown file individually
29+
while IFS= read -r file; do
30+
# Convert to relative path for exclusion check
31+
rel_path="${file#${REPO_ROOT}/}"
32+
33+
# Check if file should be excluded
34+
if grep -Fxq "${rel_path}" "${SCRIPT_DIR}/.notableofcontents" 2>/dev/null; then
35+
echo "⊘ Excluded: ${rel_path}"
36+
continue
37+
fi
38+
39+
40+
# Create a temporary copy to compare against
41+
temp_file=$(mktemp)
42+
cp "${file}" "${temp_file}"
43+
44+
# Run mdtoc on the file
45+
if mdtoc --inplace --max-depth=6 "${file}" 2>/dev/null; then
46+
# Compare to see if anything changed
47+
if diff -q "${temp_file}" "${file}" >/dev/null 2>&1; then
48+
echo "✓ Unchanged: ${rel_path}"
49+
else
50+
echo "✓ Updated: ${rel_path}"
51+
fi
52+
else
53+
echo "✗ Failed: ${rel_path}"
54+
rm -f "${temp_file}"
55+
exit 1
56+
fi
57+
58+
rm -f "${temp_file}"
59+
60+
done < <(find "${REPO_ROOT}/docs/proposals" -name '*.md' -type f | sort)

hack/verify-toc.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# /*
3+
# Copyright 2026 The Grove Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# */
17+
18+
19+
set -o errexit
20+
set -o nounset
21+
set -o pipefail
22+
23+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
24+
REPO_ROOT="$(dirname $SCRIPT_DIR)"
25+
26+
echo "> Verifying if table of contents for docs/proposals are up-to-date..."
27+
28+
find ${REPO_ROOT}/docs/proposals -name '*.md' \
29+
| sed "s|^${REPO_ROOT}/||" \
30+
| grep -Fxvf "${SCRIPT_DIR}/.notableofcontents" \
31+
| sed "s|^|${REPO_ROOT}/|" \
32+
| xargs mdtoc --inplace --max-depth=6 --dryrun || (
33+
echo "Table of content not up to date. Did you run 'make update-toc' ?"
34+
exit 1
35+
)

0 commit comments

Comments
 (0)