Skip to content

Commit 841b3a0

Browse files
committed
build plugins from source and stop building snapshots
1 parent 8248558 commit 841b3a0

File tree

10 files changed

+138
-17
lines changed

10 files changed

+138
-17
lines changed

conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
opensearch_security_plugin = importlib.import_module(
3434
"opensearch.security-plugin.versions"
3535
)
36+
opensearch_performance_analyzer = importlib.import_module(
37+
"opensearch.performance-analyzer.versions"
38+
)
3639
spark_k8s = importlib.import_module("spark-k8s.versions")
3740
stackable_base = importlib.import_module("stackable-base.versions")
3841
stackable_devel = importlib.import_module("stackable-devel.versions")
@@ -75,6 +78,10 @@
7578
"name": "opensearch/security-plugin",
7679
"versions": opensearch_security_plugin.versions,
7780
},
81+
{
82+
"name": "opensearch/performance-analyzer",
83+
"versions": opensearch_performance_analyzer.versions,
84+
},
7885
{"name": "spark-k8s", "versions": spark_k8s.versions},
7986
{"name": "stackable-base", "versions": stackable_base.versions},
8087
{"name": "stackable-devel", "versions": stackable_devel.versions},

opensearch/Dockerfile

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
FROM stackable/image/opensearch/security-plugin AS opensearch-security-plugin
2+
FROM stackable/image/opensearch/performance-analyzer AS opensearch-performance-analyzer
33
FROM stackable/image/java-devel AS opensearch-builder
44

55
ARG PRODUCT
@@ -28,32 +28,56 @@ cd "$(/stackable/patchable --images-repo-root=src checkout opensearch ${PRODUCT}
2828
NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
2929
# Create snapshot of the source code including custom patches
3030
tar -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
3434
cp 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
3545
sed -i -e 's/OPENSEARCH_DISTRIBUTION_TYPE=tar/OPENSEARCH_DISTRIBUTION_TYPE=docker/' /stackable/opensearch/bin/opensearch-env
3646
EOF
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+
3865
WORKDIR /stackable/opensearch-security
3966
COPY \
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

4572
RUN <<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
4875
mv config /stackable/opensearch/config/opensearch-security
4976
EOF
5077

5178
WORKDIR /stackable/opensearch
5279

5380
RUN <<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.
5882
rm -r jdk
5983

@@ -73,6 +97,7 @@ FROM stackable/image/jdk-base
7397
ARG PRODUCT
7498
ARG RELEASE
7599
ARG OPENSEARCH_SECURITY_PLUGIN
100+
ARG OPENSEARCH_PERFORMANCE_ANALYZER
76101
ARG STACKABLE_USER_UID
77102

78103
ARG 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
105135
COPY \
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
115150
COPY \
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
125165
RUN <<EOF
126166
microdnf update
127167
microdnf clean all
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM stackable/image/java-devel AS performance-analyzer-builder
2+
3+
ARG PRODUCT
4+
ARG RELEASE
5+
ARG STACKABLE_USER_UID
6+
7+
USER ${STACKABLE_USER_UID}
8+
WORKDIR /stackable
9+
10+
COPY --chown=${STACKABLE_USER_UID}:0 opensearch/performance-analyzer/stackable/patches/patchable.toml /stackable/src/opensearch/performance-analyzer/stackable/patches/patchable.toml
11+
COPY --chown=${STACKABLE_USER_UID}:0 opensearch/performance-analyzer/stackable/patches/${PRODUCT} /stackable/src/opensearch/performance-analyzer/stackable/patches/${PRODUCT}
12+
13+
RUN <<EOF
14+
cd "$(/stackable/patchable --images-repo-root=src checkout opensearch/performance-analyzer ${PRODUCT})"
15+
16+
# Create snapshot of the source code including custom patches
17+
tar -czf /stackable/opensearch-performance-analyzer-${PRODUCT}-stackable${RELEASE}-src.tar.gz .
18+
./gradlew clean build -Dbuild.snapshot=false
19+
./gradlew cyclonedxBom --warning-mode=summary -Dbuild.snapshot=false
20+
EOF
21+
22+
RUN <<EOF
23+
# Change the group permissions already in the builder image to reduce the size of the final image.
24+
# see https://github.com/stackabletech/docker-images/issues/961
25+
chmod -R g=u "${HOME}"
26+
EOF
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From fd817e28e630f5fdd66e8fe5ba4dc4d2fb846e86 Mon Sep 17 00:00:00 2001
2+
From: Benedikt Labrenz <[email protected]>
3+
Date: Thu, 24 Jul 2025 14:39:31 +0200
4+
Subject: Add-CycloneDX-plugin
5+
6+
---
7+
build.gradle | 12 +++++++++++-
8+
1 file changed, 11 insertions(+), 1 deletion(-)
9+
10+
diff --git a/build.gradle b/build.gradle
11+
index cb784cd..91a6a1e 100644
12+
--- a/build.gradle
13+
+++ b/build.gradle
14+
@@ -54,7 +54,7 @@ plugins {
15+
id 'checkstyle'
16+
id 'org.ajoberstar.grgit' version '5.0.0'
17+
id 'org.gradle.test-retry' version '1.6.1'
18+
-
19+
+ id "org.cyclonedx.bom" version "2.3.1"
20+
}
21+
22+
checkstyle {
23+
@@ -121,6 +121,16 @@ apply plugin: 'opensearch.java-agent'
24+
licenseFile = rootProject.file('LICENSE.txt')
25+
noticeFile = rootProject.file('NOTICE.txt')
26+
27+
+cyclonedxBom {
28+
+ includeConfigs = ["runtimeClasspath"]
29+
+ includeLicenseText = false
30+
+ skipConfigs = ["compileClasspath", "testCompileClasspath"]
31+
+ projectType = "application"
32+
+ schemaVersion = "1.6"
33+
+ outputFormat = "json"
34+
+ componentVersion = opensearch_build
35+
+}
36+
+
37+
spotless {
38+
java {
39+
licenseHeaderFile(file('license-header'))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base = "269779067cf2b9cc37de26ce092dc5d7a73d1383"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
upstream = "https://github.com/opensearch-project/performance-analyzer"
2+
default-mirror = "https://github.com/stackabletech/opensearch-performance-analyzer"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
versions = [
2+
{
3+
"product": "3.1.0.0",
4+
"java-devel": "21",
5+
},
6+
]

opensearch/security-plugin/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ cd "$(/stackable/patchable --images-repo-root=src checkout opensearch/security-p
1515

1616
# Create snapshot of the source code including custom patches
1717
tar -czf /stackable/opensearch-security-${PRODUCT}-stackable${RELEASE}-src.tar.gz .
18-
./gradlew clean assemble
19-
./gradlew cyclonedxBom --warning-mode=summary
18+
./gradlew clean assemble -Dbuild.snapshot=false
19+
./gradlew cyclonedxBom --warning-mode=summary -Dbuild.snapshot=false
2020
EOF
2121

2222
RUN <<EOF
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
versions = [
22
{
33
"product": "3.1.0.0",
4-
"java-devel": "24",
4+
"java-devel": "21",
55
},
66
]

opensearch/versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
versions = [
22
{
33
"product": "3.1.0",
4-
"java-devel": "24",
5-
"jdk-base": "24",
4+
"java-devel": "21",
5+
"jdk-base": "21",
66
"opensearch/security-plugin": "3.1.0.0",
7-
"opensearch-performance-analyzer": "3.1.0.0",
7+
"opensearch/performance-analyzer": "3.1.0.0",
88
},
99
]

0 commit comments

Comments
 (0)