-
Notifications
You must be signed in to change notification settings - Fork 1
Configure cluster from yaml #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vrogach2020
merged 13 commits into
tarantool:master
from
Voloodya:congigurClusterFromYAML
Apr 27, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2e1358e
Maven dependen
6bae676
Add command cartridge setup replicasets bootstrap-vshard
0f5ace3
Add command cartridge setup replicasets bootstrap-vshard
713395e
Add cmd command cartridge setup replicasets bootstrap-vshard
865e2d5
Clear pom.xml
ba4ab9b
Clear pom.xml
cd74ac8
Code typo fix
8bd2467
Change execute command bootstrap topology
85f5c9b
Works
6970826
Refactoring
68e4da3
Refactoring
afb20f6
Refactoring. Return JUnit
e782c72
Refactoring 2
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/test/java/org/testcontainers/containers/TarantoolCartridgeContainerReplicasetsTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.testcontainers.containers; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.slf4j.LoggerFactory; | ||
import org.testcontainers.containers.output.Slf4jLogConsumer; | ||
import org.testcontainers.containers.wait.strategy.Wait; | ||
import org.testcontainers.utility.MountableFile; | ||
|
||
import java.time.Duration; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class TarantoolCartridgeContainerReplicasetsTest { | ||
|
||
@Test | ||
public void test_ClusterContainer_StartsSuccessfully_ifFilesAreCopiedUnderRoot() throws Exception { | ||
Map<String, String> buildArgs = new HashMap<String, String>() { | ||
{ | ||
put("TARANTOOL_SERVER_USER", "root"); | ||
put("TARANTOOL_SERVER_UID", "0"); | ||
put("TARANTOOL_SERVER_GROUP", "root"); | ||
put("TARANTOOL_SERVER_GID", "0"); | ||
} | ||
}; | ||
TarantoolCartridgeContainer container = | ||
new TarantoolCartridgeContainer( | ||
"Dockerfile", | ||
"testcontainers-java-tarantool:test", | ||
"cartridge/instances.yml", | ||
"cartridge/replicasets.yml", | ||
buildArgs) | ||
.withCopyFileToContainer(MountableFile.forClasspathResource("cartridge"), "/app") | ||
.withStartupTimeout(Duration.ofSeconds(300)) | ||
.withLogConsumer(new Slf4jLogConsumer( | ||
LoggerFactory.getLogger(TarantoolCartridgeContainerReplicasetsTest.class))); | ||
|
||
container.start(); | ||
CartridgeContainerTestUtils.executeProfileReplaceSmokeTest(container); | ||
if(container.isRunning()) | ||
container.stop(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
router: | ||
instances: | ||
- router | ||
roles: | ||
- failover-coordinator | ||
- vshard-router | ||
- app.roles.custom | ||
- app.roles.api_router | ||
all_rw: false | ||
s-1: | ||
instances: | ||
- s1-master | ||
roles: | ||
- vshard-storage | ||
- app.roles.api_storage | ||
weight: 1 | ||
all_rw: false | ||
vshard_group: default |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you are getting container env ?
see withArguments()
You can just use System.getenv() or default to
./tmp/run
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try use System.getenv() - this doesn't work (haven't need env).
Default to ./tmp/run - would not like use hardcore
We maybe don't pass "ENV_TARANTOOL_RUNDIR" in Argumets. This is env setup to Dockerfile.