Remove the oss string from OpenSearch distributions (#575)

This commit removes the 'oss' string which was a remnant of the predecessor distribution flavors. As OpenSearch has no flavors for distributions, we are removing this tag from all the distribution names.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-04-20 09:27:40 -07:00 committed by GitHub
parent 5474e8d094
commit 163a51fc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 195 additions and 210 deletions

View File

@ -29,9 +29,9 @@ To create a platform-specific build, use the
following depending on your operating system: following depending on your operating system:
----------------------------- -----------------------------
./gradlew :distribution:archives:oss-linux-tar:assemble ./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:oss-darwin-tar:assemble ./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:oss-windows-zip:assemble ./gradlew :distribution:archives:windows-zip:assemble
----------------------------- -----------------------------
=== Running OpenSearch from a checkout === Running OpenSearch from a checkout
@ -72,7 +72,7 @@ In order to start with a different distribution use the `-Drun.distribution` arg
To for example start the open source distribution: To for example start the open source distribution:
------------------------------------- -------------------------------------
./gradlew run -Drun.distribution=oss ./gradlew run
------------------------------------- -------------------------------------
==== Other useful arguments ==== Other useful arguments
@ -489,8 +489,7 @@ that'd consume a ton of ram.
=== Iterating on packaging tests === Iterating on packaging tests
Because our packaging tests are capable of testing many combinations of OS Because our packaging tests are capable of testing many combinations of OS
(e.g., Windows, Linux, etc.), package type (e.g., zip file, RPM, etc.), (e.g., Windows, Linux, etc.), package type (e.g., zip file, RPM, etc.) and so forth, it's
OpenSearch distribution type (e.g. OSS), and so forth, it's
faster to develop against smaller subsets of the tests. For example, to run faster to develop against smaller subsets of the tests. For example, to run
tests for the default archive distribution on Fedora 28: tests for the default archive distribution on Fedora 28:

View File

@ -360,7 +360,7 @@ allprojects {
} }
File licenseHeaderFile File licenseHeaderFile
licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/oss-license-header.txt') licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/license-header.txt')
String lineSeparator = Os.isFamily(Os.FAMILY_WINDOWS) ? '\\\\r\\\\n' : '\\\\n' String lineSeparator = Os.isFamily(Os.FAMILY_WINDOWS) ? '\\\\r\\\\n' : '\\\\n'
String licenseHeader = licenseHeaderFile.getText('UTF-8').replace(System.lineSeparator(), lineSeparator) String licenseHeader = licenseHeaderFile.getText('UTF-8').replace(System.lineSeparator(), lineSeparator)

View File

@ -182,10 +182,10 @@ if (project != rootProject) {
dependencies { dependencies {
reaper project('reaper') reaper project('reaper')
distribution project(':distribution:archives:oss-windows-zip') distribution project(':distribution:archives:windows-zip')
distribution project(':distribution:archives:oss-darwin-tar') distribution project(':distribution:archives:darwin-tar')
distribution project(':distribution:archives:oss-linux-tar') distribution project(':distribution:archives:linux-tar')
distribution project(':distribution:archives:oss-linux-aarch64-tar') distribution project(':distribution:archives:linux-aarch64-tar')
integTestRuntimeOnly(project(":libs:opensearch-core")) integTestRuntimeOnly(project(":libs:opensearch-core"))
} }

View File

@ -119,7 +119,7 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
then: then:
result.tasks.size() == 3 result.tasks.size() == 3
result.output.count("Unpacking opensearch-oss-${version}-linux-x86_64.tar.gz " + result.output.count("Unpacking opensearch-${version}-linux-x86_64.tar.gz " +
"using SymbolicLinkPreservingUntarTransform.") == 1 "using SymbolicLinkPreservingUntarTransform.") == 1
} }

View File

