Skip to content

Commit e863c2e

Browse files
authored
Fix markdown linting errors (#112)
* Fix minor markdown liniting errors * Fix remaining markdown linting errors with Claude * Use callouts for warnings in deprecated metric providers * Fix linting error - regex of container name * Add CONTRIBUTING.md - how to add a pre-commit hook for auto-linting
1 parent 6172f9b commit e863c2e

File tree

70 files changed

+377
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+377
-329
lines changed

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing
2+
3+
We are super happy if you are interested in contributing to the documentation of the Green Metrics Tool.
4+
5+
All contributions should be done via Pull Requests. We use the standard forking workflow for Pull Requests. If you are not familiar with forks, you can find more information e.g. in [GitHub's documentation](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)
6+
7+
## Lint
8+
9+
We use [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) for linting the content of the documentation.
10+
11+
To check if the content has linting issues you can call
12+
13+
```sh
14+
npm run lint:markdown
15+
```
16+
17+
in the project directory.
18+
19+
To automatically resolve fixable issues, use
20+
21+
```sh
22+
npm run lint:markdown-fix
23+
```
24+
25+
We recommend that you set a pre-commit hook to lint and fix issues automatically every time you commit. This can be done by adding
26+
27+
```sh
28+
npm run lint:markdown-fix:staged
29+
```
30+
31+
to a file named `./.git/hooks/pre-commit` and making it executable `chmod +x ./.git/hooks/pre-commit`

content/en/docs/cluster/accuracy-control.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ When using the *client* mode the cluster expects a *Measurement Control Workload
1111
This is done by running a defined workload and checking the standard deviation over a defined window of measurements.
1212

1313
We recommend having your machines setup with our [NOP Linux changes →]({{< relref "nop-linux" >}}) and utilize the following setting by using our provided control workload:
14+
1415
```yml
1516
cluster:
1617
client:
@@ -63,6 +64,4 @@ cluster:
6364
+ `phase` **[str]**: The phase to look at. default is *004_[RUNTIME]*. We do not recommend to change this unless you have a custom defined phase you want to look at.
6465
+ `metrics` **[dict]**: Contains a dictionary of all the metrics you want to check the STDDEV or relative STDDEV. Every metric is looked at individually and if the thresshold is exceeded of any of them the cluster will pause further job processing. Checks can be either relative or absolute. We recommend using relative where possible and absolute only of you very small values for the relevant metric and even small changes will lead to high relative changes. We further recommend using the default set as defined above if you have these metric providers enabled. If you do not have these providers available we recommend choosing at least one `psu_energy_...` provider that actually measures and does not estimation. The names are found in the *Metric Name* section of the respective metric provider.\
6566
Example: [RAPL CPU →]({{< relref "/docs/measuring/metric-providers/cpu-energy-RAPL-MSR-component" >}}) is `cpu_energy_rapl_msr_component`
66-
67-
68-
67+

content/en/docs/cluster/cron-jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ They must be run periodically through an external trigger, for instance through
1212

1313
This page provides examples how we setup the *cron jobs*. Adjust the times and frequency to your needs.
1414

15-
```
15+
```bash
1616
# m h dom mon dow command
1717
SHELL=/bin/bash
1818

content/en/docs/cluster/installation.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ WantedBy=default.target
5252
```
5353

5454
Then activate the service
55+
5556
```bash
5657
systemctl --user daemon-reload # Reload the systemd configuration
5758
systemctl --user enable green-coding-client # enable on boot
@@ -78,6 +79,7 @@ sudo chmod 500 /etc/sudoers.d/green-coding-cluster-cleanup
7879
The Green Metrics Tool comes with an implemented queueing and locking mechanism. In contrast to the NOP Linux implementation this way of checking for jobs doesn't poll with a process all the time but relies on cron which is not available on NOP Linux.
7980

8081
You can install a cronjob on your system to periodically call:
82+
8183
- `python3 -u PATH_TO_GREEN_METRICS_TOOL/tools/jobs.py project` to measure projects in database queue
8284
- `python3 -u PATH_TO_GREEN_METRICS_TOOL/tools/jobs.py email` to send all emails in the database queue
8385

@@ -105,6 +107,7 @@ machine:
105107
base_temperature_chip: "coretemp-isa-0000"
106108
base_temperature_feature: "Package id 0"
107109
```
110+
108111
The `id` and the `description` must be unique so that they do not conflict with the other machines in the cluster.
109112

110113
If you are using the *NOP Linux* setup with the `client.py` service you must also setup the temperature checking. Find out what your system has when it is cool. You can either use our calibration script or just let the machine sit for a while until the temperature does not change anymore. Then set the value `base_temperature_value`. It has no unit, but is rather just a value in degree (°). It should have the same unit as your output of `sensors` on your Linux box.
@@ -114,14 +117,14 @@ Since we are using our [lm_sensors provider →]({{< relref "/docs/measuring/met
114117
#### Profiling Machines
115118

116119
Machines that are intended to create a carbon profile *as it would be seen in a user machine* should have:
120+
117121
- Turbo Boost turned on
118122
- Hyper Threading turned on
119123
- DVFS turned on
120124
- Allow C8-C0 states
121125

122126
This is the minium set we deem reasonable. Please note that this resembles a user machine the best. For server machines some of these configurations should be changed. For servers Hyper Threading is often turned on whereas DVFS is often turned off.
123127

124-
125128
#### Benchmarking Machines
126129

127130
To have the most stable result benchmarking machines or if you want to use Container Energy Estimations based on CPU Utilization you should have:
@@ -133,7 +136,7 @@ To have the most stable result benchmarking machines or if you want to use Conta
133136

134137
All of these settings can be tweaked best in the BIOS. Additionally for turning DVFS off we recommend booting the kernel with `intel_pstate` CPU frequency driver deactived and using the `acpi` one which allows for setting the `userspace` govenor.
135138

136-
```
139+
```bash
137140
$ sudo nano /etc/default/grub
138141
139142
# Change this line
@@ -174,4 +177,3 @@ The GMT refers to *client* when it is talking about the settings for the `client
174177
When using the *client* mode the cluster expects a *Measurement Control Workload* to be set to determine if the cluster accuracy has deviated from the expected baseline.
175178

176179
Please see [Accuracy Control →]({{< relref "accuracy-control" >}}) for details.
177-

content/en/docs/cluster/nop-linux.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We recommend tuning the Linux OS on all linux measurement machines that you have
1313
The following script configures an Ubuntu 22.04+ system to have no active timers running, remove all unneeded services and disable also
1414
NTP.
1515

16-
The goal is to keep the system still very close to a production / user setup, but remove invariances from the system without
16+
The goal is to keep the system still very close to a production / user setup, but remove invariances from the system without
1717
decreasing idle power draw and skewing results.
1818

1919
Please further note that you must execute certain service still periodically. The [client.py](https://github.com/green-coding-solutions/green-metrics-tool/blob/main/cron/client.py) cluster service will periodically run [a cleanup script](https://github.com/green-coding-solutions/green-metrics-tool/blob/main/tools/cluster/cleanup_original.py)
@@ -159,4 +159,4 @@ else
159159
fi
160160

161161
echo "All done. Please reboot system!"
162-
```
162+
```

content/en/docs/cluster/observability.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ To provide insights and execute net-gain analysis we provide an extension to the
2929
In essence it is an aggregate dashboard that gathers all energy and carbon data from our tools that submit their data to the GMT API.
3030

3131
In the *CarbonDB Dashboard* you can find:
32+
3233
- CI/CD energy and carbon data from Eco-CI
3334
- Benchmarking energy and carbon data from Green Metrics Tool runs
3435
- Developer machine energy and carbon data from PowerHOG
35-
- Custom energy and carbon data from [CarbonDB Agents](https://github.com/green-coding-solutions/carbondb-agent) configured
36-
- A typical setup for instance is to install a [CarbonDB Agent](https://github.com/green-coding-solutions/carbondb-agent) on the database server as well as the Frontend / Dashboard server
36+
- Custom energy and carbon data from [CarbonDB Agents](https://github.com/green-coding-solutions/carbondb-agent) configured
37+
- A typical setup for instance is to install a [CarbonDB Agent](https://github.com/green-coding-solutions/carbondb-agent) on the database server as well as the Frontend / Dashboard server

content/en/docs/cluster/power-saving.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ When the cluster is setup it is often not needed to have the machines powered wh
1111

1212
What you can setup is a simple Wake-on-LAN script that will only wakeup the machines when there is job in the queue waiting.
1313

14-
For examplary purposes we document a script here that works on a low power *Raspberry PI* that we have active in our
14+
For examplary purposes we document a script here that works on a low power *Raspberry PI* that we have active in our
1515
local network, but any simple microcontroller that has HTTP capabilites will.
1616

1717
```bash
@@ -45,6 +45,7 @@ fi
4545
```
4646

4747
### Turning machine off on empty queue
48+
4849
To use this functionality you should have *Wake-on-LAN* activated.
4950

5051
You can then set the `shutdown_on_job_no` to either "*poweroff*" or "*suspend*" and the machine will turn off when the job queue is empty.
@@ -60,6 +61,7 @@ In order for the shutdown to be triggered by the `client.py` you must allow the
6061
Please choose the line that is appropriate for you depending on if you want to suspend or poweroff.
6162

6263
Example:
64+
6365
```bash
6466
echo 'ALL ALL=(ALL) NOPASSWD:/usr/bin/systemctl suspend' | sudo tee /etc/sudoers.d/green-coding-shutdown # for systems that support suspend
6567
echo 'ALL ALL=(ALL) NOPASSWD:/usr/bin/systemctl poweroff' | sudo tee -a /etc/sudoers.d/green-coding-shutdown # for systems that only can shutdown
@@ -71,6 +73,7 @@ sudo chmod 500 /etc/sudoers.d/green-coding-shutdown
7173
In rare circumstances Wake-On-Lan is not active on the machine.
7274

7375
Check the following:
76+
7477
- Check the BIOS if Wake-On-Lan is enabled.
7578
+ If no option is present it might not be configurable through the BIOS
7679
- Check `$ sudo ethtool <YOUR_INTERFACE>`
@@ -106,6 +109,7 @@ Check `$ cat /sys/power/state`. It should list `mem` as part of the output.
106109
This means the OS supports bringing the system to *Suspend to RAM*.
107110

108111
Now check `$ cat /sys/power/mem_sleep`. A sample output looks like this:
112+
109113
```log
110114
s2idle [deep]
111115
```

content/en/docs/cluster/security.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We recommend having the default user active for the API to only have *SELECT* an
1818

1919
That way if your are victim to an SQL injection or code injection the resulting injection cannot modifiy existing data.
2020

21-
```
21+
```sql
2222
CREATE USER manager WITH PASSWORD 'YOUR_PASSWORD';
2323

2424
REVOKE ALL PRIVILEGES ON DATABASE "green-coding" FROM manager;
@@ -64,7 +64,7 @@ GRANT USAGE, SELECT ON SEQUENCE jobs_new_id_seq TO manager;
6464
GRANT SELECT, INSERT ON TABLE jobs TO manager;
6565
```
6666

67-
To complement the configuration you need also have a different `config.yml` file present to read the credentials from.
67+
To complement the configuration you need also have a different `config.yml` file present to read the credentials from.
6868

6969
You need to create a file called `manager-config.yml` in the GMT root directory, which will automatically be picked up by the cron jobs in `./cron/`
7070

@@ -94,7 +94,7 @@ Since a rogue user can always escape from the docker container and infiltrate th
9494

9595
We recommend NOT to have SMTP credentials on the machines and also connect to the database with a very restrcted user.
9696

97-
```
97+
```sql
9898
CREATE USER client WITH PASSWORD 'YOUR_PASSWORD';
9999
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM client;
100100

content/en/docs/cluster/user-management.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ weight: 1005
66
---
77

88
In the FOSS version of GMT only two base users are configured and every action can be executed with them:
9+
910
- USER 1 - The default user
1011
- USER 0 - The GMT system user running control workloads and sending e-mails
1112

@@ -29,11 +30,12 @@ Here is an example cURL request:
2930
-H "X-Authentication: ${API_TOKEN}"
3031
```
3132

32-
**Important:** If no *X-Authentication* header is supplied the API will still authenticate *USER 1* by default.
33+
**Important:** If no *X-Authentication* header is supplied the API will still authenticate *USER 1* by default.
3334

3435
## Features of User Management
3536

3637
For complex usage cases GMT comes with a user management system that allows:
38+
3739
- Restricting certain routes to view content (GET)
3840
- Restricting certain routes for submission of measurements, CI runs, Hog Data etc. (POST)
3941
- Allowing longer / shorter data retention times for certain users
@@ -47,4 +49,4 @@ For complex usage cases GMT comes with a user management system that allows:
4749
Please note that the user management system is bundled with GMT but managed and fully documented as part of the [Enterprise](https://www.green-coding.io/products/green-metrics-tool/) package.
4850
Furthermore many features like needed maintenance jobs / cron jobs and ACL generators are only shipped with the [Enterprise](https://www.green-coding.io/products/green-metrics-tool/) version.
4951

50-
We believe that user management is only needed in bigger corporate settings and thus we encourage you to support this project by considering upgrading to a [paid version](https://www.green-coding.io/products/green-metrics-tool) which includes the User Management either included in the SaaS version or the Enterprise version.
52+
We believe that user management is only needed in bigger corporate settings and thus we encourage you to support this project by considering upgrading to a [paid version](https://www.green-coding.io/products/green-metrics-tool) which includes the User Management either included in the SaaS version or the Enterprise version.

content/en/docs/declarations/export-formats.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ All data is exposed through API endpoints documented for local installs under [h
2020
or if you use the hosted service under [https://api.green-coding.io](https://api.green-coding.io).
2121

2222
By issueing *GET* queries to the relevant endpoints all data can be exported as *JSON* format.
23-

0 commit comments

Comments
 (0)