### YAML Test File Structure Example Source: https://github.com/opensearch-project/opensearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/test/README.md Illustrates the structure of a YAML test file, including optional setup and teardown sections, followed by one or more test sections. ```yaml setup: - do: .... - do: .... --- teardown: - do: .... --- "First test": - do: ... - match: ... --- "Second test": - do: ... - match: ... ``` -------------------------------- ### Install Benchmark Plugin Source: https://github.com/opensearch-project/opensearch/blob/main/client/benchmark/README.md Install the built plugin on the target OpenSearch host. ```bash bin/opensearch-plugin install file:///full/path/to/client-benchmark-noop-api-plugin.zip ``` -------------------------------- ### Run OpenSearch Source: https://github.com/opensearch-project/opensearch/blob/main/DEVELOPER_GUIDE.md Starts a local OpenSearch instance using Gradle. This is the basic command to get OpenSearch running. ```bash ./gradlew run ``` -------------------------------- ### Interactive Program Notice Example Source: https://github.com/opensearch-project/opensearch/blob/main/plugins/discovery-azure-classic/licenses/jaxb-LICENSE.txt This is an example of a notice that an interactive program should display upon startup, as per the GPL. ```text Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Install OpenSearch Security Plugin Source: https://github.com/opensearch-project/opensearch/blob/main/plugins/arrow-flight-rpc/docs/security-integration.md Commands to install the OpenSearch Security plugin and set up its demo configuration. ```bash bin/opensearch-plugin install opensearch-security plugins/opensearch-security/tools/install_demo_configuration.sh ``` -------------------------------- ### Install git-secrets Source: https://github.com/opensearch-project/opensearch/blob/main/DEVELOPER_GUIDE.md Install the git-secrets tool by cloning the repository and running the make install command. ```bash git clone https://github.com/awslabs/git-secrets.git cd git-secrets make install ``` -------------------------------- ### Run OpenSearch with Installed Plugins Source: https://github.com/opensearch-project/opensearch/blob/main/DEVELOPER_GUIDE.md Installs and runs OpenSearch with specified plugins. Pass a list of plugin names to the -PinstalledPlugins property. ```bash ./gradlew run -PinstalledPlugins="['plugin1', 'plugin2']" ``` -------------------------------- ### Run OpenSearch with Arrow Flight RPC Plugin (Development) Source: https://github.com/opensearch-project/opensearch/blob/main/plugins/arrow-flight-rpc/README.md Run OpenSearch in development mode with the Arrow Flight RPC plugin installed using Gradle. This command installs the plugin and starts the OpenSearch instance. ```bash ./gradlew run -PinstalledPlugins="['arrow-flight-rpc']" ``` -------------------------------- ### Install vagrant-winrm plugin Source: https://github.com/opensearch-project/opensearch/blob/main/TESTING.md Installs the vagrant-winrm plugin, which is required for testing OpenSearch packaging on Windows. ```bash vagrant plugin install vagrant-winrm ``` -------------------------------- ### Start OpenSearch Cluster Manually Source: https://github.com/opensearch-project/opensearch/blob/main/sandbox/qa/analytics-engine-rest/README.md Manually start an OpenSearch cluster with specified plugins and configurations for testing. Ensure the native library path is correctly set. ```bash ./gradlew publishToMavenLocal -Dsandbox.enabled=true -x test -x javadoc NATIVE_LIB_DIR=$(pwd)/sandbox/libs/dataformat-native/rust/target/release ./gradlew run -Dsandbox.enabled=true \ -PinstalledPlugins="['analytics-engine', 'parquet-data-format', 'analytics-backend-datafusion', 'analytics-backend-lucene', 'dsl-query-executor', 'composite-engine', 'test-ppl-frontend']" \ -Dtests.jvm.argline="-Djava.library.path=$NATIVE_LIB_DIR -Dopensearch.experimental.feature.pluggable.dataformat.enabled=true" \ -x javadoc -x test -x missingJavadoc ``` -------------------------------- ### Set JAVA_HOME for JDK 25+ Source: https://github.com/opensearch-project/opensearch/blob/main/sandbox/qa/analytics-engine-rest/README.md Example of setting the JAVA_HOME environment variable for macOS. Ensure you have JDK 25 or newer installed. ```bash export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home # macOS example ``` -------------------------------- ### Start OpenSearch with Ingestion-FS Plugin Source: https://github.com/opensearch-project/opensearch/blob/main/plugins/ingestion-fs/README.md Command to run OpenSearch with the ingestion-fs plugin installed. This is typically used for local development and testing. ```bash ./gradlew run -PinstalledPlugins="['ingestion-fs']" ``` -------------------------------- ### Build on FreeBSD with Gradle Source: https://github.com/opensearch-project/opensearch/blob/main/release-notes/opensearch.release-notes-1.2.0.md This command is used in the OpenSearch repository context when building plugins. It publishes the build to the local Maven repository. ```bash ./gradlew publishToMavenLocal -Dbuild.snapshot=false ``` -------------------------------- ### Build Client Benchmark Plugin Source: https://github.com/opensearch-project/opensearch/blob/main/client/benchmark/README.md Build the client-benchmark-noop-api-plugin using Gradle. ```bash ./gradlew :client:client-benchmark-noop-api-plugin:assemble ``` -------------------------------- ### Install Generated Fat-JAR Locally with Maven Source: https://github.com/opensearch-project/opensearch/blob/main/DEVELOPER_GUIDE.md Use the Maven install plugin to install the generated fat-JAR into your local Maven repository. This allows it to be referenced as a regular Maven artifact. ```bash mvn install:install-file -Dfile=src/main/resources/opensearch-rest-high-level-client-1.4.0-SNAPSHOT.jar -DgroupId=org.opensearch.client -DartifactId=opensearch-rest-high-level-client -Dversion=1.4.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true ``` -------------------------------- ### Bulk Indexing Benchmark Invocation Source: https://github.com/opensearch-project/opensearch/blob/main/client/benchmark/README.md Example command to run a bulk indexing benchmark. Download and prepare benchmark data before execution. Parameters include client type, benchmark type, target host, data file path, index name, document count, and bulk size. ```bash wget http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents-2.json.bz2 bzip2 -d documents-2.json.bz2 mv documents-2.json client/benchmark/build gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.json geonames 8647880 5000' ``` -------------------------------- ### Install vagrant-cachier plugin Source: https://github.com/opensearch-project/opensearch/blob/main/TESTING.md Installs the vagrant-cachier plugin to potentially improve performance. Note that this plugin is unmaintained as of 2021. ```bash vagrant plugin install vagrant-cachier ``` -------------------------------- ### Run OpenSearch from Source Source: https://github.com/opensearch-project/opensearch/blob/main/AGENTS.md Commands to run OpenSearch from source, including options for multi-node clusters and installing plugins. ```bash ./gradlew run # run OpenSearch from source ./gradlew run -PnumNodes=3 # run a multi-node cluster ./gradlew run -PinstalledPlugins='["repository-azure"]' # run with plugins installed ``` -------------------------------- ### Run Benchmark with Arguments Source: https://github.com/opensearch-project/opensearch/blob/main/client/benchmark/README.md Execute the benchmark using Gradle, passing parameters via the --args flag. Ensure the leading space within the single quotes is preserved. ```bash ./gradlew -p client/benchmark run --args ' params go here' ```