@ -65,7 +65,7 @@ class DistributionDownloadFixture {
private static String urlPath(String version, OpenSearchDistribution.Platform platform) { private static String urlPath(String version, OpenSearchDistribution.Platform platform) {
String fileType = ((platform == OpenSearchDistribution.Platform.LINUX || String fileType = ((platform == OpenSearchDistribution.Platform.LINUX ||
platform == OpenSearchDistribution.Platform.DARWIN)) ? "tar.gz" : "zip" platform == OpenSearchDistribution.Platform.DARWIN)) ? "tar.gz" : "zip"
"/downloads/opensearch/opensearch-oss-${version}-${platform}-x86_64.$fileType" "/downloads/opensearch/opensearch-${version}-${platform}-x86_64.$fileType"
} }
private static byte[] filebytes(String urlPath) throws IOException { private static byte[] filebytes(String urlPath) throws IOException {

View File

@ -70,7 +70,7 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT
where: where:
buildTaskName | expectedOutputArchivePath buildTaskName | expectedOutputArchivePath
"buildOssDarwinTar" | "oss-darwin-tar/build/distributions/opensearch-oss.tar.gz" "buildDarwinTar" | "darwin-tar/build/distributions/opensearch.tar.gz"
} }
def "applies defaults to zip tasks"() { def "applies defaults to zip tasks"() {
@ -91,7 +91,7 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT
where: where:
buildTaskName | expectedOutputArchivePath buildTaskName | expectedOutputArchivePath
"buildOssDarwinZip" | "oss-darwin-zip/build/distributions/opensearch-oss.zip" "buildDarwinZip" | "darwin-zip/build/distributions/opensearch.zip"
} }
def "registered distribution provides archives and directory variant"() { def "registered distribution provides archives and directory variant"() {
@ -148,8 +148,8 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT
then: "tar task executed and target folder contains plain tar" then: "tar task executed and target folder contains plain tar"
result.task(':buildProducerTar').outcome == TaskOutcome.SUCCESS result.task(':buildProducerTar').outcome == TaskOutcome.SUCCESS
result.task(':consumer:copyArchive').outcome == TaskOutcome.SUCCESS result.task(':consumer:copyArchive').outcome == TaskOutcome.SUCCESS
file("producer-tar/build/distributions/opensearch-oss.tar.gz").exists() file("producer-tar/build/distributions/opensearch.tar.gz").exists()
file("consumer/build/archives/opensearch-oss.tar.gz").exists() file("consumer/build/archives/opensearch.tar.gz").exists()
when: when:
result = gradleRunner("copyDir", "-Pversion=1.0").build() result = gradleRunner("copyDir", "-Pversion=1.0").build()

View File

@ -56,15 +56,15 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
def "builds distribution from branches via archives assemble"() { def "builds distribution from branches via archives assemble"() {
when: when:
def result = gradleRunner(new File(testProjectDir.root, "remote"), def result = gradleRunner(new File(testProjectDir.root, "remote"),
":distribution:bwc:bugfix:buildBwcOssDarwinTar", ":distribution:bwc:bugfix:buildBwcDarwinTar",
"-DtestRemoteRepo=" + remoteGitRepo, "-DtestRemoteRepo=" + remoteGitRepo,
"-Dbwc.remote=origin") "-Dbwc.remote=origin")
.build() .build()
then: then:
result.task(":distribution:bwc:bugfix:buildBwcOssDarwinTar").outcome == TaskOutcome.SUCCESS result.task(":distribution:bwc:bugfix:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS
and: "assemble task triggered" and: "assemble task triggered"
result.output.contains("[8.0.1] > Task :distribution:archives:oss-darwin-tar:assemble") result.output.contains("[8.0.1] > Task :distribution:archives:darwin-tar:assemble")
} }
def "bwc distribution archives can be resolved as bwc project artifact"() { def "bwc distribution archives can be resolved as bwc project artifact"() {
@ -76,7 +76,7 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
} }
dependencies { dependencies {
dists project(path: ":distribution:bwc:bugfix", configuration:"oss-darwin-tar") dists project(path: ":distribution:bwc:bugfix", configuration:"darwin-tar")
} }
tasks.register("resolveDistributionArchive") { tasks.register("resolveDistributionArchive") {
@ -96,13 +96,13 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
.build() .build()
then: then:
result.task(":resolveDistributionArchive").outcome == TaskOutcome.SUCCESS result.task(":resolveDistributionArchive").outcome == TaskOutcome.SUCCESS
result.task(":distribution:bwc:bugfix:buildBwcOssDarwinTar").outcome == TaskOutcome.SUCCESS result.task(":distribution:bwc:bugfix:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS
and: "assemble task triggered" and: "assemble task triggered"
result.output.contains("[8.0.1] > Task :distribution:archives:oss-darwin-tar:assemble") result.output.contains("[8.0.1] > Task :distribution:archives:darwin-tar:assemble")
normalizedOutput(result.output) normalizedOutput(result.output)
.contains("distfile /distribution/bwc/bugfix/build/bwc/checkout-8.0/distribution/archives/oss-darwin-tar/" + .contains("distfile /distribution/bwc/bugfix/build/bwc/checkout-8.0/distribution/archives/darwin-tar/" +
"build/distributions/opensearch-oss-8.0.1-SNAPSHOT-darwin-x86_64.tar.gz") "build/distributions/opensearch-8.0.1-SNAPSHOT-darwin-x86_64.tar.gz")
} }
def "bwc expanded distribution folder can be resolved as bwc project artifact"() { def "bwc expanded distribution folder can be resolved as bwc project artifact"() {
@ -114,7 +114,7 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
} }
dependencies { dependencies {
expandedDist project(path: ":distribution:bwc:bugfix", configuration:"expanded-oss-darwin-tar") expandedDist project(path: ":distribution:bwc:bugfix", configuration:"expanded-darwin-tar")
} }
tasks.register("resolveExpandedDistribution") { tasks.register("resolveExpandedDistribution") {
@ -134,13 +134,13 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
.build() .build()
then: then:
result.task(":resolveExpandedDistribution").outcome == TaskOutcome.SUCCESS result.task(":resolveExpandedDistribution").outcome == TaskOutcome.SUCCESS
result.task(":distribution:bwc:bugfix:buildBwcOssDarwinTar").outcome == TaskOutcome.SUCCESS result.task(":distribution:bwc:bugfix:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS
and: "assemble task triggered" and: "assemble task triggered"
result.output.contains("[8.0.1] > Task :distribution:archives:oss-darwin-tar:assemble") result.output.contains("[8.0.1] > Task :distribution:archives:darwin-tar:assemble")
normalizedOutput(result.output) normalizedOutput(result.output)
.contains("distfile /distribution/bwc/bugfix/build/bwc/checkout-8.0/" + .contains("distfile /distribution/bwc/bugfix/build/bwc/checkout-8.0/" +
"distribution/archives/oss-darwin-tar/build/install") "distribution/archives/darwin-tar/build/install")
} }
File setupGitRemote() { File setupGitRemote() {

View File

@ -82,7 +82,7 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
def result = gradleRunner("setupDistro", '-g', testProjectDir.newFolder('GUH').path).build() def result = gradleRunner("setupDistro", '-g', testProjectDir.newFolder('GUH').path).build()
then: then:
result.task(":distribution:archives:oss-linux-tar:buildExpanded").outcome == TaskOutcome.SUCCESS result.task(":distribution:archives:linux-tar:buildExpanded").outcome == TaskOutcome.SUCCESS
result.task(":setupDistro").outcome == TaskOutcome.SUCCESS result.task(":setupDistro").outcome == TaskOutcome.SUCCESS
assertExtractedDistroIsCreated("build/distro", 'current-marker.txt') assertExtractedDistroIsCreated("build/distro", 'current-marker.txt')
} }
@ -154,24 +154,24 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
apply plugin:'base' apply plugin:'base'
// packed distro // packed distro
configurations.create("oss-linux-tar") configurations.create("linux-tar")
tasks.register("buildBwcTask", Tar) { tasks.register("buildBwcTask", Tar) {
from('bwc-marker.txt') from('bwc-marker.txt')
archiveExtension = "tar.gz" archiveExtension = "tar.gz"
compression = Compression.GZIP compression = Compression.GZIP
} }
artifacts { artifacts {
it.add("oss-linux-tar", buildBwcTask) it.add("linux-tar", buildBwcTask)
} }
// expanded distro // expanded distro
configurations.create("expanded-oss-linux-tar") configurations.create("expanded-linux-tar")
def expandedTask = tasks.register("buildBwcExpandedTask", Copy) { def expandedTask = tasks.register("buildBwcExpandedTask", Copy) {
from('bwc-marker.txt') from('bwc-marker.txt')
into('build/install/opensearch-distro') into('build/install/opensearch-distro')
} }
artifacts { artifacts {
it.add("expanded-oss-linux-tar", file('build/install')) { it.add("expanded-linux-tar", file('build/install')) {
builtBy expandedTask builtBy expandedTask
type = 'directory' type = 'directory'
} }
@ -181,9 +181,9 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
private void localDistroSetup() { private void localDistroSetup() {
settingsFile << """ settingsFile << """
include ":distribution:archives:oss-linux-tar" include ":distribution:archives:linux-tar"
""" """
def bwcSubProjectFolder = testProjectDir.newFolder("distribution", "archives", "oss-linux-tar") def bwcSubProjectFolder = testProjectDir.newFolder("distribution", "archives", "linux-tar")
new File(bwcSubProjectFolder, 'current-marker.txt') << "current" new File(bwcSubProjectFolder, 'current-marker.txt') << "current"
new File(bwcSubProjectFolder, 'build.gradle') << """ new File(bwcSubProjectFolder, 'build.gradle') << """
import org.gradle.api.internal.artifacts.ArtifactAttributes; import org.gradle.api.internal.artifacts.ArtifactAttributes;

View File

@ -34,7 +34,7 @@ subprojects {
tasks.register('tar', Tar) { tasks.register('tar', Tar) {
from('.') from('.')
destinationDirectory.set(file('build/distributions')) destinationDirectory.set(file('build/distributions'))
archiveBaseName.set("opensearch-oss") archiveBaseName.set("opensearch")
archiveVersion.set("8.0.1-SNAPSHOT") archiveVersion.set("8.0.1-SNAPSHOT")
archiveClassifier.set("darwin-x86_64") archiveClassifier.set("darwin-x86_64")
archiveExtension.set('tar.gz') archiveExtension.set('tar.gz')

View File

@ -30,4 +30,4 @@
include ":distribution:bwc:bugfix" include ":distribution:bwc:bugfix"
include ":distribution:bwc:minor" include ":distribution:bwc:minor"
include ":distribution:archives:oss-darwin-tar" include ":distribution:archives:darwin-tar"

View File

@ -203,20 +203,18 @@ class ClusterFormationTasks {
} }
return return
} }
distro = 'oss'
Version version = Version.fromString(opensearchVersion) Version version = Version.fromString(opensearchVersion)
String os = getOs() String os = getOs()
String classifier = "-${os}-x86_64" String classifier = "-${os}-x86_64"
String packaging = os.equals('windows') ? 'zip' : 'tar.gz' String packaging = os.equals('windows') ? 'zip' : 'tar.gz'
String artifactName = 'opensearch-oss' String artifactName = 'opensearch'
Object dependency Object dependency
String snapshotProject = "${os}-${os.equals('windows') ? 'zip' : 'tar'}" String snapshotProject = "${os}-${os.equals('windows') ? 'zip' : 'tar'}"
if (version.before("7.0.0")) { if (version.before("7.0.0")) {
snapshotProject = "zip" snapshotProject = "zip"
packaging = "zip" packaging = "zip"
} }
snapshotProject = "oss-" + snapshotProject
BwcVersions.UnreleasedVersionInfo unreleasedInfo = null BwcVersions.UnreleasedVersionInfo unreleasedInfo = null

View File

@ -206,6 +206,6 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
} }
String group = distribution.getVersion().endsWith("-SNAPSHOT") ? FAKE_SNAPSHOT_IVY_GROUP : FAKE_IVY_GROUP; String group = distribution.getVersion().endsWith("-SNAPSHOT") ? FAKE_SNAPSHOT_IVY_GROUP : FAKE_IVY_GROUP;
return group + ":opensearch-oss" + ":" + distribution.getVersion() + classifier + "@" + extension; return group + ":opensearch" + ":" + distribution.getVersion() + classifier + "@" + extension;
} }
} }

View File

@ -121,7 +121,7 @@ public class InternalDistributionArchiveSetupPlugin implements Plugin<Project> {
project.getTasks().withType(AbstractArchiveTask.class).configureEach(t -> { project.getTasks().withType(AbstractArchiveTask.class).configureEach(t -> {
String subdir = archiveTaskToSubprojectName(t.getName()); String subdir = archiveTaskToSubprojectName(t.getName());
t.getDestinationDirectory().set(project.file(subdir + "/build/distributions")); t.getDestinationDirectory().set(project.file(subdir + "/build/distributions"));
t.getArchiveBaseName().set("opensearch-oss"); t.getArchiveBaseName().set("opensearch");
}); });
} }

View File

@ -132,7 +132,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
private void registerDistributionArchiveArtifact(Project bwcProject, DistributionProject distributionProject, String buildBwcTask) { private void registerDistributionArchiveArtifact(Project bwcProject, DistributionProject distributionProject, String buildBwcTask) {
String artifactFileName = distributionProject.getDistFile().getName(); String artifactFileName = distributionProject.getDistFile().getName();
String artifactName = "opensearch-oss"; String artifactName = "opensearch";
String suffix = artifactFileName.endsWith("tar.gz") ? "tar.gz" : artifactFileName.substring(artifactFileName.length() - 3); String suffix = artifactFileName.endsWith("tar.gz") ? "tar.gz" : artifactFileName.substring(artifactFileName.length() - 3);
int archIndex = artifactFileName.indexOf("x86_64"); int archIndex = artifactFileName.indexOf("x86_64");
@ -154,13 +154,13 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
private static List<DistributionProject> resolveArchiveProjects(File checkoutDir, Version bwcVersion) { private static List<DistributionProject> resolveArchiveProjects(File checkoutDir, Version bwcVersion) {
List<String> projects = new ArrayList<>(); List<String> projects = new ArrayList<>();
// All active BWC branches publish default and oss variants of rpm and deb packages // All active BWC branches publish rpm and deb packages
projects.addAll(asList("oss-deb", "oss-rpm")); projects.addAll(asList("deb", "rpm"));
if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives
projects.addAll(asList("oss-windows-zip", "oss-darwin-tar", "oss-linux-tar")); projects.addAll(asList("windows-zip", "darwin-tar", "linux-tar"));
} else { // prior to 7.0 we published only a single zip and tar archives for oss and default distributions } else { // prior to 7.0 we published only a single zip and tar archives
projects.addAll(asList("oss-zip", "oss-tar")); projects.addAll(asList("zip", "tar"));
} }
return projects.stream().map(name -> { return projects.stream().map(name -> {
@ -170,7 +170,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
if (bwcVersion.onOrAfter("7.0.0")) { if (bwcVersion.onOrAfter("7.0.0")) {
if (name.contains("zip") || name.contains("tar")) { if (name.contains("zip") || name.contains("tar")) {
int index = name.lastIndexOf('-'); int index = name.lastIndexOf('-');
String baseName = name.substring(4, index); // oss- String baseName = name.substring(0, index);
classifier = "-" + baseName + "-x86_64"; classifier = "-" + baseName + "-x86_64";
extension = name.substring(index + 1); extension = name.substring(index + 1);
if (extension.equals("tar")) { if (extension.equals("tar")) {
@ -241,7 +241,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
this.projectPath = baseDir + "/" + name; this.projectPath = baseDir + "/" + name;
this.distFile = new File( this.distFile = new File(
checkoutDir, checkoutDir,
baseDir + "/" + name + "/build/distributions/opensearch-oss-" + version + "-SNAPSHOT" + classifier + "." + extension baseDir + "/" + name + "/build/distributions/opensearch-" + version + "-SNAPSHOT" + classifier + "." + extension
); );
// we only ported this down to the 7.x branch. // we only ported this down to the 7.x branch.
if (version.onOrAfter("7.10.0") && (name.endsWith("zip") || name.endsWith("tar"))) { if (version.onOrAfter("7.10.0") && (name.endsWith("zip") || name.endsWith("tar"))) {

View File

@ -167,8 +167,6 @@ public class InternalDistributionDownloadPlugin implements Plugin<Project> {
? "" ? ""
: "-" + architecture.toString().toLowerCase(); : "-" + architecture.toString().toLowerCase();
projectName += "oss-";
if (distribution.getBundledJdk() == false) { if (distribution.getBundledJdk() == false) {
projectName += "no-jdk-"; projectName += "no-jdk-";
} }
@ -179,7 +177,7 @@ public class InternalDistributionDownloadPlugin implements Plugin<Project> {
? "-zip" ? "-zip"
: "-tar"); : "-tar");
} else { } else {
projectName = "oss-zip"; projectName = "zip";
} }
break; break;

View File

@ -288,11 +288,6 @@ public class DistributionDownloadPluginTests extends GradleUnitTestCase {
} }
private static String projectName(String base, boolean bundledJdk) { private static String projectName(String base, boolean bundledJdk) {
String prefix = "oss-"; return bundledJdk ? base : ("no-jdk-" + base);
if (bundledJdk == false) {
prefix += "no-jdk-";
}
return prefix + base;
} }
} }

View File

@ -88,49 +88,49 @@ distribution_archives {
} }
} }
ossWindowsZip { windowsZip {
archiveClassifier = 'windows-x86_64' archiveClassifier = 'windows-x86_64'
content { content {
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', true) archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', true)
} }
} }
ossNoJdkWindowsZip { noJdkWindowsZip {
archiveClassifier = 'no-jdk-windows-x86_64' archiveClassifier = 'no-jdk-windows-x86_64'
content { content {
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false) archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false)
} }
} }
ossDarwinTar { darwinTar {
archiveClassifier = 'darwin-x86_64' archiveClassifier = 'darwin-x86_64'
content { content {
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', true) archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', true)
} }
} }
ossNoJdkDarwinTar { noJdkDarwinTar {
archiveClassifier = 'no-jdk-darwin-x86_64' archiveClassifier = 'no-jdk-darwin-x86_64'
content { content {
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false) archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false)
} }
} }
ossLinuxAarch64Tar { linuxAarch64Tar {
archiveClassifier = 'linux-aarch64' archiveClassifier = 'linux-aarch64'
content { content {
archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', true) archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', true)
} }
} }
ossLinuxTar { linuxTar {
archiveClassifier = 'linux-x86_64' archiveClassifier = 'linux-x86_64'
content { content {
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', true) archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', true)
} }
} }
ossNoJdkLinuxTar { noJdkLinuxTar {
archiveClassifier = 'no-jdk-linux-x86_64' archiveClassifier = 'no-jdk-linux-x86_64'
content { content {
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false) archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false)
@ -142,5 +142,5 @@ subprojects {
apply plugin: 'distribution' apply plugin: 'distribution'
apply plugin: 'opensearch.internal-distribution-archive-check' apply plugin: 'opensearch.internal-distribution-archive-check'
group = "org.opensearch.distribution.oss" group = "org.opensearch.distribution"
} }

View File

@ -69,11 +69,11 @@ tasks.register("generateDependenciesReport", ConcatFilesTask) {
// integ test zip only uses server, so a different notice file is needed there // integ test zip only uses server, so a different notice file is needed there
def buildServerNoticeTaskProvider = tasks.register("buildServerNotice", NoticeTask) def buildServerNoticeTaskProvider = tasks.register("buildServerNotice", NoticeTask)
def buildOssNoticeTaskProvider = tasks.register("buildOssNotice", NoticeTask) { def buildNoticeTaskProvider = tasks.register("buildNotice", NoticeTask) {
licensesDir new File(project(':distribution').projectDir, 'licenses') licensesDir new File(project(':distribution').projectDir, 'licenses')
} }
def buildOssNoJdkNoticeTaskProvider = tasks.register("buildOssNoJdkNotice", NoticeTask) def buildNoJdkNoticeTaskProvider = tasks.register("buildNoJdkNotice", NoticeTask)
// The :server and :libs projects belong to all distributions // The :server and :libs projects belong to all distributions
tasks.withType(NoticeTask).configureEach { tasks.withType(NoticeTask).configureEach {
@ -88,13 +88,13 @@ tasks.withType(NoticeTask).configureEach {
/***************************************************************************** /*****************************************************************************
* Modules * * Modules *
*****************************************************************************/ *****************************************************************************/
String ossOutputs = 'build/outputs/oss' String distOutputs = 'build/outputs/dist'
String systemdOutputs = 'build/outputs/systemd' String systemdOutputs = 'build/outputs/systemd'
String transportOutputs = 'build/outputs/transport-only' String transportOutputs = 'build/outputs/transport-only'
String externalTestOutputs = 'build/outputs/external-test' String externalTestOutputs = 'build/outputs/external-test'
def processOssOutputsTaskProvider = tasks.register("processOssOutputs", Sync) { def processOutputsTaskProvider = tasks.register("processOutputs", Sync) {
into ossOutputs into distOutputs
} }
def processSystemdOutputsTaskProvider = tasks.register("processSystemdOutputs", Sync) { def processSystemdOutputsTaskProvider = tasks.register("processSystemdOutputs", Sync) {
@ -112,17 +112,17 @@ def processTransportOutputsTaskProvider = tasks.register("processTransportOutput
} }
// these are dummy tasks that can be used to depend on the relevant sub output dir // these are dummy tasks that can be used to depend on the relevant sub output dir
def buildOssModulesTaskProvider = tasks.register("buildOssModules") { def buildModulesTaskProvider = tasks.register("buildModules") {
dependsOn processOssOutputsTaskProvider dependsOn processOutputsTaskProvider
outputs.dir "${ossOutputs}/modules" outputs.dir "${distOutputs}/modules"
} }
tasks.register("buildOssBin") { tasks.register("buildBin") {
dependsOn "processOssOutputs" dependsOn "processOutputs"
outputs.dir "${ossOutputs}/bin" outputs.dir "${distOutputs}/bin"
} }
tasks.register("buildOssConfig") { tasks.register("buildConfig") {
dependsOn "processOssOutputs" dependsOn "processOutputs"
outputs.dir "${ossOutputs}/config" outputs.dir "${distOutputs}/config"
} }
def buildSystemdModuleTaskProvider = tasks.register("buildSystemdModule") { def buildSystemdModuleTaskProvider = tasks.register("buildSystemdModule") {
dependsOn "processSystemdOutputs" dependsOn "processSystemdOutputs"
@ -172,10 +172,10 @@ void copyModule(TaskProvider<Sync> copyTask, Project module) {
} }
// log4j config could be contained in modules, so we must join it together using these tasks // log4j config could be contained in modules, so we must join it together using these tasks
def buildOssLog4jConfigTaskProvider = tasks.register("buildOssLog4jConfig") { def buildLog4jConfigTaskProvider = tasks.register("buildLog4jConfig") {
dependsOn "processOssOutputs" dependsOn "processOutputs"
ext.contents = [] ext.contents = []
ext.log4jFile = file("${ossOutputs}/log4j2.properties") ext.log4jFile = file("${distOutputs}/log4j2.properties")
outputs.file log4jFile outputs.file log4jFile
} }
@ -186,7 +186,7 @@ Closure writeLog4jProperties = {
it.log4jFile.append(moduleLog4jProperties, 'UTF-8') it.log4jFile.append(moduleLog4jProperties, 'UTF-8')
} }
} }
buildOssLog4jConfigTaskProvider.configure { buildLog4jConfigTaskProvider.configure {
doLast(writeLog4jProperties) doLast(writeLog4jProperties)
} }
@ -213,7 +213,7 @@ void copyLog4jProperties(TaskProvider buildTask, Project module) {
ext.restTestExpansions = [ ext.restTestExpansions = [
'expected.modules.count': 0, 'expected.modules.count': 0,
] ]
// we create the buildOssModules task above but fill it here so we can do a single // we create the buildModules task above but fill it here so we can do a single
// loop over modules to also setup cross task dependencies and increment our modules counter // loop over modules to also setup cross task dependencies and increment our modules counter
project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each { Project module -> project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each { Project module ->
if (module.name == 'systemd') { if (module.name == 'systemd') {
@ -222,18 +222,18 @@ project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each {
} }
File licenses = new File(module.projectDir, 'licenses') File licenses = new File(module.projectDir, 'licenses')
if (licenses.exists()) { if (licenses.exists()) {
buildOssNotice.configure { buildNotice.configure {
licensesDir licenses licensesDir licenses
source module.file('src/main/java') source module.file('src/main/java')
} }
} }
copyModule(processOssOutputsTaskProvider, module) copyModule(processOutputsTaskProvider, module)
if (module.name.startsWith('transport-')) { if (module.name.startsWith('transport-')) {
copyModule(processTransportOutputsTaskProvider, module) copyModule(processTransportOutputsTaskProvider, module)
} }
copyLog4jProperties(buildOssLog4jConfigTaskProvider, module) copyLog4jProperties(buildLog4jConfigTaskProvider, module)
restTestExpansions['expected.modules.count'] += 1 restTestExpansions['expected.modules.count'] += 1
} }
@ -320,7 +320,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
it.mode = 0644 it.mode = 0644
} }
} }
def buildModules = buildOssModulesTaskProvider def buildModules = buildModulesTaskProvider
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64'] List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64']
if (platform != null) { if (platform != null) {
excludePlatforms.remove(excludePlatforms.indexOf(platform)) excludePlatforms.remove(excludePlatforms.indexOf(platform))
@ -353,8 +353,8 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
exclude 'log4j2.properties' // this is handled separately below exclude 'log4j2.properties' // this is handled separately below
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, jdk)) MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, jdk))
} }
from project(':distribution').buildOssLog4jConfig from project(':distribution').buildLog4jConfig
from project(':distribution').buildOssConfig from project(':distribution').buildConfig
} }
} }
@ -384,7 +384,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
// module provided bin files // module provided bin files
with copySpec { with copySpec {
eachFile { it.setMode(0755) } eachFile { it.setMode(0755) }
from project(':distribution').buildOssBin from project(':distribution').buildBin
if (distributionType != 'zip') { if (distributionType != 'zip') {
exclude '*.bat' exclude '*.bat'
} }
@ -398,9 +398,9 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
from buildServerNoticeTaskProvider from buildServerNoticeTaskProvider
} else { } else {
if (jdk) { if (jdk) {
from buildOssNoticeTaskProvider from buildNoticeTaskProvider
} else { } else {
from buildOssNoJdkNoticeTaskProvider from buildNoJdkNoticeTaskProvider
} }
} }
} }
@ -583,13 +583,13 @@ subprojects {
} }
} }
['archives:oss-windows-zip', ['archives:windows-zip',
'archives:oss-darwin-tar', 'archives:darwin-tar',
'archives:oss-linux-aarch64-tar', 'archives:linux-aarch64-tar',
'archives:oss-linux-tar', 'archives:linux-tar',
'archives:integ-test-zip', 'archives:integ-test-zip',
'packages:oss-rpm', 'packages:oss-deb', 'packages:rpm', 'packages:deb',
'packages:aarch64-oss-rpm', 'packages:aarch64-oss-deb' 'packages:aarch64-rpm', 'packages:aarch64-deb'
].forEach { subName -> ].forEach { subName ->
Project subproject = project("${project.path}:${subName}") Project subproject = project("${project.path}:${subName}")
Configuration configuration = configurations.create(subproject.name) Configuration configuration = configurations.create(subproject.name)

View File

@ -24,13 +24,13 @@ apply plugin: 'opensearch.rest-resources'
testFixtures.useFixture() testFixtures.useFixture()
configurations { configurations {
aarch64OssDockerSource aarch64DockerSource
ossDockerSource dockerSource
} }
dependencies { dependencies {
aarch64OssDockerSource project(path: ":distribution:archives:oss-linux-aarch64-tar", configuration:"default") aarch64DockerSource project(path: ":distribution:archives:linux-aarch64-tar", configuration:"default")
ossDockerSource project(path: ":distribution:archives:oss-linux-tar", configuration:"default") dockerSource project(path: ":distribution:archives:linux-tar", configuration:"default")
} }
ext.expansions = { Architecture architecture, DockerBase base, boolean local -> ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
@ -50,7 +50,7 @@ ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
classifier = "linux-\$(arch)" classifier = "linux-\$(arch)"
} }
final String opensearch = "opensearch-oss-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz" final String opensearch = "opensearch-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz"
/* Both the following Dockerfile commands put the resulting artifact at /* Both the following Dockerfile commands put the resulting artifact at
* the same location, regardless of classifier, so that the commands that * the same location, regardless of classifier, so that the commands that
@ -83,14 +83,12 @@ RUN curl --retry 8 -S -L \\
private static String buildPath(Architecture architecture, DockerBase base) { private static String buildPath(Architecture architecture, DockerBase base) {
return 'build/' + return 'build/' +
(architecture == Architecture.AARCH64 ? 'aarch64-' : '') + (architecture == Architecture.AARCH64 ? 'aarch64-' : '') +
'oss-' +
'docker' 'docker'
} }
private static String taskName(String prefix, Architecture architecture, DockerBase base, String suffix) { private static String taskName(String prefix, Architecture architecture, DockerBase base, String suffix) {
return prefix + return prefix +
(architecture == Architecture.AARCH64 ? 'Aarch64' : '') + (architecture == Architecture.AARCH64 ? 'Aarch64' : '') +
'Oss' +
suffix suffix
} }
@ -114,7 +112,7 @@ project.ext {
void addCopyDockerContextTask(Architecture architecture, DockerBase base) { void addCopyDockerContextTask(Architecture architecture, DockerBase base) {
if (base != DockerBase.CENTOS) { if (base != DockerBase.CENTOS) {
throw new GradleException("The only allowed docker base image for OSS builds is CENTOS") throw new GradleException("The only allowed docker base image for builds is CENTOS")
} }
tasks.register(taskName("copy", architecture, base, "DockerContext"), Sync) { tasks.register(taskName("copy", architecture, base, "DockerContext"), Sync) {
@ -126,9 +124,9 @@ void addCopyDockerContextTask(Architecture architecture, DockerBase base) {
with dockerBuildContext(architecture, base, true) with dockerBuildContext(architecture, base, true)
if (architecture == Architecture.AARCH64) { if (architecture == Architecture.AARCH64) {
from configurations.aarch64OssDockerSource from configurations.aarch64DockerSource
} else { } else {
from configurations.ossDockerSource from configurations.dockerSource
} }
} }
} }
@ -158,12 +156,12 @@ tasks.named("preProcessFixture").configure {
doLast { doLast {
// tests expect to have an empty repo // tests expect to have an empty repo
project.delete( project.delete(
"${buildDir}/oss-repo" "${buildDir}/repo"
) )
createAndSetWritable( createAndSetWritable(
"${buildDir}/oss-repo", "${buildDir}/repo",
"${buildDir}/logs/oss-1", "${buildDir}/logs/1",
"${buildDir}/logs/oss-2" "${buildDir}/logs/2"
) )
} }
} }
@ -180,7 +178,7 @@ tasks.named("check").configure {
void addBuildDockerImage(Architecture architecture, DockerBase base) { void addBuildDockerImage(Architecture architecture, DockerBase base) {
if (base != DockerBase.CENTOS) { if (base != DockerBase.CENTOS) {
throw new GradleException("The only allowed docker base image for OSS builds is CENTOS") throw new GradleException("The only allowed docker base image for builds is CENTOS")
} }
final TaskProvider<DockerBuildTask> buildDockerImageTask = final TaskProvider<DockerBuildTask> buildDockerImageTask =
@ -193,8 +191,8 @@ void addBuildDockerImage(Architecture architecture, DockerBase base) {
String version = VersionProperties.getOpenSearch() String version = VersionProperties.getOpenSearch()
tags = [ tags = [
"docker.opensearch.org/opensearch/opensearch-oss:${version}", "docker.opensearch.org/opensearch:${version}",
"opensearch-oss:test" "opensearch:test"
] ]
} }
tasks.named("assemble").configure { tasks.named("assemble").configure {
@ -203,7 +201,7 @@ void addBuildDockerImage(Architecture architecture, DockerBase base) {
} }
for (final Architecture architecture : Architecture.values()) { for (final Architecture architecture : Architecture.values()) {
// We only create Docker images for the OSS distribution on CentOS. // We only create Docker images for the distribution on CentOS.
for (final DockerBase base : DockerBase.values()) { for (final DockerBase base : DockerBase.values()) {
if (base == DockerBase.CENTOS) { if (base == DockerBase.CENTOS) {
addCopyDockerContextTask(architecture, base) addCopyDockerContextTask(architecture, base)
@ -231,9 +229,8 @@ subprojects { Project subProject ->
final DockerBase base = DockerBase.CENTOS final DockerBase base = DockerBase.CENTOS
final String arch = architecture == Architecture.AARCH64 ? '-aarch64' : '' final String arch = architecture == Architecture.AARCH64 ? '-aarch64' : ''
final String suffix = '-oss'
final String extension = 'docker.tar' final String extension = 'docker.tar'
final String artifactName = "opensearch${arch}${suffix}_test" final String artifactName = "opensearch${arch}_test"
final String exportTaskName = taskName("export", architecture, base, "DockerImage") final String exportTaskName = taskName("export", architecture, base, "DockerImage")
final String buildTaskName = taskName("build", architecture, base, "DockerImage") final String buildTaskName = taskName("build", architecture, base, "DockerImage")
@ -246,7 +243,7 @@ subprojects { Project subProject ->
args "save", args "save",
"-o", "-o",
tarFile, tarFile,
"opensearch${suffix}:test" "opensearch:test"
dependsOn(parent.path + ":" + buildTaskName) dependsOn(parent.path + ":" + buildTaskName)
onlyIf { Architecture.current() == architecture } onlyIf { Architecture.current() == architecture }

View File

@ -13,13 +13,13 @@ import org.opensearch.gradle.DockerBase
apply plugin: 'base' apply plugin: 'base'
tasks.register("buildOssDockerBuildContext", Tar) { tasks.register("buildDockerBuildContext", Tar) {
archiveExtension = 'tar.gz' archiveExtension = 'tar.gz'
compression = Compression.GZIP compression = Compression.GZIP
archiveClassifier = "docker-build-context" archiveClassifier = "docker-build-context"
archiveBaseName = "opensearch-oss" archiveBaseName = "opensearch"
// Non-local builds don't need to specify an architecture. // Non-local builds don't need to specify an architecture.
with dockerBuildContext(null, DockerBase.CENTOS, false) with dockerBuildContext(null, DockerBase.CENTOS, false)
} }
tasks.named("assemble").configure { dependsOn "buildOssDockerBuildContext" } tasks.named("assemble").configure { dependsOn "buildDockerBuildContext" }

View File

@ -1,13 +1,13 @@
# Only used for testing the docker images # Only used for testing the docker images
version: '3' version: '3'
services: services:
opensearch-oss-1: opensearch-1:
image: opensearch-oss:test image: opensearch:test
environment: environment:
- node.name=opensearch-oss-1 - node.name=opensearch-1
- cluster.initial_master_nodes=opensearch-oss-1,opensearch-oss-2 - cluster.initial_master_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-oss-2:9300 - discovery.seed_hosts=opensearch-2:9300
- cluster.name=opensearch-oss - cluster.name=opensearch
- bootstrap.memory_lock=true - bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- path.repo=/tmp/opensearch-repo - path.repo=/tmp/opensearch-repo
@ -17,21 +17,21 @@ services:
- cluster.routing.allocation.disk.watermark.flood_stage=1b - cluster.routing.allocation.disk.watermark.flood_stage=1b
- node.store.allow_mmap=false - node.store.allow_mmap=false
volumes: volumes:
- ./build/oss-repo:/tmp/opensearch-repo - ./build/repo:/tmp/opensearch-repo
- ./build/logs/oss-1:/usr/share/opensearch/logs - ./build/logs/1:/usr/share/opensearch/logs
ports: ports:
- "9200" - "9200"
ulimits: ulimits:
memlock: memlock:
soft: -1 soft: -1
hard: -1 hard: -1
opensearch-oss-2: opensearch-2:
image: opensearch-oss:test image: opensearch:test
environment: environment:
- node.name=opensearch-oss-2 - node.name=opensearch-2
- cluster.initial_master_nodes=opensearch-oss-1,opensearch-oss-2 - cluster.initial_master_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-oss-1:9300 - discovery.seed_hosts=opensearch-1:9300
- cluster.name=opensearch-oss - cluster.name=opensearch
- bootstrap.memory_lock=true - bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- path.repo=/tmp/opensearch-repo - path.repo=/tmp/opensearch-repo
@ -41,8 +41,8 @@ services:
- cluster.routing.allocation.disk.watermark.flood_stage=1b - cluster.routing.allocation.disk.watermark.flood_stage=1b
- node.store.allow_mmap=false - node.store.allow_mmap=false
volumes: volumes:
- ./build/oss-repo:/tmp/opensearch-repo - ./build/repo:/tmp/opensearch-repo
- ./build/logs/oss-2:/usr/share/opensearch/logs - ./build/logs/2:/usr/share/opensearch/logs
ports: ports:
- "9200" - "9200"
ulimits: ulimits:

View File

@ -55,10 +55,10 @@ public class DockerYmlTestSuiteIT extends OpenSearchClientYamlSuiteTestCase {
protected String getTestRestCluster() { protected String getTestRestCluster() {
return new StringBuilder() return new StringBuilder()
.append("localhost:") .append("localhost:")
.append(getProperty("test.fixtures.opensearch-oss-1.tcp.9200")) .append(getProperty("test.fixtures.opensearch-1.tcp.9200"))
.append(",") .append(",")
.append("localhost:") .append("localhost:")
.append(getProperty("test.fixtures.opensearch-oss-2.tcp.9200")) .append(getProperty("test.fixtures.opensearch-2.tcp.9200"))
.toString(); .toString();
} }

View File

@ -67,9 +67,9 @@ plugins {
} }
void addProcessFilesTask(String type, boolean jdk) { void addProcessFilesTask(String type, boolean jdk) {
String packagingFiles = "build/packaging/oss-${jdk ? '' : 'no-jdk-'}${type}" String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"
String taskName = "processOss'${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" String taskName = "process'${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
tasks.register(taskName, Copy) { tasks.register(taskName, Copy) {
into packagingFiles into packagingFiles
@ -110,8 +110,8 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
onlyIf { onlyIf {
OS.current().equals(OS.WINDOWS) == false OS.current().equals(OS.WINDOWS) == false
} }
dependsOn "processOss'${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" dependsOn "process'${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
packageName "opensearch-oss" packageName "opensearch"
if (type == 'deb') { if (type == 'deb') {
if (architecture == 'x64') { if (architecture == 'x64') {
arch('amd64') arch('amd64')
@ -130,13 +130,13 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
} }
// Follow opensearch's file naming convention // Follow opensearch's file naming convention
String jdkString = jdk ? "" : "no-jdk-" String jdkString = jdk ? "" : "no-jdk-"
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}oss-${jdk ? '' : 'no-jdk-'}${type}" String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
destinationDirectory = file("${prefix}/build/distributions") destinationDirectory = file("${prefix}/build/distributions")
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself // SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-${project.version}-${jdkString}${archString}.${type}")) } conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-${project.version}-${jdkString}${archString}.${type}")) }
String packagingFiles = "build/packaging/oss-${jdk ? '' : 'no-jdk-'}${type}" String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"
String scripts = "${packagingFiles}/scripts" String scripts = "${packagingFiles}/scripts"
preInstall file("${scripts}/preinst") preInstall file("${scripts}/preinst")
@ -336,20 +336,19 @@ Closure commonDebConfig(boolean jdk, String architecture) {
into('/usr/share/lintian/overrides') { into('/usr/share/lintian/overrides') {
from('src/deb/lintian/opensearch') from('src/deb/lintian/opensearch')
rename('opensearch', 'opensearch-oss')
} }
} }
} }
tasks.register('buildAarch64OssDeb', Deb) { tasks.register('buildAarch64Deb', Deb) {
configure(commonDebConfig(true, 'aarch64')) configure(commonDebConfig(true, 'aarch64'))
} }
tasks.register('buildOssDeb', Deb) { tasks.register('buildDeb', Deb) {
configure(commonDebConfig(true, 'x64')) configure(commonDebConfig(true, 'x64'))
} }
tasks.register('buildOssNoJdkDeb', Deb) { tasks.register('buildNoJdkDeb', Deb) {
configure(commonDebConfig(true, 'x64')) configure(commonDebConfig(true, 'x64'))
} }
@ -378,15 +377,15 @@ Closure commonRpmConfig(boolean jdk, String architecture) {
} }
} }
tasks.register('buildAarch64OssRpm', Rpm) { tasks.register('buildAarch64Rpm', Rpm) {
configure(commonRpmConfig(true, 'aarch64')) configure(commonRpmConfig(true, 'aarch64'))
} }
tasks.register('buildOssRpm', Rpm) { tasks.register('buildRpm', Rpm) {
configure(commonRpmConfig(true, 'x64')) configure(commonRpmConfig(true, 'x64'))
} }
tasks.register('buildOssNoJdkRpm', Rpm) { tasks.register('buildNoJdkRpm', Rpm) {
configure(commonRpmConfig(true, 'x64')) configure(commonRpmConfig(true, 'x64'))
} }
@ -464,7 +463,7 @@ subprojects {
Path copyrightPath Path copyrightPath
String expectedLicense String expectedLicense
String licenseFilename String licenseFilename
copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/opensearch-oss/copyright") copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/opensearch/copyright")
expectedLicense = "ASL-2.0" expectedLicense = "ASL-2.0"
licenseFilename = "APACHE-LICENSE-2.0.txt" licenseFilename = "APACHE-LICENSE-2.0.txt"
final List<String> header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/", final List<String> header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",

View File

@ -170,10 +170,10 @@ public class Archives {
} }
public static void verifyArchiveInstallation(Installation installation, Distribution distribution) { public static void verifyArchiveInstallation(Installation installation, Distribution distribution) {
verifyOssInstallation(installation, distribution, ARCHIVE_OWNER); verifyInstallation(installation, distribution, ARCHIVE_OWNER);
} }
private static void verifyOssInstallation(Installation es, Distribution distribution, String owner) { private static void verifyInstallation(Installation es, Distribution distribution, String owner) {
Stream.of(es.home, es.config, es.plugins, es.modules, es.logs).forEach(dir -> assertThat(dir, file(Directory, owner, owner, p755))); Stream.of(es.home, es.config, es.plugins, es.modules, es.logs).forEach(dir -> assertThat(dir, file(Directory, owner, owner, p755)));
assertThat(Files.exists(es.data), is(false)); assertThat(Files.exists(es.data), is(false));

View File

@ -116,11 +116,10 @@ public class Cleanup {
// Doing rpm erase on both packages in one command will remove neither since both cannot be installed // Doing rpm erase on both packages in one command will remove neither since both cannot be installed
// this may leave behind config files in /etc/opensearch, but a later step in this cleanup will get them // this may leave behind config files in /etc/opensearch, but a later step in this cleanup will get them
sh.runIgnoreExitCode("rpm --quiet -e opensearch"); sh.runIgnoreExitCode("rpm --quiet -e opensearch");
sh.runIgnoreExitCode("rpm --quiet -e opensearch-oss");
} }
if (isDPKG()) { if (isDPKG()) {
sh.runIgnoreExitCode("dpkg --purge opensearch opensearch-oss"); sh.runIgnoreExitCode("dpkg --purge opensearch");
} }
} }
} }

View File

@ -493,13 +493,13 @@ public class Docker {
} }
/** /**
* Perform a variety of checks on an installation. If the current distribution is not OSS, additional checks are carried out. * Perform a variety of checks on an installation.
*/ */
public static void verifyContainerInstallation(Installation installation, Distribution distribution) { public static void verifyContainerInstallation(Installation installation, Distribution distribution) {
verifyOssInstallation(installation); verifyInstallation(installation);
} }
private static void verifyOssInstallation(Installation es) { private static void verifyInstallation(Installation es) {
dockerShell.run("id opensearch"); dockerShell.run("id opensearch");
dockerShell.run("getent group opensearch"); dockerShell.run("getent group opensearch");

View File

@ -173,10 +173,10 @@ public class Packages {
} }
public static void verifyPackageInstallation(Installation installation, Distribution distribution, Shell sh) { public static void verifyPackageInstallation(Installation installation, Distribution distribution, Shell sh) {
verifyOssInstallation(installation, distribution, sh); verifyInstallation(installation, distribution, sh);
} }
private static void verifyOssInstallation(Installation opensearch, Distribution distribution, Shell sh) { private static void verifyInstallation(Installation opensearch, Distribution distribution, Shell sh) {
sh.run("id opensearch"); sh.run("id opensearch");
sh.run("getent group opensearch"); sh.run("getent group opensearch");

View File

@ -56,12 +56,12 @@ preProcessFixture {
doLast { doLast {
// tests expect to have an empty repo // tests expect to have an empty repo
project.delete( project.delete(
"${buildDir}/oss-repo" "${buildDir}/repo"
) )
createAndSetWritable( createAndSetWritable(
"${buildDir}/oss-repo", "${buildDir}/repo",
"${buildDir}/logs/oss-1", "${buildDir}/logs/1",
"${buildDir}/logs/oss-2" "${buildDir}/logs/2"
) )
} }
} }

View File

@ -1,12 +1,12 @@
# Only used for testing the docker images # Only used for testing the docker images
version: '3.7' version: '3.7'
services: services:
opensearch-oss-1: opensearch-1:
image: opensearch-oss:test image: opensearch:test
environment: environment:
- node.name=opensearch-oss-1 - node.name=opensearch-1
- cluster.initial_master_nodes=opensearch-oss-1 - cluster.initial_master_nodes=opensearch-1
- cluster.name=opensearch-oss-1 - cluster.name=opensearch-1
- bootstrap.memory_lock=true - bootstrap.memory_lock=true
- network.publish_host=127.0.0.1 - network.publish_host=127.0.0.1
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
@ -17,8 +17,8 @@ services:
- cluster.routing.allocation.disk.watermark.flood_stage=1b - cluster.routing.allocation.disk.watermark.flood_stage=1b
- node.store.allow_mmap=false - node.store.allow_mmap=false
volumes: volumes:
- ./build/oss-repo:/tmp/opensearch-repo - ./build/repo:/tmp/opensearch-repo
- ./build/logs/oss-1:/usr/share/opensearch/logs - ./build/logs/1:/usr/share/opensearch/logs
ports: ports:
- "9200" - "9200"
- "9300" - "9300"
@ -35,12 +35,12 @@ services:
interval: 10s interval: 10s
timeout: 2s timeout: 2s
retries: 5 retries: 5
opensearch-oss-2: opensearch-2:
image: opensearch-oss:test image: opensearch:test
environment: environment:
- node.name=opensearch-oss-2 - node.name=opensearch-2
- cluster.initial_master_nodes=opensearch-oss-2 - cluster.initial_master_nodes=opensearch-2
- cluster.name=opensearch-oss-2 - cluster.name=opensearch-2
- bootstrap.memory_lock=true - bootstrap.memory_lock=true
- network.publish_host=127.0.0.1 - network.publish_host=127.0.0.1
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
@ -51,8 +51,8 @@ services:
- cluster.routing.allocation.disk.watermark.flood_stage=1b - cluster.routing.allocation.disk.watermark.flood_stage=1b
- node.store.allow_mmap=false - node.store.allow_mmap=false
volumes: volumes:
- ./build/oss-repo:/tmp/opensearch-repo - ./build/repo:/tmp/opensearch-repo
- ./build/logs/oss-2:/usr/share/opensearch/logs - ./build/logs/2:/usr/share/opensearch/logs
ports: ports:
- "9200" - "9200"
- "9300" - "9300"
@ -71,4 +71,4 @@ services:
ports: ports:
- "9600" - "9600"
volumes: volumes:
- ./haproxy-oss.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro

View File

@ -18,4 +18,4 @@ frontend ft_reg
default_backend bk_reg default_backend bk_reg
backend bk_reg backend bk_reg
server default opensearch-oss-2:9300 check server default opensearch-2:9300 check

View File

@ -59,7 +59,7 @@ public abstract class AbstractMultiClusterRemoteTestCase extends OpenSearchRestT
@Override @Override
protected String getTestRestCluster() { protected String getTestRestCluster() {
return "localhost:" + getProperty("test.fixtures.opensearch-oss-1.tcp.9200"); return "localhost:" + getProperty("test.fixtures.opensearch-1.tcp.9200");
} }
@Before @Before
@ -68,8 +68,8 @@ public abstract class AbstractMultiClusterRemoteTestCase extends OpenSearchRestT
return; return;
} }
cluster1Client = buildClient("localhost:" + getProperty("test.fixtures.opensearch-oss-1.tcp.9200")); cluster1Client = buildClient("localhost:" + getProperty("test.fixtures.opensearch-1.tcp.9200"));
cluster2Client = buildClient("localhost:" + getProperty("test.fixtures.opensearch-oss-2.tcp.9200")); cluster2Client = buildClient("localhost:" + getProperty("test.fixtures.opensearch-2.tcp.9200"));
cluster1Client().cluster().health(new ClusterHealthRequest().waitForNodes("1").waitForYellowStatus(), RequestOptions.DEFAULT); cluster1Client().cluster().health(new ClusterHealthRequest().waitForNodes("1").waitForYellowStatus(), RequestOptions.DEFAULT);
cluster2Client().cluster().health(new ClusterHealthRequest().waitForNodes("1").waitForYellowStatus(), RequestOptions.DEFAULT); cluster2Client().cluster().health(new ClusterHealthRequest().waitForNodes("1").waitForYellowStatus(), RequestOptions.DEFAULT);

View File

@ -81,7 +81,7 @@ public class RemoteClustersIT extends AbstractMultiClusterRemoteTestCase {
} }
public void testProxyModeConnectionWorks() throws IOException { public void testProxyModeConnectionWorks() throws IOException {
String cluster2RemoteClusterSeed = "opensearch-oss-2:9300"; String cluster2RemoteClusterSeed = "opensearch-2:9300";
logger.info("Configuring remote cluster [{}]", cluster2RemoteClusterSeed); logger.info("Configuring remote cluster [{}]", cluster2RemoteClusterSeed);
ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest().persistentSettings(Settings.builder() ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest().persistentSettings(Settings.builder()
.put("cluster.remote.cluster2.mode", "proxy") .put("cluster.remote.cluster2.mode", "proxy")
@ -98,7 +98,7 @@ public class RemoteClustersIT extends AbstractMultiClusterRemoteTestCase {
} }
public void testSniffModeConnectionFails() throws IOException { public void testSniffModeConnectionFails() throws IOException {
String cluster2RemoteClusterSeed = "opensearch-oss-2:9300"; String cluster2RemoteClusterSeed = "opensearch-2:9300";
logger.info("Configuring remote cluster [{}]", cluster2RemoteClusterSeed); logger.info("Configuring remote cluster [{}]", cluster2RemoteClusterSeed);
ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest().persistentSettings(Settings.builder() ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest().persistentSettings(Settings.builder()
.put("cluster.remote.cluster2alt.mode", "sniff") .put("cluster.remote.cluster2alt.mode", "sniff")

View File

@ -17,7 +17,7 @@ services:
retries: 5 retries: 5
opensearch: opensearch:
image: opensearch-oss:test image: opensearch:test
environment: environment:
discovery.type: single-node discovery.type: single-node
ulimits: ulimits:

View File

@ -29,24 +29,24 @@ List projects = [
'client:benchmark', 'client:benchmark',
'benchmarks', 'benchmarks',
'distribution:archives:integ-test-zip', 'distribution:archives:integ-test-zip',
'distribution:archives:oss-windows-zip', 'distribution:archives:windows-zip',
'distribution:archives:oss-no-jdk-windows-zip', 'distribution:archives:no-jdk-windows-zip',
'distribution:archives:oss-darwin-tar', 'distribution:archives:darwin-tar',
'distribution:archives:oss-no-jdk-darwin-tar', 'distribution:archives:no-jdk-darwin-tar',
'distribution:archives:oss-linux-aarch64-tar', 'distribution:archives:linux-aarch64-tar',
'distribution:archives:oss-linux-tar', 'distribution:archives:linux-tar',
'distribution:archives:oss-no-jdk-linux-tar', 'distribution:archives:no-jdk-linux-tar',
'distribution:docker', 'distribution:docker',
'distribution:docker:oss-docker-aarch64-build-context', 'distribution:docker:docker-aarch64-build-context',
'distribution:docker:oss-docker-aarch64-export', 'distribution:docker:docker-aarch64-export',
'distribution:docker:oss-docker-build-context', 'distribution:docker:docker-build-context',
'distribution:docker:oss-docker-export', 'distribution:docker:docker-export',
'distribution:packages:aarch64-oss-deb', 'distribution:packages:aarch64-deb',
'distribution:packages:oss-deb', 'distribution:packages:deb',
'distribution:packages:oss-no-jdk-deb', 'distribution:packages:no-jdk-deb',
'distribution:packages:aarch64-oss-rpm', 'distribution:packages:aarch64-rpm',
'distribution:packages:oss-rpm', 'distribution:packages:rpm',
'distribution:packages:oss-no-jdk-rpm', 'distribution:packages:no-jdk-rpm',
'distribution:bwc:bugfix', 'distribution:bwc:bugfix',
'distribution:bwc:maintenance', 'distribution:bwc:maintenance',
'distribution:bwc:minor', 'distribution:bwc:minor',