You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by zm...@apache.org on 2015/01/31 01:28:42 UTC

incubator-aurora git commit: Revert backwards incomaptible chnages to GC ExecutorInfo.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master c73912240 -> 7fbe5bb08


Revert backwards incomaptible chnages to GC ExecutorInfo.

The Docker patch (7ba6226) started to set the shell attribute of of
ExecutorInfo. This breaks backwards compatability for the GC executor as it will
continue to have the same id but different info now. In addition it is not
necessary to set this value because it defaults to true.

Testing Done:
./gradlew build -Pq

Bugs closed: AURORA-1076

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


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

Branch: refs/heads/master
Commit: 7fbe5bb0828e1066166d969b32313a558f972fa5
Parents: c739122
Author: Zameer Manji <zm...@apache.org>
Authored: Fri Jan 30 16:27:58 2015 -0800
Committer: Zameer Manji <zm...@apache.org>
Committed: Fri Jan 30 16:27:58 2015 -0800

----------------------------------------------------------------------
 .../apache/aurora/scheduler/base/CommandUtil.java |  4 +---
 .../aurora/scheduler/base/CommandUtilTest.java    | 18 ++++++++++++++++--
 .../scheduler/mesos/MesosTaskFactoryImplTest.java |  2 --
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/7fbe5bb0/src/main/java/org/apache/aurora/scheduler/base/CommandUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/CommandUtil.java b/src/main/java/org/apache/aurora/scheduler/base/CommandUtil.java
index 493ba81..7f166e2 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/CommandUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/CommandUtil.java
@@ -101,8 +101,6 @@ public final class CommandUtil {
     String cmdLine = commandBasePath
         + uriBasename(executorUri)
         + " " + extraArguments.or("");
-    return builder
-        .setValue(cmdLine.trim())
-        .setShell(true);
+    return builder.setValue(cmdLine.trim());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/7fbe5bb0/src/test/java/org/apache/aurora/scheduler/base/CommandUtilTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/base/CommandUtilTest.java b/src/test/java/org/apache/aurora/scheduler/base/CommandUtilTest.java
index 7bbc7a0..ec43a44 100644
--- a/src/test/java/org/apache/aurora/scheduler/base/CommandUtilTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/base/CommandUtilTest.java
@@ -17,10 +17,10 @@ import java.util.Map;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import com.google.protobuf.TextFormat;
 
 import org.apache.mesos.Protos.CommandInfo;
 import org.apache.mesos.Protos.CommandInfo.URI;
-
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -65,11 +65,25 @@ public class CommandUtilTest {
     CommandUtil.create("", ImmutableList.<String>of());
   }
 
+  @Test
+  public void testBackwardsCompatibility() {
+    // This test ensures if we specify just a URI and no other resources that we get the same
+    // executorInfo. The ExecutorInfo needs to remain constant because Mesos will reject executors
+    // with the same id but different executorInfo. See MESOS-2309 for more details. This is
+    // required because Aurora's GC executor has a constant id.
+
+    String uri = "/usr/local/bin/gc_executor";
+    String expectedValue = "uris { value: \"/usr/local/bin/gc_executor\" "
+        + "executable: true } value: \"./gc_executor\"";
+    CommandInfo actual = CommandUtil.create(uri, ImmutableList.<String>of());
+
+    assertEquals(expectedValue, TextFormat.shortDebugString(actual));
+  }
+
   private void test(String basename, String uri, Map<String, String> env) {
     CommandInfo expectedCommand = CommandInfo.newBuilder()
         .addUris(URI.newBuilder().setValue(uri).setExecutable(true))
         .setValue("./" + basename)
-        .setShell(true)
         .build();
     assertEquals(expectedCommand, CommandUtil.create(uri, ImmutableList.<String>of()));
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/7fbe5bb0/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java b/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
index ce3bea5..5f08d00 100644
--- a/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/mesos/MesosTaskFactoryImplTest.java
@@ -78,7 +78,6 @@ public class MesosTaskFactoryImplTest {
       .addAllResources(MesosTaskFactoryImpl.RESOURCES_EPSILON.toResourceList())
       .setCommand(CommandInfo.newBuilder()
           .setValue("./executor.pex")
-          .setShell(true)
           .addUris(URI.newBuilder().setValue(NO_OVERHEAD_EXECUTOR.getExecutorPath())
               .setExecutable(true)))
       .build();
@@ -87,7 +86,6 @@ public class MesosTaskFactoryImplTest {
       ExecutorInfo.newBuilder(DEFAULT_EXECUTOR)
           .setCommand(CommandInfo.newBuilder()
               .setValue("./executor_wrapper.sh")
-              .setShell(true)
               .addUris(URI.newBuilder().setValue(NO_OVERHEAD_EXECUTOR.getExecutorPath())
                   .setExecutable(true))
               .addUris(URI.newBuilder().setValue(EXECUTOR_WRAPPER_PATH).setExecutable(true)))