Skip to content

Commit ff6b77a

Browse files
committed
Add additional note on vm.max_map_count settings
1 parent dab89c3 commit ff6b77a

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ to address it, please assign the issue to yourself, so that others know that you
1010

1111
## Sign the Contributor License Agreement
1212

13-
We do ask that you sign the [Contiributor License Agreement](https://www.elastic.co/contributor-agreement)
13+
We do ask that you sign the [Contiributor License Agreement](https://www.elastic.co/contributor-agreement)
1414
before we can accept pull requests from you.
1515

1616
## Development
@@ -23,21 +23,24 @@ The project makes use of the following, which should be installed
2323

2424
- [**Docker**](https://www.docker.com/)
2525

26-
Docker is used to start instances of Elasticsearch by using
26+
Docker is used to start instances of Elasticsearch by using
2727
[Elastic's Elasticsearch docker images](https://container-library.elastic.co/).
2828
For Windows, use [Docker with WSL 2 backend](https://docs.docker.com/docker-for-windows/wsl/).
29-
29+
3030
- [**Cargo make**](https://sagiegurari.github.io/cargo-make/)
3131

32-
Cargo make is used to define and configure a set of tasks, and run them as a flow. This helps with performing actions
32+
Cargo make is used to define and configure a set of tasks, and run them as a flow. This helps with performing actions
3333
such as starting an Elasticsearch instance for integration tests
34-
34+
3535
Cargo make can be installed with
36-
36+
3737
```sh
3838
cargo install --force cargo-make
3939
```
40-
40+
41+
42+
If you are running the tests on Linux, increase the `vm.max_map_count` as described [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html).
43+
4144
### Cargo make
4245

4346
Cargo make is used to define and configure a set of tasks, and run them as a flow. To see all of the Elasticsearch
@@ -64,7 +67,7 @@ The `Elasticsearch` category of steps are specifically defined for this project
6467

6568
- Run Elasticsearch package tests
6669

67-
Optionally pass
70+
Optionally pass
6871

6972
- `STACK_VERSION`: Elasticsearch version like `7.9.0` or can be
7073
a snapshot release like `7.x-SNAPSHOT`
@@ -75,12 +78,12 @@ The `Elasticsearch` category of steps are specifically defined for this project
7578

7679
- Run YAML tests
7780

78-
Optionally pass
81+
Optionally pass
7982

8083
- `STACK_VERSION`: Elasticsearch version like `7.9.0` or can be
8184
a snapshot release like `7.x-SNAPSHOT`
8285
- `TEST_SUITE`: Elasticsearch distribution of `free` or `platinum`
83-
86+
8487
```sh
8588
cargo make test-yaml --env STACK_VERSION=7.9.0 --env TEST_SUITE=free
8689
```
@@ -96,9 +99,9 @@ the root client, `Elasticsearch`, or on one of the _namespaced clients_, such as
9699
are based on the grouping of APIs within the [Elasticsearch](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec) and [X-Pack](https://github.com/elastic/elasticsearch/tree/master/x-pack/plugin/src/test/resources/rest-api-spec/api) REST API specs from which much of the client is generated.
97100
All API functions are `async` only, and can be `await`ed.
98101

99-
- #### `api_generator`
102+
- #### `api_generator`
100103

101-
A small executable that downloads REST API specs from GitHub and generates much of the client package from the specs.
104+
A small executable that downloads REST API specs from GitHub and generates much of the client package from the specs.
102105
The minimum REST API spec version compatible with the generator is `v7.4.0`.
103106

104107
The `api_generator` package makes heavy use of the [`syn`](https://docs.rs/syn/1.0.5/syn/) and [`quote`](https://docs.rs/quote/1.0.2/quote/) crates to generate Rust code from the REST API specs.
@@ -110,11 +113,11 @@ can be `to_string()`'ed and written to disk, and this is used to create much of
110113

111114
A small executable that downloads YAML tests from GitHub and generates client tests from the YAML tests. The
112115
version of YAML tests to download are determined from the commit hash of a running Elasticsearch instance.
113-
116+
114117
The `yaml_test_runner` package can be run with `cargo make test-yaml` to run the generated client tests,
115118
passing environment variables `TEST_SUITE` and `STACK_VERSION` to control the distribution and version,
116119
respectively.
117-
120+
118121
### Design principles
119122

120123
1. Generate as much of the client as feasible from the REST API specs
@@ -124,8 +127,8 @@ can be `to_string()`'ed and written to disk, and this is used to create much of
124127
- accepted HTTP methods e.g. `GET`, `POST`
125128
- the URL query string parameters
126129
- whether the API accepts a body
127-
128-
2. Prefer generation methods that produce ASTs and token streams over strings.
130+
131+
2. Prefer generation methods that produce ASTs and token streams over strings.
129132
The `quote` and `syn` crates help
130133

131134
3. Get it working, then refine/refactor
@@ -134,14 +137,14 @@ The `quote` and `syn` crates help
134137
- Design of the API is conducive to ease of use
135138
- Asynchronous only
136139
- Control API invariants through arguments on API function. For example
137-
140+
138141
```no_run
139142
client.delete_script(DeleteScriptParts::Id("script_id"))
140143
.send()
141144
.await?;
142145
```
143-
144-
An id must always be provided for a delete script API call, so the `delete_script()` function
146+
147+
An id must always be provided for a delete script API call, so the `delete_script()` function
145148
must accept it as a value.
146149
147150
### Coding style guide
@@ -172,7 +175,7 @@ cargo make clippy
172175

173176
### Running MSVC debugger in VS Code
174177

175-
From [Bryce Van Dyk's blog post](https://www.brycevandyk.com/debug-rust-on-windows-with-visual-studio-code-and-the-msvc-debugger/),
178+
From [Bryce Van Dyk's blog post](https://www.brycevandyk.com/debug-rust-on-windows-with-visual-studio-code-and-the-msvc-debugger/),
176179
if wishing to use the MSVC debugger with Rust in VS code, which may be preferred on Windows
177180

178181
1. Install [C/C++ VS Code extensions](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
@@ -182,7 +185,7 @@ if wishing to use the MSVC debugger with Rust in VS code, which may be preferred
182185
```json
183186
{
184187
"version": "0.2.0",
185-
"configurations": [
188+
"configurations": [
186189
{
187190
"name": "Debug api_generator",
188191
"type": "cppvsdbg",
@@ -197,5 +200,5 @@ if wishing to use the MSVC debugger with Rust in VS code, which may be preferred
197200
]
198201
}
199202
```
200-
203+
201204
3. Add `"debug.allowBreakpointsEverywhere": true` to VS code settings.json

0 commit comments

Comments
 (0)