You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by jo...@apache.org on 2018/03/23 20:50:41 UTC

aurora git commit: Fix 'PreemptorSlotSearchBenchmark', remove 'isProduction' references in benchmark

Repository: aurora
Updated Branches:
  refs/heads/master 05e78014a -> 03eb33799


Fix 'PreemptorSlotSearchBenchmark', remove 'isProduction' references in benchmark

This benchmark was using the deprecated `production` flag when building
the tasks for the cluster. `PendingTaskProcessor` depends on `tier`
instead, so this benchmark ended up not testing the correct codepath.

Removed references to `production` and added `tier` instead.
Additionally, removed some unused options.

Reviewed at https://reviews.apache.org/r/66190/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/03eb3379
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/03eb3379
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/03eb3379

Branch: refs/heads/master
Commit: 03eb337998b5c394a3f6238922b4701b20fb392b
Parents: 05e7801
Author: Jordan Ly <jo...@gmail.com>
Authored: Fri Mar 23 13:30:41 2018 -0700
Committer: Jordan Ly <jl...@twitter.com>
Committed: Fri Mar 23 13:30:54 2018 -0700

----------------------------------------------------------------------
 .../aurora/benchmark/BenchmarkSettings.java     | 23 ++------------------
 .../aurora/benchmark/SchedulingBenchmarks.java  | 14 ++++++------
 .../java/org/apache/aurora/benchmark/Tasks.java |  8 +++----
 3 files changed, 13 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/03eb3379/src/jmh/java/org/apache/aurora/benchmark/BenchmarkSettings.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/BenchmarkSettings.java b/src/jmh/java/org/apache/aurora/benchmark/BenchmarkSettings.java
