I am trying to build OpenSearch including all plugins from the scratch but I’am struggling. I like to produce the release linux tar gz as well as the docker image including all plugins.
Is there a tutorial about this? Or how do you build the release on CI?
I came across issues with naming conventions, versioning conventions and missing git tags (see a-c below).
What i tried so far:
OS_VERSION="1.0.0"
OS_QUALIFIER="rc1"
#Save this as buildall.sh
#In the same folder like the script there shoudl be a git checkout of OpenSearch and opensearch-plugins repos
#Build OpenSearch and deploy atrifacts to local maven repo
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR/OpenSearch"
git fetch && git pull
git checkout "$OS_VERSION-$OS_QUALIFIER"
./gradlew clean :distribution:archives:linux-tar:assemble publishToMavenLocal -Dbuild.version_qualifier="$OS_QUALIFIER" -Dbuild.snapshot=false
#Try to iterste over the plugins and build an install them
cd "$SCRIPT_DIR/opensearch-plugins/plugins"
# a)
# Is it 1.0.0.0-rc1 (that is 4 digits)
# or is it 1.0.0-rc1 (that is 3 digits)
# Why have 4 digits here and not 3 like with OS itself
# b)
# Only the job-scheduler plugin gets built and installed properly
# All other plugins are failing because of different naming conventions (paths, versioning)
# or because there is no rc1 in github (maybe the tags were not pushed properly)
# c)
# Its hard to differentiate between dashboard and non-dashboard plugins because there seems to be no naming convention
#meta exec "git fetch && git pull && git checkout v$OS_VERSION.0-$OS_QUALIFIER" #this fails because of missing tags
meta exec "./gradlew clean assemble -Dopensearch.version="$OS_VERSION-$OS_QUALIFIER" -Dbuild.snapshot=false \
&& $SCRIPT_DIR/OpenSearch/distribution/archives/linux-tar/build/install/opensearch-$OS_VERSION-$OS_QUALIFIER/bin/opensearch-plugin install -b file://\$(pwd)/build/distributions/opensearch-\$(basename \$(pwd))-$OS_VERSION.0-$OS_QUALIFIER.zip"
Why is the naming convention for OpenSearch vs Dashboards plugins not distinct?
The team is actively working on standardizing the plugin naming conventions and how the artifacts would look like.
Here is the Github issue: Standardize plugin artifact names · Issue #47 · opensearch-project/opensearch-plugins · GitHub
Feel free to drop comments if you prefer a different naming convention.
Right now it’s a manual process to build the tarball. We basically check out each repo, run whatever build command is specified in the README, and then copy the artifacts into a temporary location.
To build the tarball, we unpack the OpenSearch tarball and run opensearch-plugin install file://path/to/zip for each plugin, then create a new tarball that rolls up the OpenSearch + installed plugins filesystem.
We’re working on automating this stuff, so you should see scripts start to appear in the opensearch-build repo over the next few weeks.