From 5bf2ec4bbf06d702e9f3bbe14e5eb1f9479219f5 Mon Sep 17 00:00:00 2001 From: Ralph Ursprung <39383228+rursprung@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:55:08 +0200 Subject: [PATCH] Add missing no jdk distributions (#4722) (#4884) * 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 * 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 Signed-off-by: Ralph Ursprung (cherry picked from commit dfa1118eee84e2f54a304ba917885f98a571b23c) --- CHANGELOG.md | 1 + distribution/README.md | 12 ++++++++++++ distribution/archives/build.gradle | 9 +++++++++ distribution/packages/build.gradle | 8 ++++++++ settings.gradle | 3 +++ 5 files changed, 33 insertions(+) create mode 100644 distribution/README.md diff --git a/CHANGELOG.md b/CHANGELOG.md index dd7eb02481c1a..ac6e6afe29ccc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Introduce Remote translog feature flag([#4158](https://github.com/opensearch-project/OpenSearch/pull/4158)) - Add groupId value propagation tests for ZIP publication task ([#4848](https://github.com/opensearch-project/OpenSearch/pull/4848)) - Add support for GeoJson Point type in GeoPoint field ([#4597](https://github.com/opensearch-project/OpenSearch/pull/4597)) +- Added missing no-jdk distributions ([#4722](https://github.com/opensearch-project/OpenSearch/pull/4722)) ### Dependencies - Bumps `com.diffplug.spotless` from 6.9.1 to 6.10.0 diff --git a/distribution/README.md b/distribution/README.md new file mode 100644 index 0000000000000..b9e948b625659 --- /dev/null +++ b/distribution/README.md @@ -0,0 +1,12 @@ +# Distributions +This subproject contains the necessary tooling to build the various distributions. +Note that some of this can only be run on the specific architecture and does not support cross-compile. + +The following distributions are being built: +* Archives (`*.zip`, `*.tar`): these form the basis for all other OpenSearch distributions +* Packages (`*.deb`, `*.rpm`): specific package formats for some Linux distributions +* Docker images +* Backwards compatibility tests: used internally for version compatibility testing, not for public consumption + +## With or Without JDK? +For each supported platform there should be both a target bundled with a JDK and a target without a bundled JDK. diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 1376b8d419f6e..587175eef4008 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -137,6 +137,13 @@ distribution_archives { } } + noJdkLinuxArm64Tar { + archiveClassifier = 'no-jdk-linux-arm64' + content { + archiveFiles(modulesFiles('linux-arm64'), 'tar', 'linux', 'arm64', false) + } + } + linuxTar { archiveClassifier = 'linux-x64' content { @@ -151,6 +158,8 @@ distribution_archives { } } + // Should really be `no-jdk-linux-s390x` as it ships without a JDK, however it seems that the build can't handle + // the absence of the `linux-s390x` target. linuxS390xTar { archiveClassifier = 'linux-s390x' content { diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index eb253e4ae16da..3c644dc530af0 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -350,6 +350,10 @@ tasks.register('buildArm64Deb', Deb) { configure(commonDebConfig(true, 'arm64')) } +tasks.register('buildNoJdkArm64Deb', Deb) { + configure(commonDebConfig(false, 'arm64')) +} + tasks.register('buildDeb', Deb) { configure(commonDebConfig(true, 'x64')) } @@ -387,6 +391,10 @@ tasks.register('buildArm64Rpm', Rpm) { configure(commonRpmConfig(true, 'arm64')) } +tasks.register('buildNoJdkArm64Rpm', Rpm) { + configure(commonRpmConfig(false, 'arm64')) +} + tasks.register('buildRpm', Rpm) { configure(commonRpmConfig(true, 'x64')) } diff --git a/settings.gradle b/settings.gradle index 0989df0b249b2..a4e978ad81553 100644 --- a/settings.gradle +++ b/settings.gradle @@ -47,6 +47,7 @@ List projects = [ 'distribution:archives:freebsd-tar', 'distribution:archives:no-jdk-freebsd-tar', 'distribution:archives:linux-arm64-tar', + 'distribution:archives:no-jdk-linux-arm64-tar', 'distribution:archives:linux-s390x-tar', 'distribution:archives:linux-tar', 'distribution:archives:no-jdk-linux-tar', @@ -57,9 +58,11 @@ List projects = [ 'distribution:docker:docker-build-context', 'distribution:docker:docker-export', 'distribution:packages:arm64-deb', + 'distribution:packages:no-jdk-arm64-deb', 'distribution:packages:deb', 'distribution:packages:no-jdk-deb', 'distribution:packages:arm64-rpm', + 'distribution:packages:no-jdk-arm64-rpm', 'distribution:packages:rpm', 'distribution:packages:no-jdk-rpm', 'distribution:bwc:bugfix',