Skip to content

Commit

Permalink
Fixed a few bugs in the gradle setup for rfs (#736)
Browse files Browse the repository at this point in the history
* Fixed a few bugs in the gradle setup for rfs

Signed-off-by: Chris Helma <chelma+github@amazon.com>

* Switched RFS Docker Compose back to ES 7.10

Signed-off-by: Chris Helma <chelma+github@amazon.com>

---------

Signed-off-by: Chris Helma <chelma+github@amazon.com>
  • Loading branch information
chelma authored Jun 19, 2024
1 parent 4f59ac8 commit b797e4f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
9 changes: 4 additions & 5 deletions RFS/build-preloaded-source-image.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion RFS/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dependencies {
}

application {
mainClassName = 'com.rfs.ReindexFromSnapshot'
mainClassName = 'com.rfs.RfsMigrateDocuments'
}

task runRfsWorker (type: JavaExec) {
Expand Down Expand Up @@ -180,6 +180,7 @@ task buildDockerImages {
for (dockerService in dockerServices) {
dependsOn "buildDockerImage_${dockerService.projectName}"
}
dependsOn buildDockerImage_elasticsearchRFSSource
}

tasks.named("buildDockerImage_elasticsearchRFSSource") {
Expand Down
6 changes: 3 additions & 3 deletions RFS/docker/TestSource_ES_7_10/container-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions RFS/docker/TestSource_ES_7_17/container-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b797e4f

Please sign in to comment.