Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating readme formatting #31

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This is a fork of https://github.com/o19s/elasticsearch-learning-to-rank to work

The OpenSearch Learning to Rank plugin uses machine learning to improve search relevance ranking. The original Elasticsearch LTR plugin powers search at places like Wikimedia Foundation and Snagajob.


# Installing

To install, you'd run a command like this but replacing with the appropriate prebuilt version zip:
Expand All @@ -20,7 +19,6 @@ To install, you'd run a command like this but replacing with the appropriate pre
| 2.5.0 | `bin/opensearch-plugin install https://github.com/gsingers/opensearch-learning-to-rank-base/releases/download/release-v2.1.0/ltr-plugin-v2.1.0.zip` |
| 2.11.1 | `bin/opensearch-plugin install https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases/download/release-v2.11.1/ltr-plugin-v2.11.1.zip` |


(It's expected you'll confirm some security exceptions, you can pass `-b` to `opensearch-plugin` to automatically install)

If you already are running OpenSearch, don't forget to restart!
Expand All @@ -31,28 +29,27 @@ Releases can be found at https://github.com/opensearch-project/opensearch-learni

## Releasing/Packaging


Releases are done through Github Workflows (see `.github/workflows` in the root directory) on an as needed basis. If you do `./gradlew build` as per above under building,
Releases are done through GitHub Workflows (see `.github/workflows` in the root directory) on an as needed basis. If you do `./gradlew build` as per above under building,
it will build all the artifacts that are in the release.

# Development

To build, you need to disable the Java security manager

./gradlew -Dtests.security.manager=false clean build
```
./gradlew -Dtests.security.manager=false clean build
```

# Upgrading the OpenSearch Versions

1. Edit `gradle.properties` to have the appropriate versions (it's often easiest to go download the latest tarball from OpenSearch and simply check the versions that ship) and to increment the version of this plugin
2. Build and test as above
3. Update this README with the version info in the table above
4. Upgrade the Docker file versions in the `docker` directory
4. Test the docker image, per below.
5. Test the docker image, per below.

## Development Notes



# Docker

A custom image of [OpenSearch](https://hub.docker.com/r/opensearchproject/opensearch) with the [OpenSearch Learning to Rank plugin](https://github.com/opensearch-project/opensearch-learning-to-rank-base) installed.
Expand All @@ -63,42 +60,48 @@ See the [Elasticsearch Learning to Rank](https://elasticsearch-learning-to-rank.

## Building

Building the docker image is triggered via the Github Actions workflows automatically (for releases) or via the commands below.
Building the docker image is triggered via the GitHub Actions workflows automatically (for releases) or via the commands below.

Note, we are use Docker ARGs to pass through variables via the --build-arg. All args have defaults
Note, we are use Docker ARGs to pass through variables via the `--build-arg`. All args have defaults

### Using local artifacts

```
docker build -f docker/local.Dockerfile .
```

### Using official releases, built locally

#### Using defaults

```
docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME .
```

#### From Versions

```
docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME --build-arg opensearch_version=2.2.1 --build-arg ltrversion=2.0.0 .

```

#### From a URL

```
docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME --build-arg plugin="https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases/download/release-test-release/ltr-plugin-test-release.zip" .

```

## Running the docker image

See the OpenSearch docs for official instructions, but this should work:

docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" YOUR/IMAGE_NAME:latest

```
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" YOUR/IMAGE_NAME:latest
```

## Publishing the Docker Image

To publish the Docker image to Docker Hub, you need to kick off the Docker action workflow:

gh workflow run .github/workflows/docker.yml



```
gh workflow run .github/workflows/docker.yml
```
Loading