Skip to content

Commit

Permalink
Fix libmesos (#393)
Browse files Browse the repository at this point in the history
* Upgraded libmesos bundle to 1.8.7-1.0.2-2

* Fixed LD_LIBRARY_PATH

* Fixed ClusterTaskOfferRequirementProviderTest, which assumes a certain ordering of the URIs.

* Sorted the test URIs.
  • Loading branch information
susanxhuynh authored and gabrielhartmann committed Feb 2, 2017
1 parent 90bb4f4 commit ebde7d0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void serializeDeserializeExecutorConfig() throws Exception {
(CassandraSchedulerConfiguration)configurationManager.getTargetConfig();

ExecutorConfig expectedExecutorConfig = new ExecutorConfig(
"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml",
"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml",
new ArrayList<>(),
0.1,
768,
Expand All @@ -253,7 +253,7 @@ public void serializeDeserializeExecutorConfig() throws Exception {
URI.create("https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz"),
URI.create("https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip"),
URI.create("https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin.tar.gz"),
URI.create("http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz"),
URI.create("http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz"),
false);

manager.start();
Expand Down
4 changes: 2 additions & 2 deletions cassandra-commons/src/test/resources/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
arguments : ${EXECUTOR_ARGS:-[]}
cpus : ${EXECUTOR_CPUS:-0.1}
memory_mb : ${EXECUTOR_MEMORY_MB:-768}
Expand All @@ -9,7 +9,7 @@ executor:
jre_location : ${EXECUTOR_JRE_LOCATION:-'https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz'}
executor_location : ${EXECUTOR_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip'}
cassandra_location : ${EXECUTOR_CASSANDRA_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz'}
cache_fetched_uris: ${EXECUTOR_CACHE_FETCHED_URIS:-false}
cluster_task:
cpus: ${CLUSTER_TASK_CPUS:-1}
Expand Down
4 changes: 2 additions & 2 deletions cassandra-executor/src/test/resources/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
arguments : ${EXECUTOR_ARGS:-[]}
cpus : ${EXECUTOR_CPUS:-0.1}
memory_mb : ${EXECUTOR_MEMORY_MB:-768}
Expand All @@ -9,7 +9,7 @@ executor:
jre_location : ${EXECUTOR_JRE_LOCATION:-'https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz'}
executor_location : ${EXECUTOR_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip'}
cassandra_location : ${EXECUTOR_CASSANDRA_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz'}
cache_fetched_uris: ${EXECUTOR_CACHE_FETCHED_URIS:-false}
cluster_task:
cpus: ${CLUSTER_TASK_CPUS:-1}
Expand Down
4 changes: 2 additions & 2 deletions cassandra-scheduler/src/dist/conf/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
arguments : ${EXECUTOR_ARGS:-[]}
cpus : ${EXECUTOR_CPUS:-0.1}
memory_mb : ${EXECUTOR_MEMORY_MB:-768}
Expand All @@ -9,7 +9,7 @@ executor:
jre_location : ${EXECUTOR_JRE_LOCATION:-'https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz'}
executor_location : ${EXECUTOR_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip'}
cassandra_location : ${EXECUTOR_CASSANDRA_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz'}
cache_fetched_uris: ${EXECUTOR_CACHE_FETCHED_URIS:-false}
cluster_task:
cpus: ${CLUSTER_TASK_CPUS:-1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.*;
import org.mockito.Mockito;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

Expand Down Expand Up @@ -235,18 +236,21 @@ public void testGetNewOfferRequirement() throws Exception {

Protos.CommandInfo cmd = executorInfo.getCommand();
Assert.assertEquals(4, cmd.getUrisList().size());
Assert.assertEquals(
config.getExecutorConfig().getExecutorLocation().toString(),
cmd.getUrisList().get(0).getValue());
Assert.assertEquals(
config.getExecutorConfig().getCassandraLocation().toString(),
cmd.getUrisList().get(1).getValue());

List<Protos.CommandInfo.URI> urisList = new ArrayList<>(cmd.getUrisList());
urisList.sort((a, b) -> a.getValue().compareTo(b.getValue()));
Assert.assertEquals(
config.getExecutorConfig().getLibmesosLocation().toString(),
cmd.getUrisList().get(2).getValue());
urisList.get(0).getValue());
Assert.assertEquals(
config.getExecutorConfig().getJreLocation().toString(),
cmd.getUrisList().get(3).getValue());
urisList.get(1).getValue());
Assert.assertEquals(
config.getExecutorConfig().getCassandraLocation().toString(),
urisList.get(2).getValue());
Assert.assertEquals(
config.getExecutorConfig().getExecutorLocation().toString(),
urisList.get(3).getValue());
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions cassandra-scheduler/src/test/resources/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
arguments : ${EXECUTOR_ARGS:-[]}
cpus : ${EXECUTOR_CPUS:-0.1}
memory_mb : ${EXECUTOR_MEMORY_MB:-768}
Expand All @@ -9,7 +9,7 @@ executor:
jre_location : ${EXECUTOR_JRE_LOCATION:-'https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz'}
executor_location : ${EXECUTOR_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip'}
cassandra_location : ${EXECUTOR_CASSANDRA_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz'}
cluster_task:
cpus: ${CLUSTER_TASK_CPUS:-1}
memory_mb: ${CLUSTER_TASK_MEMORY_MB:-256}
Expand Down
4 changes: 2 additions & 2 deletions cassandra-scheduler/src/test/resources/update-scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
command : ${EXECUTOR_COMMAND:-"export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && ./executor/bin/cassandra-executor server executor/conf/executor.yml"}
arguments : ${EXECUTOR_ARGS:-[]}
cpus : ${EXECUTOR_CPUS:-0.1}
memory_mb : ${EXECUTOR_MEMORY_MB:-768}
Expand All @@ -9,7 +9,7 @@ executor:
jre_location : ${EXECUTOR_JRE_LOCATION:-'https://downloads.mesosphere.com/java/jre-8u121-linux-x64.tar.gz'}
executor_location : ${EXECUTOR_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/executor.zip'}
cassandra_location : ${EXECUTOR_CASSANDRA_LOCATION:-'https://s3-us-west-2.amazonaws.com/cassandra-framework-dev/testing/apache-cassandra-2.2.5-bin-updated.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2.tar.gz'}
libmesos_location: ${EXECUTOR_LIBMESOS_LOCATION:-'http://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.8.7-1.0.2-2.tar.gz'}
cache_fetched_uris: ${EXECUTOR_CACHE_FETCHED_URIS:-false}
cluster_task:
cpus: ${CLUSTER_TASK_CPUS:-1}
Expand Down
2 changes: 1 addition & 1 deletion universe/marathon.json.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "/{{service.name}}",
"cmd": "env && export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && env && ./scheduler/bin/cassandra-scheduler server ./scheduler/conf/scheduler.yml",
"cmd": "env && export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH && export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so) && env && ./scheduler/bin/cassandra-scheduler server ./scheduler/conf/scheduler.yml",
"instances": 1,
"cpus": {{service.cpus}},
"mem": {{service.mem}},
Expand Down

0 comments on commit ebde7d0

Please sign in to comment.