Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
fix: setup can again also run locally for debugging use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianLegler committed Feb 4, 2022
1 parent 91542c2 commit b3d12b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/main/java/berlin/tu/csb/controller/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void main(String[] args) {
System.out.println("Present Project Directory : "+ System.getProperty("user.dir"));


if(args[0] != null && args[0].equals("run")) {
if(args.length > 0 && args[0] != null && args[0].equals("run")) {
if(args.length != 5) {
System.out.println("Number of run arguments are not correct. Fallback to local execution mode.");
System.out.printf("Correct usage of parameters:%n 1 - run %n 2 - server adress%n 3 - seed for pseudo generator as long%n 4 - run time of benchmark in minutes%n 5 - amount of threads to run%n");
Expand All @@ -57,7 +57,7 @@ public static void main(String[] args) {
threadCount = Integer.parseInt(args[4]);
}
}
else if (args[0] != null && args[0].equals("load")) {
else if (args.length > 0 && args[0] != null && args[0].equals("load")) {
runOrLoad = "load";
if(args.length != 6) {
System.out.println("Number of run arguments are not correct. Fallback to local execution mode.");
Expand All @@ -78,6 +78,15 @@ else if (args[0] != null && args[0].equals("load")) {
dbItemInsertsLoadPhase = Integer.parseInt(args[4]);
threadCount = Integer.parseInt(args[5]);
}
} else {
try {
String content = new String(Files.readAllBytes(Paths.get(System.getProperty("user.dir")+"\\terraform\\public_ip.csv")));
serverAddresses = content.split(",");
} catch (IOException e) {
System.out.println("public_ip.csv not present. Are the servers set up correctly?");
e.printStackTrace();
System.exit(1);
}
}


Expand Down
3 changes: 1 addition & 2 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ variable "gcp_service_account_path" {}
variable "gcp_project_id" {}
variable "gcp_account_email" {}
variable "gcp_region" { default = "europe-west3" }
#variable "gcp_availability_zones" { default = ["europe-west3-a", "europe-west3-b", "europe-west3-c"] } # 3 suts
variable "gcp_availability_zones" { default = ["europe-west3-a", "europe-west3-b", "europe-west3-c", "europe-west3-a", "europe-west3-b", "europe-west3-c", "europe-west3-a", "europe-west3-b", "europe-west3-c"] } # 6 suts
variable "gcp_availability_zones" { default = ["europe-west3-a", "europe-west3-b", "europe-west3-c", "europe-west3-a", "europe-west3-b", "europe-west3-c", "europe-west3-a", "europe-west3-b", "europe-west3-c"] } # up to 9 suts


// Deployment variables
Expand Down

0 comments on commit b3d12b2

Please sign in to comment.