Skip to content

Commit dfa1118

Browse files
authored
Add missing no jdk distributions (opensearch-project#4722)
* add missing no-jdk gradle targets for distributions by convention all supported platforms should also have a gradle target to produce a no-jdk build and that target should be called `no-jdk-[platform]`. this is a first step in the path to publishing the no-jdk distributions as part of the release, as there are use-cases where a specific JDK should be used instead of the packaged one and it's cleaner to use a small distribution which doesn't bring along an unneeded JDK (the JDK greatly increases the resulting distribution since). note that i failed to rename the `linux-s390x` target, it seems that there's too much generic build code out there which tries to stitch together that name and then fails if it doesn't find it. this is part of opensearch-build#99. Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> * add basic README for `:distribution` this is primarily to document the JDK & No JDK setup (to codify it for the future), however the README can be extended in the future to document more information which is currently hidden away only somewhere in the code. Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
1 parent 2310a3d commit dfa1118

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3838
- Add support for GeoJson Point type in GeoPoint field ([#4597](https://github.com/opensearch-project/OpenSearch/pull/4597))
3939
- Add dev guide for dealing with flakey tests ([4868](https://github.com/opensearch-project/OpenSearch/pull/4868))
4040
- Update pull request template ([#4851](https://github.com/opensearch-project/OpenSearch/pull/4851))
41+
- Added missing no-jdk distributions ([#4722](https://github.com/opensearch-project/OpenSearch/pull/4722))
4142

4243
### Dependencies
4344
- Bumps `log4j-core` from 2.18.0 to 2.19.0

distribution/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Distributions
2+
This subproject contains the necessary tooling to build the various distributions.
3+
Note that some of this can only be run on the specific architecture and does not support cross-compile.
4+
5+
The following distributions are being built:
6+
* Archives (`*.zip`, `*.tar`): these form the basis for all other OpenSearch distributions
7+
* Packages (`*.deb`, `*.rpm`): specific package formats for some Linux distributions
8+
* Docker images
9+
* Backwards compatibility tests: used internally for version compatibility testing, not for public consumption
10+
11+
## With or Without JDK?
12+
For each supported platform there should be both a target bundled with a JDK and a target without a bundled JDK.

distribution/archives/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ distribution_archives {
137137
}
138138
}
139139

140+
noJdkLinuxArm64Tar {
141+
archiveClassifier = 'no-jdk-linux-arm64'
142+
content {
143+
archiveFiles(modulesFiles('linux-arm64'), 'tar', 'linux', 'arm64', false)
144+
}
145+
}
146+
140147
linuxTar {
141148
archiveClassifier = 'linux-x64'
142149
content {
@@ -151,6 +158,8 @@ distribution_archives {
151158
}
152159
}
153160

161+
// Should really be `no-jdk-linux-s390x` as it ships without a JDK, however it seems that the build can't handle
162+
// the absence of the `linux-s390x` target.
154163
linuxS390xTar {
155164
archiveClassifier = 'linux-s390x'
156165
content {

distribution/packages/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ tasks.register('buildArm64Deb', Deb) {
350350
configure(commonDebConfig(true, 'arm64'))
351351
}
352352

353+
tasks.register('buildNoJdkArm64Deb', Deb) {
354+
configure(commonDebConfig(false, 'arm64'))
355+
}
356+
353357
tasks.register('buildDeb', Deb) {
354358
configure(commonDebConfig(true, 'x64'))
355359
}
@@ -387,6 +391,10 @@ tasks.register('buildArm64Rpm', Rpm) {
387391
configure(commonRpmConfig(true, 'arm64'))
388392
}
389393

394+
tasks.register('buildNoJdkArm64Rpm', Rpm) {
395+
configure(commonRpmConfig(false, 'arm64'))
396+
}
397+
390398
tasks.register('buildRpm', Rpm) {
391399
configure(commonRpmConfig(true, 'x64'))
392400
}

settings.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ List projects = [
4747
'distribution:archives:freebsd-tar',
4848
'distribution:archives:no-jdk-freebsd-tar',
4949
'distribution:archives:linux-arm64-tar',
50+
'distribution:archives:no-jdk-linux-arm64-tar',
5051
'distribution:archives:linux-s390x-tar',
5152
'distribution:archives:linux-tar',
5253
'distribution:archives:no-jdk-linux-tar',
@@ -57,9 +58,11 @@ List projects = [
5758
'distribution:docker:docker-build-context',
5859
'distribution:docker:docker-export',
5960
'distribution:packages:arm64-deb',
61+
'distribution:packages:no-jdk-arm64-deb',
6062
'distribution:packages:deb',
6163
'distribution:packages:no-jdk-deb',
6264
'distribution:packages:arm64-rpm',
65+
'distribution:packages:no-jdk-arm64-rpm',
6366
'distribution:packages:rpm',
6467
'distribution:packages:no-jdk-rpm',
6568
'distribution:bwc:bugfix',

0 commit comments

Comments
 (0)