Skip to content

Commit b620f17

Browse files
committed
Update to Testgrid Documentation
Required updates due to sharding configuration
1 parent 5d0d953 commit b620f17

File tree

9 files changed

+105
-34
lines changed

9 files changed

+105
-34
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ environments. For more info please see [Contributing Test Results](docs/contribu
8989
[`velodrome`]: /velodrome
9090
[`testgrid`]: /testgrid
9191
[testgrid.k8s.io]: https://testgrid.k8s.io
92-
[`testgrid/config.yaml`]: /testgrid/config.yaml
9392
[`triage`]: /triage
9493
[velodrome/bigquery-metrics]: http://velodrome.k8s.io/dashboard/db/bigquery-metrics?orgId=1
9594
[velodrome/monitoring]: http://velodrome.k8s.io/dashboard/db/monitoring?orgId=1

config/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Kubernetes Project Configs
22

33
This is a central place for Kubernetes-project specific configs for some of
4-
the tools housed within this repo. At present, this is just [prow.k8s.io]
4+
the tools housed within this repo.
55

66
### Directory Structure
77

8-
- [`jobs/`](./jobs): prow job configs for [prow.k8s.io]
8+
- [`jobs/`](./jobs): Prow job configs for [prow.k8s.io](https://prow.k8s.io)
9+
- [`testgrids/`](./testgrids): Testgrid configuration for [testgrid.k8s.io](https://testgrid.k8s.io)
910
- [`tests/`](./tests): validation tests for the configs
1011

11-
[prow.k8s.io]: https://prow.k8s.io

config/jobs/README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ periodics:
142142
1. Ensure an [`OWNERS`](https://go.k8s.io/owners) file exists in the directory for job, and has appropriate approvers/reviewers
143143
1. Write or edit the job config (please see [how-to-add-new-jobs](/prow/jobs.md#how-to-configure-new-jobs))
144144
1. Ensure the job is configured to to display its results in [testgrid.k8s.io]
145-
- The new way: add [testgrid annotations]
146-
- The old way: update [`testgrid/config.yaml`]
147-
- Please see the [testgrid README](/testgrid/README.md) for more details on configuation options
145+
- The simple way: add [testgrid annotations]
146+
- Please see the testgrid [documentation](/testgrid/config.md) for more details on configuation options
148147
1. Ensure any necessary formatting or config generation happens
149148
- Run [`hack/update-config.sh`]
150149
- CI will fail against your PR if this was necessary
@@ -212,13 +211,12 @@ bazel run //experiment/config-forker -- \
212211
213212
[prow.k8s.io]: https://prow.k8s.io
214213
[@k8s-ci-robot]: https://github.com/k8s-ci-robot
215-
[testgrid annotations]: /testgrid/config.md#minimal-configuration
214+
[testgrid annotations]: /testgrid/config.md#prow-job-configuration
216215
[testgrid.k8s.io]: https://testgrid.k8s.io
217216
218217
[`experiment/config-forker`]: /experiment/config-forker
219218
[`hack/update-config.sh`]: /hack/update-config.sh
220219
[`images/`]: /images
221-
[`testgrid/config.yaml`]: /testgrid/config.yaml
222220
223221
[periodic-kubernetes-e2e-packages-pushed]: https://github.com/kubernetes/test-infra/blob/688d365adf7f71e33a4249c7b90d7e84c105dfc5/config/jobs/kubernetes/sig-cluster-lifecycle/packages.yaml#L3-L16
224222
[pull-community-verify]: https://github.com/kubernetes/test-infra/blob/f4e6553b27d9ee8b35b2f2e588ea2e18c3fa818b/config/jobs/kubernetes/community/community-presubmit.yaml#L3-L19

config/testgrids/README.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# Testgrid Configurations
22

3-
See [config.md](../../testgrid/config.md) for how to configure testgrid
3+
This readme covers information specific to testgrid.k8s.io and this repository.
4+
See Testgrid's [config.md](../../testgrid/config.md) for more information Testgrid config files.
45

5-
For these files, do not set your own defaults; they're still global variables and may affect
6-
other configurations.
6+
## Adding a Prow Job to Testgrid
77

8-
TODO(slchase): Further documentation
8+
Prow Jobs in this repository only need to be [annotated](/testgrid/config.md#prow-job-configuration);
9+
no changes are necessary here unless you are adding a brand new dashboard.
10+
11+
## Adding or Changing a Configuration
12+
13+
Any file put in this directory or a subdirectory will be picked up by [testgrid.k8s.io](https://testgrid.k8s.io).
14+
15+
## Testing
16+
17+
Run `bazel test //testgrid/...` to ensure the configuration is valid.
18+
19+
This finds common problems such as malformed yaml, a tab referring to a
20+
non-existent test group, a test group never appearing on any tab, etc.
21+
22+
Run `bazel test //...` for slightly more advanced testing, such as ensuring that
23+
every job in our CI system appears somewhere in testgrid, etc.

docs/contributing-test-results.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The process is as follows:
1717
rewriting it to better support external usage.
1818
- Add the GCS bucket info to [buckets.yaml](/kettle/buckets.yaml) via a PR (use the
1919
previously designated github handle for the `contact` field).
20-
- Add jobs and dashboards to the [testgrid config](/testgrid/config.yaml) via
20+
- Add jobs and dashboards to the [testgrid config](/config/testgrids) via
2121
a PR (use the previously designated point of contact info in a comment next to
2222
added `test_group`s, or even better in the `description` field for added
2323
`dashboard_tab`s)

testgrid/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,10 @@ Under **Options**
106106
If you need to add a new test that you want TestGrid to display, or otherwise change what is shown
107107
on https://testgrid.k8s.io, see [Testgrid Configuration](config.md).
108108
109-
The site is configured by [`config.yaml`].
110109
Updates to the config are automatically tested and pushed to production.
111110
112111
## Contributing
113112
114113
If you want to modify TestGrid beyond adding new tests or dashboards, see [Updating Testgrid](build_test_update.md).
115114
116-
[`config.proto`]: ./config/config.proto
117-
[`config.yaml`]: ./config.yaml
118115
[video]: https://www.youtube.com/watch?v=jm2l2SLq_yE

testgrid/build_test_update.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ If you need to add a new test that you want TestGrid to display, see [TestGrid C
55
If you're looking to develop for TestGrid, welcome! Note that most of the inner workings of TestGrid
66
are not open source. This is a [known issue](https://github.com/kubernetes/test-infra/issues/10409).
77

8-
## config.yaml and config.proto
8+
## YAML configuration and config.proto
99

1010
While TestGrid configuration is located in YAML files, TestGrid doesn't natively
1111
read YAML. Instead, it expects configuration data in [`config.proto`]. This file
1212
is commented, and should be treated as the authoritative "input" schema to
1313
TestGrid.
1414

1515
[`config.proto`] is generated primarily with [Configurator](cmd/configurator).
16-
Updates to [`config.yaml`] are automatically Configurated when a change is
16+
Updates to the [testgrid.k8s.io config] are automatically Configurated when a change is
1717
merged.
1818

1919
You can convert a yaml file to the config proto with:
@@ -42,10 +42,10 @@ to verify.
4242
## Testing
4343

4444
Run `bazel test //testgrid/...` to run all unit tests in TestGrid. Note that this also validates
45-
the contents of [`config.yaml`]
45+
the [testgrid.k8s.io config].
4646

47-
Run `bazel test //...` for slightly more advanced testing, such as ensuring that
47+
Run `bazel test //...` for repository-wide testing, such as ensuring that
4848
every job in our CI system appears somewhere in testgrid, etc.
4949

5050
[`config.proto`]: ./config/config.proto
51-
[`config.yaml`]: ./config.yaml
51+
[testgrid.k8s.io config]: /config/testgrids

testgrid/cmd/configurator/README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Configurator
2+
3+
Configurator takes some YAML Testgrid config files and (optionally) a Prow configuration and generates
4+
a complete Testgrid configuration.
5+
6+
This utility is important for the [inner workings](/testgrid/build_test_update.md) of Testgrid, but if
7+
you're looking to just add to or modify an existing configuration, read [`config.md`]
8+
instead.
9+
10+
## Basic Usage
11+
12+
`configurator --yaml=config.yaml --print-text --oneshot` will read the configuration from the YAML
13+
file and print it to standard output for humans to read.
14+
15+
If `--oneshot` is omitted, it will do the same thing and continue running. If the configuration it's
16+
reading is modified, it will generate again.
17+
18+
Instead of `--print-text`, you can just `--validate-config-file`, or specify an `--output`.
19+
20+
```bash
21+
--output=/path/outputfile # Writes the generated configuration to that file
22+
--output=gcs://bucket/object # Writes the generated configuration to a GCS bucket. Credentials are needed.
23+
```
24+
25+
`--default` specifies default settings to use whenever a setting isn't specified in the YAML configuration.
26+
27+
## Usage with Prow
28+
29+
If Testgrid is running in parallel with [Prow], configuration can be annotated to a Prow job instead
30+
of separately configured in a YAML file. Details for how to write these annotations are in [`config.md`].
31+
32+
The options `--prow-config` and `--prow-job-config` are used to specify where the Prow configurations are.
33+
They must be specified together.
34+
35+
## Deserialization Options
36+
37+
Configurator reads YAML configurations. Testgrid itself expects its configuration to be formatted as
38+
a [protocol buffer][`config.proto`], and has no concept of a YAML configuration.
39+
40+
By default, Configurator outputs a [`config.proto`], since it usually serves configurations to Testgrid.
41+
However, if you want to use Configurator to generate output that will be consumed by a _different
42+
instance_ of Configurator, you may want to use the `--output-yaml` option.
43+
44+
For example, if you are running your own instance of Prow, want to use annotations,
45+
and need to output those annotations so that the k8s instance of Configurator can parse them correctly,
46+
you may want to use a command like the following:
47+
48+
```bash
49+
configurator \
50+
--yaml=./dashboard_list.yaml \
51+
--default=./project_defaults.yaml \
52+
--prow-config=./prow_config.yaml \
53+
--prow-job-config=./prow_jobs \
54+
--output=./output_config.yaml \
55+
--output-yaml \
56+
--oneshot
57+
```
58+
59+
[`config.proto`]: /testgrid/config/config.proto
60+
[`config.md`]: /testgrid/config.md
61+
[Prow]: /prow/README.md

testgrid/config.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ Testgrid is composed of:
1414
* A list of **dashboards**, or collections of dashboard tabs
1515
* A list of **dashboard groups** of related dashboards.
1616

17-
Most of these objects are listed in [`config.yaml`]
17+
Most of these objects are simply listed in a [YAML config file][configuration] for Testgrid to consume.
1818

1919
## Prow Job Configuration
2020

21-
If you just have a prowjob you want to appear in an existing dashboard, add annotations to that
22-
prowjob. You don't need to change a config file here.
21+
If you just have a [Prow job](/prow/jobs.md) configuration you want to appear in an existing
22+
dashboard, add annotations to that Prow job.
2323

24-
Simply add this to your prowjob:
24+
If it's a Prow job in [the k8s.io instance](/config/jobs), you don't need to do anything else.
25+
26+
27+
Add this to your Prow job:
2528

2629
```yaml
2730
annotations:
28-
testgrid-dashboards: dashboard-name # a dashboard defined in config.yaml.
31+
testgrid-dashboards: dashboard-name # a dashboard already defined in a config.yaml.
2932
testgrid-tab-name: some-short-name # optionally, a shorter name for the tab. If omitted, just uses the job name.
3033
testgrid-alert-email: [email protected] # optionally, an alert email that will be applied to the tab created in the
3134
# first dashboard specified in testgrid-dashboards.
@@ -39,12 +42,13 @@ annotations:
3942

4043
```
4144

42-
This functionality is provided by [Configurator](cmd/configurator).
45+
This functionality is provided by [Configurator](cmd/configurator). If you have Prow jobs in a _different_
46+
instance of Prow, you may want to invoke Configurator [differently](cmd/configurator#deserialization-options).
4347

4448
If you need to create a new dashboard, or do anything more advanced, read on.
4549

4650
## Configuration
47-
Open [`config.yaml`] in your favorite editor and:
51+
Open or create a Testgrid config file [(example)][configuration] in your favorite editor and:
4852
1. Configure the test groups
4953
2. Add those testgroups to one or more tabs in one or more dashboards
5054
3. Consider using dashboard groups if multiple dashboards are needed.
@@ -113,14 +117,11 @@ dashboard_groups:
113117

114118
## Testing your configuration
115119

116-
Run `bazel test //testgrid/...` to ensure the config is valid.
120+
Run `bazel test //testgrid/...` to ensure the configuration is valid.
117121

118122
This finds common problems such as malformed yaml, a tab referring to a
119123
non-existent test group, a test group never appearing on any tab, etc.
120124

121-
Run `bazel test //...` for slightly more advanced testing, such as ensuring that
122-
every job in our CI system appears somewhere in testgrid, etc.
123-
124125
## Advanced configuration
125126
See [`config.proto`] for an extensive list of configuration options. Here are some commonly-used ones.
126127

@@ -325,4 +326,4 @@ test_groups:
325326
```
326327

327328
[`config.proto`]: ./config/config.proto
328-
[`config.yaml`]: ./config.yaml
329+
[configuration]: /config/testgrids

0 commit comments

Comments
 (0)