Skip to content

Commit 7949f92

Browse files
authored
Cleanup default flavor stragglers from docker distributions. (#481)
This commit removes the references for the `default` docker distributions which were originally part of the different flavors of distributions. This also fixes some of the failing docker compose tests under `qa`. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
1 parent cea2161 commit 7949f92

File tree

12 files changed

+34
-260
lines changed

12 files changed

+34
-260
lines changed

distribution/build.gradle

-40
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,10 @@ tasks.register("generateDependenciesReport", ConcatFilesTask) {
5858
// integ test zip only uses server, so a different notice file is needed there
5959
def buildServerNoticeTaskProvider = tasks.register("buildServerNotice", NoticeTask)
6060

61-
// other distributions include notices from modules as well, which are added below later
62-
def buildDefaultNoticeTaskProvider = tasks.register("buildDefaultNotice", NoticeTask) {
63-
licensesDir new File(project(':distribution').projectDir, 'licenses')
64-
}
65-
6661
def buildOssNoticeTaskProvider = tasks.register("buildOssNotice", NoticeTask) {
6762
licensesDir new File(project(':distribution').projectDir, 'licenses')
6863
}
6964

70-
def buildDefaultNoJdkNoticeTaskProvider = tasks.register("buildDefaultNoJdkNotice", NoticeTask)
71-
7265
def buildOssNoJdkNoticeTaskProvider = tasks.register("buildOssNoJdkNotice", NoticeTask)
7366

7467
// The :server and :libs projects belong to all distributions
@@ -85,7 +78,6 @@ tasks.withType(NoticeTask).configureEach {
8578
* Modules *
8679
*****************************************************************************/
8780
String ossOutputs = 'build/outputs/oss'
88-
String defaultOutputs = 'build/outputs/default'
8981
String systemdOutputs = 'build/outputs/systemd'
9082
String transportOutputs = 'build/outputs/transport-only'
9183
String externalTestOutputs = 'build/outputs/external-test'
@@ -94,11 +86,6 @@ def processOssOutputsTaskProvider = tasks.register("processOssOutputs", Sync) {
9486
into ossOutputs
9587
}
9688

97-
def processDefaultOutputsTaskProvider = tasks.register("processDefaultOutputs", Sync) {
98-
into defaultOutputs
99-
from processOssOutputsTaskProvider
100-
}
101-
10289
def processSystemdOutputsTaskProvider = tasks.register("processSystemdOutputs", Sync) {
10390
into systemdOutputs
10491
}
@@ -126,18 +113,6 @@ tasks.register("buildOssConfig") {
126113
dependsOn "processOssOutputs"
127114
outputs.dir "${ossOutputs}/config"
128115
}
129-
def buildDefaultModulesTaskProvider = tasks.register("buildDefaultModules") {
130-
dependsOn processDefaultOutputsTaskProvider
131-
outputs.dir "${defaultOutputs}/modules"
132-
}
133-
tasks.register("buildDefaultBin") {
134-
dependsOn processDefaultOutputsTaskProvider
135-
outputs.dir "${defaultOutputs}/bin"
136-
}
137-
def buildDefaultConfigTaskProvider = tasks.register("buildDefaultConfig") {
138-
dependsOn processOssOutputsTaskProvider
139-
outputs.dir "${defaultOutputs}/config"
140-
}
141116
def buildSystemdModuleTaskProvider = tasks.register("buildSystemdModule") {
142117
dependsOn "processSystemdOutputs"
143118
outputs.dir "${systemdOutputs}/modules"
@@ -192,12 +167,6 @@ def buildOssLog4jConfigTaskProvider = tasks.register("buildOssLog4jConfig") {
192167
ext.log4jFile = file("${ossOutputs}/log4j2.properties")
193168
outputs.file log4jFile
194169
}
195-
def buildDefaultLog4jConfigTaskProvider = tasks.register("buildDefaultLog4jConfig") {
196-
dependsOn processDefaultOutputsTaskProvider
197-
ext.contents = []
198-
ext.log4jFile = file("${defaultOutputs}/log4j2.properties")
199-
outputs.file log4jFile
200-
}
201170

202171
Closure writeLog4jProperties = {
203172
String mainLog4jProperties = file('src/config/log4j2.properties').getText('UTF-8')
@@ -210,10 +179,6 @@ buildOssLog4jConfigTaskProvider.configure {
210179
doLast(writeLog4jProperties)
211180
}
212181

213-
buildDefaultLog4jConfigTaskProvider.configure {
214-
doLast(writeLog4jProperties)
215-
}
216-
217182
// copy log4j2.properties from modules that have it
218183
void copyLog4jProperties(TaskProvider buildTask, Project module) {
219184
buildTask.configure {
@@ -246,10 +211,6 @@ project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each {
246211
}
247212
File licenses = new File(module.projectDir, 'licenses')
248213
if (licenses.exists()) {
249-
buildDefaultNoticeTaskProvider.configure {
250-
licensesDir licenses
251-
source module.file('src/main/java')
252-
}
253214
buildOssNotice.configure {
254215
licensesDir licenses
255216
source module.file('src/main/java')
@@ -262,7 +223,6 @@ project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each {
262223
}
263224

264225
copyLog4jProperties(buildOssLog4jConfigTaskProvider, module)
265-
copyLog4jProperties(buildDefaultLog4jConfigTaskProvider, module)
266226

267227
restTestExpansions['expected.modules.count'] += 1
268228
}

distribution/docker/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ void addBuildDockerImage(Architecture architecture, DockerBase base) {
182182

183183
String version = VersionProperties.getOpenSearch()
184184
tags = [
185-
//TODO remove the tag and replace with OpenSearch docker tag
186-
"docker.elastic.co/elasticsearch/elasticsearch-oss:${version}",
185+
"docker.opensearch.org/opensearch/opensearch-oss:${version}",
187186
"opensearch-oss:test"
188187
]
189188
}

distribution/docker/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '3'
33
services:
44
opensearch-oss-1:
5-
image: opensearch:test
5+
image: opensearch-oss:test
66
environment:
77
- node.name=opensearch-oss-1
88
- cluster.initial_master_nodes=opensearch-oss-1,opensearch-oss-2
@@ -26,7 +26,7 @@ services:
2626
soft: -1
2727
hard: -1
2828
opensearch-oss-2:
29-
image: opensearch:test
29+
image: opensearch-oss:test
3030
environment:
3131
- node.name=opensearch-oss-2
3232
- cluster.initial_master_nodes=opensearch-oss-1,opensearch-oss-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
cd /usr/share/opensearch/bin/
3-
echo "testnode" > /tmp/password
3+
44
/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/opensearch/logs/console.log

distribution/docker/src/test/java/org/opensearch/docker/test/DockerYmlTestSuiteIT.java

+1-31
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,16 @@
1919
package org.opensearch.docker.test;
2020

2121
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
22-
import org.opensearch.OpenSearchException;
22+
import org.junit.Before;
2323
import org.opensearch.client.Request;
24-
import org.opensearch.common.io.PathUtils;
2524
import org.opensearch.common.settings.Settings;
2625
import org.opensearch.test.rest.yaml.ClientYamlTestCandidate;
2726
import org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase;
28-
import org.junit.AfterClass;
29-
import org.junit.Before;
30-
import org.junit.BeforeClass;
3127

3228
import java.io.IOException;
33-
import java.net.URISyntaxException;
34-
import java.nio.file.Files;
35-
import java.nio.file.Path;
3629

3730
public class DockerYmlTestSuiteIT extends OpenSearchClientYamlSuiteTestCase {
3831

39-
private static final String USER = "rest_user";
40-
private static final String PASS = "test-password";
41-
private static final String KEYSTORE_PASS = "testnode";
42-
4332
public DockerYmlTestSuiteIT(ClientYamlTestCandidate testCandidate) {
4433
super(testCandidate);
4534
}
@@ -83,25 +72,6 @@ public void waitForCluster() throws IOException {
8372
client().performRequest(health);
8473
}
8574

86-
static Path keyStore;
87-
88-
@BeforeClass
89-
public static void getKeyStore() {
90-
try {
91-
keyStore = PathUtils.get(DockerYmlTestSuiteIT.class.getResource("/testnode.jks").toURI());
92-
} catch (URISyntaxException e) {
93-
throw new OpenSearchException("exception while reading the store", e);
94-
}
95-
if (Files.exists(keyStore) == false) {
96-
throw new IllegalStateException("Keystore file [" + keyStore + "] does not exist.");
97-
}
98-
}
99-
100-
@AfterClass
101-
public static void clearKeyStore() {
102-
keyStore = null;
103-
}
104-
10575
@Override
10676
protected Settings restClientSettings() {
10777
return super.restClientSettings();

qa/remote-clusters/build.gradle

+3-11
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,11 @@ dependencies {
3131
testImplementation project(':client:rest-high-level')
3232
}
3333

34-
/**
35-
* TODO OpenSearch - this task is currently broken and temporarily commented out to
36-
* unblock the pre-commit.
37-
* Issue URL - https://github.com/opensearch-project/OpenSearch/issues/400
3834
opensearch_distributions {
3935
docker {
4036
type = 'docker'
4137
architecture = Architecture.current()
42-
version = VersionProperties.getElasticsearch()
38+
version = VersionProperties.getOpenSearch()
4339
failIfUnavailable = false // This ensures we skip this testing if Docker is unavailable
4440
}
4541
}
@@ -49,23 +45,19 @@ preProcessFixture {
4945
doLast {
5046
// tests expect to have an empty repo
5147
project.delete(
52-
"${buildDir}/repo",
5348
"${buildDir}/oss-repo"
5449
)
5550
createAndSetWritable(
56-
"${buildDir}/repo",
5751
"${buildDir}/oss-repo",
58-
"${buildDir}/logs/default-1",
59-
"${buildDir}/logs/default-2",
6052
"${buildDir}/logs/oss-1",
6153
"${buildDir}/logs/oss-2"
6254
)
6355
}
6456
}
65-
*/
57+
6658
dockerCompose {
6759
tcpPortsToIgnoreWhenWaiting = [9600, 9601]
68-
useComposeFiles = ['docker-compose-oss.yml']
60+
useComposeFiles = ['docker-compose.yml']
6961
}
7062

7163
def createAndSetWritable(Object... locations) {

qa/remote-clusters/docker-compose-oss.yml

-74
This file was deleted.

0 commit comments

Comments
 (0)