From b797e4f8590dc5812e6a1260e39b6e9d12808320 Mon Sep 17 00:00:00 2001 From: Chris Helma <25470211+chelma@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:56:20 -0500 Subject: [PATCH] Fixed a few bugs in the gradle setup for rfs (#736) * Fixed a few bugs in the gradle setup for rfs Signed-off-by: Chris Helma * Switched RFS Docker Compose back to ES 7.10 Signed-off-by: Chris Helma --------- Signed-off-by: Chris Helma --- RFS/build-preloaded-source-image.gradle | 9 ++++----- RFS/build.gradle | 3 ++- RFS/docker/TestSource_ES_7_10/container-start.sh | 6 +++--- RFS/docker/TestSource_ES_7_17/container-start.sh | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/RFS/build-preloaded-source-image.gradle b/RFS/build-preloaded-source-image.gradle index b0b25b3fa..8138bd459 100644 --- a/RFS/build-preloaded-source-image.gradle +++ b/RFS/build-preloaded-source-image.gradle @@ -23,11 +23,10 @@ def createNetworkTask = task createNetwork(type: Exec) { } } task createInitialElasticsearchContainer(type: DockerCreateContainer) { - dependsOn createNetwork, buildDockerImage_emptyElasticsearchSource_7_17 - targetImageId 'migrations/emptyElasticsearchSource_7_17:latest' + dependsOn createNetwork, buildDockerImage_emptyElasticsearchSource_7_10 + targetImageId 'migrations/empty_elasticsearch_source_7_10:latest' containerName = "elasticsearch-${uniqueId}" hostConfig.network = myNetworkName - hostConfig.dns = ['elasticsearch'] networkAliases = ['elasticsearch'] hostName = 'elasticsearch' } @@ -64,14 +63,14 @@ def sourceContainerCommitTask = task commitSourceContainer() { def containerId = createInitialElasticsearchContainer.getContainerId().get() client.commitCmd(containerId) - .withRepository("elasticsearch_rfs_source") + .withRepository("migrations/elasticsearch_rfs_source") .withTag("latest") .exec() } } task removeClientContainer(type: DockerRemoveContainer) { - dependsOn waitClientContainer + dependsOn commitSourceContainer targetContainerId createClientContainer.getContainerId() } startClientTask.finalizedBy(removeClientContainer) diff --git a/RFS/build.gradle b/RFS/build.gradle index c0609058d..e03c2445b 100644 --- a/RFS/build.gradle +++ b/RFS/build.gradle @@ -78,7 +78,7 @@ dependencies { } application { - mainClassName = 'com.rfs.ReindexFromSnapshot' + mainClassName = 'com.rfs.RfsMigrateDocuments' } task runRfsWorker (type: JavaExec) { @@ -180,6 +180,7 @@ task buildDockerImages { for (dockerService in dockerServices) { dependsOn "buildDockerImage_${dockerService.projectName}" } + dependsOn buildDockerImage_elasticsearchRFSSource } tasks.named("buildDockerImage_elasticsearchRFSSource") { diff --git a/RFS/docker/TestSource_ES_7_10/container-start.sh b/RFS/docker/TestSource_ES_7_10/container-start.sh index b2507c11c..854079c5b 100755 --- a/RFS/docker/TestSource_ES_7_10/container-start.sh +++ b/RFS/docker/TestSource_ES_7_10/container-start.sh @@ -2,11 +2,11 @@ echo "Setting AWS Creds from ENV Variables" bin/elasticsearch-keystore create -echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add s3.client.default.access_key --stdin -echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add s3.client.default.secret_key --stdin +echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add --stdin s3.client.default.access_key --force +echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add --stdin s3.client.default.secret_key --force if [ -n "$AWS_SESSION_TOKEN" ]; then - echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add s3.client.default.session_token --stdin + echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add --stdin s3.client.default.session_token --force fi echo "Starting Elasticsearch" diff --git a/RFS/docker/TestSource_ES_7_17/container-start.sh b/RFS/docker/TestSource_ES_7_17/container-start.sh index b2507c11c..854079c5b 100755 --- a/RFS/docker/TestSource_ES_7_17/container-start.sh +++ b/RFS/docker/TestSource_ES_7_17/container-start.sh @@ -2,11 +2,11 @@ echo "Setting AWS Creds from ENV Variables" bin/elasticsearch-keystore create -echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add s3.client.default.access_key --stdin -echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add s3.client.default.secret_key --stdin +echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add --stdin s3.client.default.access_key --force +echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add --stdin s3.client.default.secret_key --force if [ -n "$AWS_SESSION_TOKEN" ]; then - echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add s3.client.default.session_token --stdin + echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add --stdin s3.client.default.session_token --force fi echo "Starting Elasticsearch"