Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .test-infra/jenkins/job_PerformanceTests_MongoDBIO_IT.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ String jobName = "beam_PerformanceTests_MongoDBIO_IT"

job(jobName) {
common.setTopLevelMainJobProperties(delegate)
common.setAutoJob(delegate,'H H/6 * * *')
common.setAutoJob(delegate,'H H/12 * * *')
common.enablePhraseTriggeringFromPullRequest(
delegate,
'Java MongoDBIO Performance Test',
Expand All @@ -51,6 +51,8 @@ job(jobName) {
mongoDBDatabaseName : 'beam',
mongoDBHostName : "\$${mongoHostName}",
mongoDBPort : 27017,
mongoDBUsername : 'root',
mongoDBPassword : 'uuinkkS',
runner : 'DataflowRunner',
autoscalingAlgorithm: 'NONE',
numWorkers : '5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ String jobName = "beam_python_mongoio_load_test"

job(jobName) {
common.setTopLevelMainJobProperties(delegate)
common.setAutoJob(delegate, 'H H/6 * * *')
common.setAutoJob(delegate, 'H H/12 * * *')
common.enablePhraseTriggeringFromPullRequest(
delegate,
'Python MongoDBIO Load Test',
Expand All @@ -40,7 +40,7 @@ job(jobName) {
temp_location: 'gs://temp-storage-for-perf-tests/loadtests',
project : 'apache-beam-testing',
region : 'us-central1',
mongo_uri : "mongodb://\$${mongoHostName}:27017",
mongo_uri : "mongodb://root:uuinkkS@\$${mongoHostName}:27017",
num_documents: '1000000',
batch_size : '10000',
runner : 'DataflowRunner',
Expand Down
5 changes: 5 additions & 0 deletions .test-infra/kubernetes/mongodb/load-balancer/mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ spec:
containers:
- name: mongo
image: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: MONGO_INITDB_ROOT_PASSWORD
value: uuinkkS
ports:
- containerPort: 27017
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Set;
import java.util.UUID;
import java.util.function.Function;
import org.apache.beam.repackaged.core.org.apache.commons.lang3.StringUtils;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.io.GenerateSequence;
import org.apache.beam.sdk.io.common.HashingFn;
Expand Down Expand Up @@ -108,6 +109,20 @@ public interface MongoDBPipelineOptions extends IOTestPipelineOptions {
String getMongoDBDatabaseName();

void setMongoDBDatabaseName(String name);

@Description("Username for mongodb server")
@Default.String("")
String getMongoDBUsername();

void setMongoDBUsername(String name);

// Note that passwords are not as secure an authentication as other methods, and used here for
// a test environment only.
@Description("Password for mongodb server")
@Default.String("")
String getMongoDBPassword();

void setMongoDBPassword(String value);
}

private static final Map<Integer, String> EXPECTED_HASHES =
Expand All @@ -127,8 +142,23 @@ public static void setUp() {
PipelineOptionsFactory.register(MongoDBPipelineOptions.class);
options = TestPipeline.testingPipelineOptions().as(MongoDBPipelineOptions.class);
collection = String.format("test_%s", new Date().getTime());
mongoUrl =
String.format("mongodb://%s:%s", options.getMongoDBHostName(), options.getMongoDBPort());
if (StringUtils.isEmpty(options.getMongoDBUsername())) {
mongoUrl =
String.format("mongodb://%s:%s", options.getMongoDBHostName(), options.getMongoDBPort());
} else if (StringUtils.isEmpty(options.getMongoDBPassword())) {
mongoUrl =
String.format(
"mongodb://%s@%s:%s",
options.getMongoDBUsername(), options.getMongoDBHostName(), options.getMongoDBPort());
} else {
mongoUrl =
String.format(
"mongodb://%s:%s@%s:%s",
options.getMongoDBUsername(),
options.getMongoDBPassword(),
options.getMongoDBHostName(),
options.getMongoDBPort());
}
mongoClient = MongoClients.create(mongoUrl);
settings =
InfluxDBSettings.builder()
Expand Down