1-
21FROM stackable/image/opensearch/security-plugin AS opensearch-security-plugin
2+ FROM stackable/image/opensearch/performance-analyzer AS opensearch-performance-analyzer
33FROM stackable/image/java-devel AS opensearch-builder
44
55ARG PRODUCT
@@ -28,32 +28,56 @@ cd "$(/stackable/patchable --images-repo-root=src checkout opensearch ${PRODUCT}
2828NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
2929# Create snapshot of the source code including custom patches
3030tar -czf /stackable/opensearch-${NEW_VERSION}-src.tar.gz .
31- ./gradlew localDistro
32- ./gradlew cyclonedxBom --warning-mode=summary
33- cp -r build/distribution/local/opensearch-${PRODUCT}-SNAPSHOT /stackable/opensearch
31+ ./gradlew clean localDistro -Dbuild.snapshot=false
32+ ./gradlew cyclonedxBom --warning-mode=summary -Dbuild.snapshot=false
33+ cp -r build/distribution/local/opensearch-${PRODUCT} /stackable/opensearch
3434cp distribution/docker/src/docker/bin/docker-entrypoint.sh /stackable/opensearch/opensearch-docker-entrypoint.sh
35+ # repository-s3 plugin
36+ cd plugins/repository-s3
37+ ../../gradlew clean assemble -Dbuild.snapshot=false
38+ mkdir /stackable/opensearch/plugins/repository-s3
39+ cp build/distributions/repository-s3-${PRODUCT}.zip /stackable/opensearch/plugins/repository-s3/repository-s3-${PRODUCT}.zip
40+ cp -r config/repository-s3 /stackable/opensearch/config/repository-s3
41+ cd /stackable/opensearch/plugins/repository-s3
42+ unzip repository-s3-${PRODUCT}.zip
43+ rm repository-s3-${PRODUCT}.zip
44+ # Fix an error where OpenSearch running in a container is denied access to swap space size
3545sed -i -e 's/OPENSEARCH_DISTRIBUTION_TYPE=tar/OPENSEARCH_DISTRIBUTION_TYPE=docker/' /stackable/opensearch/bin/opensearch-env
3646EOF
3747
48+ WORKDIR /stackable/opensearch-performance-analyzer
49+ COPY \
50+ --chown=${STACKABLE_USER_UID}:0 \
51+ --from=opensearch-performance-analyzer \
52+ /stackable/src/opensearch/performance-analyzer/patchable-work/worktree/${OPENSEARCH_PERFORMANCE_ANALYZER}/build/distributions/opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}.zip \
53+ opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}.zip
54+ COPY \
55+ --chown=${STACKABLE_USER_UID}:0 \
56+ --from=opensearch-performance-analyzer \
57+ /stackable/src/opensearch/performance-analyzer/patchable-work/worktree/${OPENSEARCH_PERFORMANCE_ANALYZER}/config \
58+ /stackable/opensearch/config/opensearch-performance-analyzer
59+
60+ RUN <<EOF
61+ unzip opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}.zip
62+ rm opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}.zip
63+ EOF
64+
3865WORKDIR /stackable/opensearch-security
3966COPY \
4067 --chown=${STACKABLE_USER_UID}:0 \
4168 --from=opensearch-security-plugin \
42- /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/distributions/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT .zip \
43- /stackable/ opensearch-security/opensearch-security- ${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT .zip
69+ /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/distributions/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}.zip \
70+ opensearch-security- ${OPENSEARCH_SECURITY_PLUGIN}.zip
4471
4572RUN <<EOF
46- unzip opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT .zip
47- rm -r opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT .zip
73+ unzip opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}.zip
74+ rm opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}.zip
4875mv config /stackable/opensearch/config/opensearch-security
4976EOF
5077
5178WORKDIR /stackable/opensearch
5279
5380RUN <<EOF
54- echo y | bin/opensearch-plugin install repository-s3
55- echo y | bin/opensearch-plugin install org.opensearch.plugin:performance-analyzer:${OPENSEARCH_PERFORMANCE_ANALYZER}
56-
5781# The JDK from jdk-base is used instead.
5882rm -r jdk
5983
@@ -73,6 +97,7 @@ FROM stackable/image/jdk-base
7397ARG PRODUCT
7498ARG RELEASE
7599ARG OPENSEARCH_SECURITY_PLUGIN
100+ ARG OPENSEARCH_PERFORMANCE_ANALYZER
76101ARG STACKABLE_USER_UID
77102
78103ARG NAME="OpenSearch"
@@ -102,6 +127,11 @@ COPY \
102127 --from=opensearch-builder \
103128 /stackable/opensearch-security \
104129 /stackable/opensearch-${PRODUCT}-stackable${RELEASE}/plugins/opensearch-security
130+ COPY \
131+ --chown=${STACKABLE_USER_UID}:0 \
132+ --from=opensearch-builder \
133+ /stackable/opensearch-performance-analyzer \
134+ /stackable/opensearch-${PRODUCT}-stackable${RELEASE}/plugins/opensearch-performance-analyzer
105135COPY \
106136 --chown=${STACKABLE_USER_UID}:0 \
107137 --from=opensearch-builder \
@@ -112,6 +142,11 @@ COPY \
112142 --from=opensearch-security-plugin \
113143 /stackable/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-stackable${RELEASE}-src.tar.gz \
114144 /stackable
145+ COPY \
146+ --chown=${STACKABLE_USER_UID}:0 \
147+ --from=opensearch-performance-analyzer \
148+ /stackable/opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}-stackable${RELEASE}-src.tar.gz \
149+ /stackable
115150COPY \
116151 --chown=${STACKABLE_USER_UID}:0 \
117152 --from=opensearch-builder \
@@ -122,6 +157,11 @@ COPY \
122157 --from=opensearch-security-plugin \
123158 /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/reports/bom.json \
124159 /stackable/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-stackable${RELEASE}.cdx.json
160+ COPY \
161+ --chown=${STACKABLE_USER_UID}:0 \
162+ --from=opensearch-performance-analyzer \
163+ /stackable/src/opensearch/performance-analyzer/patchable-work/worktree/${OPENSEARCH_PERFORMANCE_ANALYZER}/build/reports/bom.json \
164+ /stackable/opensearch-performance-analyzer-${OPENSEARCH_PERFORMANCE_ANALYZER}-stackable${RELEASE}.cdx.json
125165RUN <<EOF
126166microdnf update
127167microdnf clean all
0 commit comments