index ddab2ec..c15b756 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/BenchmarkSettings.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/BenchmarkSettings.java
@@ -27,26 +27,23 @@ final class BenchmarkSettings {
   private final Set<IHostAttributes> hostAttributes;
   private final double siblingClusterUtilization;
   private final double victimClusterUtilization;
-  private final boolean allVictimsEligibleForPreemption;
   private final Set<IScheduledTask> tasks;
 
   private BenchmarkSettings(
       double siblingClusterUtilization,
       double victimClusterUtilization,
-      boolean allVictimsEligibleForPreemption,
       Set<IHostAttributes> hostAttributes,
       Set<IScheduledTask> tasks) {
 
     this.siblingClusterUtilization = siblingClusterUtilization;
     this.victimClusterUtilization = victimClusterUtilization;
-    this.allVictimsEligibleForPreemption = allVictimsEligibleForPreemption;
     this.hostAttributes = requireNonNull(hostAttributes);
     this.tasks = requireNonNull(tasks);
   }
 
   /**
    * Gets the cluster utilization factor specifying what percentage of hosts in the cluster
-   * already have a job instance assigned to them as used during the scheduling benchmark.
+   * already have a job instance assigned to them.
    *
    * @return Cluster utilization (default: 0.25).
    */
@@ -56,7 +53,7 @@ final class BenchmarkSettings {
 
   /**
    * Gets the cluster utilization factor specifying what percentage of hosts in the cluster
-   * have a task of a foreign job assigned to them, i.e. potential preemption victims.
+   * already have a foreign (different role) preemptible job instance assigned to them.
    *
    * @return Cluster utilization (default: 0.25).
    */
@@ -65,15 +62,6 @@ final class BenchmarkSettings {
   }
 
   /**
-   * Flag indicating whether all existing assigned tasks are available for preemption.
-   *
-   * @return Victim preemption eligibility (default: false).
-   */
-  boolean areAllVictimsEligibleForPreemption() {
-    return allVictimsEligibleForPreemption;
-  }
-
-  /**
    * Gets a set of cluster host attributes.
    *
    * @return Set of {@link IHostAttributes}.
@@ -94,7 +82,6 @@ final class BenchmarkSettings {
   static class Builder {
     private double siblingClusterUtilization = 0.25;
     private double victimClusterUtilization = 0.25;
-    private boolean allVictimsEligibleForPreemption;
     private Set<IHostAttributes> hostAttributes;
     private Set<IScheduledTask> tasks;
 
@@ -108,11 +95,6 @@ final class BenchmarkSettings {
       return this;
     }
 
-    Builder setVictimPreemptionEligibilty(boolean newPreemptionEligibility) {
-      allVictimsEligibleForPreemption = newPreemptionEligibility;
-      return this;
-    }
-
     Builder setHostAttributes(Set<IHostAttributes> newHostAttributes) {
       hostAttributes = newHostAttributes;
       return this;
@@ -127,7 +109,6 @@ final class BenchmarkSettings {
       return new BenchmarkSettings(
           siblingClusterUtilization,
           victimClusterUtilization,
-          allVictimsEligibleForPreemption,
           hostAttributes,
           tasks);
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/03eb3379/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
index 1f9a576..80b45a9 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/SchedulingBenchmarks.java
@@ -220,10 +220,11 @@ public class SchedulingBenchmarks {
       int numVictimTasks = (int) Math.round(numOffers * settings.getVictimClusterUtilization());
       return Sets.union(
         new Tasks.Builder()
+          .setTier(TaskTestUtil.PROD_TIER_NAME)
           .build(numSiblingTasks),
         new Tasks.Builder()
           .setRole("victim")
-          .setProduction(!settings.areAllVictimsEligibleForPreemption())
+          .setTier(TaskTestUtil.DEV_TIER_NAME)
           .build(numVictimTasks));
     }
 
@@ -310,7 +311,7 @@ public class SchedulingBenchmarks {
       return new BenchmarkSettings.Builder()
           .setHostAttributes(new Hosts.Builder().setNumHostsPerRack(2).build(1000))
           .setTasks(new Tasks.Builder()
-              .setProduction(true)
+              .setTier(TaskTestUtil.PROD_TIER_NAME)
               .setCpu(32)
               .build(1)).build();
     }
@@ -325,7 +326,7 @@ public class SchedulingBenchmarks {
       return new BenchmarkSettings.Builder()
           .setHostAttributes(new Hosts.Builder().setNumHostsPerRack(2).build(1000))
           .setTasks(new Tasks.Builder()
-              .setProduction(true)
+              .setTier(TaskTestUtil.PROD_TIER_NAME)
               .addValueConstraint("host", "denied")
               .build(1)).build();
     }
@@ -340,7 +341,7 @@ public class SchedulingBenchmarks {
       return new BenchmarkSettings.Builder()
           .setHostAttributes(new Hosts.Builder().setNumHostsPerRack(2).build(1000))
           .setTasks(new Tasks.Builder()
-              .setProduction(true)
+              .setTier(TaskTestUtil.PROD_TIER_NAME)
               .addLimitConstraint("host", 0)
               .build(1)).build();
     }
@@ -356,10 +357,9 @@ public class SchedulingBenchmarks {
       return new BenchmarkSettings.Builder()
           .setSiblingClusterUtilization(0.1)
           .setVictimClusterUtilization(0.9)
-          .setVictimPreemptionEligibilty(true)
           .setHostAttributes(new Hosts.Builder().setNumHostsPerRack(2).build(10000))
           .setTasks(new Tasks.Builder()
-              .setProduction(true)
+              .setTier(TaskTestUtil.PROD_TIER_NAME)
               .addLimitConstraint("host", 0)
               .build(1)).build();
     }
@@ -387,7 +387,7 @@ public class SchedulingBenchmarks {
           .setVictimClusterUtilization(0.9)
           .setHostAttributes(new Hosts.Builder().setNumHostsPerRack(2).build(10000))
           .setTasks(new Tasks.Builder()
-              .setProduction(true)
+              .setTier(TaskTestUtil.PROD_TIER_NAME)
               .addValueConstraint("host", "denied")
               .build(numPendingTasks)).build();
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/03eb3379/src/jmh/java/org/apache/aurora/benchmark/Tasks.java
----------------------------------------------------------------------
diff --git a/src/jmh/java/org/apache/aurora/benchmark/Tasks.java b/src/jmh/java/org/apache/aurora/benchmark/Tasks.java
index 60c62bb..a5b6b45 100644
--- a/src/jmh/java/org/apache/aurora/benchmark/Tasks.java
+++ b/src/jmh/java/org/apache/aurora/benchmark/Tasks.java
@@ -51,7 +51,7 @@ final class Tasks {
    */
   static final class Builder {
     private JobKey jobKey = new JobKey("jmh", "dev", "benchmark");
-    private boolean isProduction = false;
+    private String tier = TaskTestUtil.DEV_TIER_NAME;
     private double cpu = 6.0;
     private Amount<Long, Data> ram = Amount.of(8L, Data.GB);
     private Amount<Long, Data> disk = Amount.of(128L, Data.GB);
@@ -95,8 +95,8 @@ final class Tasks {
       return this;
     }
 
-    Builder setProduction(boolean newProduction) {
-      isProduction = newProduction;
+    Builder setTier(String newTier) {
+      tier = newTier;
       return this;
     }
 
@@ -144,7 +144,7 @@ final class Tasks {
         builder.getAssignedTask().setAssignedPorts(ImmutableMap.of());
         builder.getAssignedTask().getTask()
             .setConstraints(constraints.build())
-            .setProduction(isProduction)
+            .setTier(tier)
             .setResources(ImmutableSet.of(
                 numCpus(cpu),
                 ramMb(ram.as(Data.MB)),