Skip to content

Commit

Permalink
[WIP] Developer guide updates (opensearch-project#595)
Browse files Browse the repository at this point in the history
* Add detail on how to install Java.

Signed-off-by: dblock <dblock@amazon.com>

* There's no password requirement for the instance.

Signed-off-by: dblock <dblock@amazon.com>

* Explain how to listen on an external IP.

Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock authored Apr 28, 2021
1 parent eacd732 commit d09249c
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ So you want to contribute code to OpenSearch? Excellent! We're glad you're here.

- [Getting Started](#getting-started)
- [Git Clone OpenSearch Repo](#git-clone-opensearch-repo)
- [Prerequisites](#prerequisites)
- [Install Prerequisites](#install-prerequisites)
- [Run Tests](#run-tests)
- [Run OpenSearch](#run-opensearch)
- [Use an Editor](#use-an-editor)
Expand Down Expand Up @@ -33,14 +33,23 @@ So you want to contribute code to OpenSearch? Excellent! We're glad you're here.

### Git Clone OpenSearch Repo

Fork [opensearch-project/OpenSearch](https://github.com/opensearch-project/OpenSearch) and clone locally, e.g. `git clone https://github.com/[username]/OpenSearch.git`.
Fork [opensearch-project/OpenSearch](https://github.com/opensearch-project/OpenSearch) and clone locally, e.g. `git clone https://github.com/[your username]/OpenSearch.git`.

### Prerequisites
### Install Prerequisites

#### JDK 14

OpenSearch builds using Java 14 at a minimum. This means you must have a JDK 14 installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK 14 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-14`.

One easy way to get Java 14 on *nix is to use [sdkman](https://sdkman.io/).

```bash
curl -s "https://get.sdkman.io" | bash
source ~/.sdkman/bin/sdkman-init.sh
sdk install java 14.0.2-open
sdk use java 14.0.2-open
```

By default, tests use the same runtime as `JAVA_HOME`. However, since OpenSearch supports JDK 8, the build supports compiling with JDK 14 and testing on a different version of JDK runtime. To do this, set `RUNTIME_JAVA_HOME` pointing to the Java home of another JDK installation, e.g. `RUNTIME_JAVA_HOME=/usr/lib/jvm/jdk-8`.

To run the full suite of tests you will also need `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME`, `JAVA11_HOME`, and `JAVA12_HOME`.
Expand Down Expand Up @@ -97,8 +106,8 @@ That will build OpenSearch and start it, writing its log above Gradle's status m

It's typically easier to wait until the console stops scrolling, and then run `curl` in another window to check if OpenSearch instance is running.

```
curl -u opensearch:password localhost:9200
```bash
curl localhost:9200

{
"name" : "runTask-0",
Expand All @@ -117,6 +126,12 @@ curl -u opensearch:password localhost:9200
}
```

Use `-Dtests.opensearch.` to pass additional settings to the running instance. For example, to enable OpenSearch to listen on an external IP address pass `-Dtests.opensearch.http.host`. Make sure your firewall or security policy allows external connections for this to work.

```bash
./gradlew run -Dtests.opensearch.http.host=0.0.0.0
```

## Use an Editor

### IntelliJ IDEA
Expand Down Expand Up @@ -230,7 +245,7 @@ differ and infer what is the problem.

The `paddedCell()` option is disabled for normal operation in order to detect any misbehaviour. You can enable the option from the command line by running Gradle with `-Dspotless.paddedcell`.

> **NOTE:** If you have imported the project into IntelliJ IDEA the project will be automatically configured to add the correct license header to new source files based on the source location.
> Note: if you have imported the project into IntelliJ IDEA the project will be automatically configured to add the correct license header to new source files based on the source location.
## Gradle Build

Expand Down

0 comments on commit d09249c

Please sign in to comment.