Skip to content

Commit

Permalink
Merge branch 'master' into mute_ip_detect_script_test
Browse files Browse the repository at this point in the history
  • Loading branch information
sschneid committed May 15, 2018
2 parents 0050648 + cc43d2c commit ac2cc2c
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 31 deletions.
2 changes: 0 additions & 2 deletions CHANGES.md
Expand Up @@ -54,6 +54,4 @@ Format of the entries must be.

* Updated Metronome to 0.5.0. (DCOS_OSS-2338)

* Updated REX-Ray to v0.11.2. (DCOS_OSS-2245)

* Updated OTP version to 20.3.2 (DCOS_OSS-2378)
11 changes: 9 additions & 2 deletions packages/mesos/README.md
@@ -1,3 +1,10 @@
<h2>Patches to cherry-pick on top of open source Apache Mesos before building in DC/OS</h2>
<h2>Mesos Patches</h2>

See [patches.json](patches.json) for the list of patches.
We need to apply some patches on top of upstream Apache Mesos before building in
DC/OS. The patches are stored in the [extra/patches] directory and applied as part of [build] script.

Here are the instructions to add/remove/update one or more patches:
* Checkout the upstream Mesos SHA.
* Apply all the cherry-picks that you need.
* Create patch files using `git format-patch -N <upstream-SHA>`
* Replace existing files in [extra/patches] with the new patch files.
6 changes: 6 additions & 0 deletions packages/mesos/build
Expand Up @@ -3,6 +3,12 @@ libdir="$PKG_PATH/lib"

# TODO(cmaloney): Check prerequisites installed (glog, protobuf, boost)
pushd "/pkg/src/mesos"

# Apply patches from packages/mesos/patch directory. All patches are numbered
for patch in /pkg/extra/patches/*; do
git -c user.name="Mesosphere CI" -c user.email="mesosphere-ci@users.noreply.github.com" am $patch
done

./bootstrap

mkdir -p build
Expand Down
6 changes: 3 additions & 3 deletions packages/mesos/buildinfo.json
Expand Up @@ -2,9 +2,9 @@
"requires": ["openssl", "libevent", "curl", "boost-libs"],
"single_source" : {
"kind": "git",
"git": "https://github.com/mesosphere/mesos",
"ref": "97de6eea9ad70f700082f70cd8d2584e199186df",
"ref_origin" : "dcos-mesos-master-e91ce42ed"
"git": "https://github.com/apache/mesos",
"ref": "a1c6a7a3c54518f97a34f28b1792885b928b948c",
"ref_origin" : "master"
},
"environment": {
"JAVA_LIBRARY_PATH": "/opt/mesosphere/lib",
Expand Down
@@ -0,0 +1,28 @@
From 0f762c15455900083f7a3f72c6cdc60a418ec12f Mon Sep 17 00:00:00 2001
From: Michael Park <mpark@apache.org>
Date: Thu, 15 Oct 2015 19:54:02 -0700
Subject: [PATCH] Set LIBPROCESS_IP into docker container.

---
src/docker/docker.cpp | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index d000a902f..f639625f3 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -658,6 +658,11 @@ Try<Docker::RunOptions> Docker::RunOptions::create(
options.env["MESOS_SANDBOX"] = mappedDirectory;
options.env["MESOS_CONTAINER_NAME"] = name;

+ Option<string> libprocessIP = os::getenv("LIBPROCESS_IP");
+ if (libprocessIP.isSome()) {
+ options.env["LIBPROCESS_IP"] = libprocessIP.get();
+ }
+
Option<string> volumeDriver;
foreach (const Volume& volume, containerInfo.volumes()) {
// The 'container_path' can be either an absolute path or a
--
2.16.3

@@ -0,0 +1,54 @@
From b6d7b1f3ca61a536132b3e973c32dd695e181005 Mon Sep 17 00:00:00 2001
From: Armand Grillet <armand.grillet@outlook.com>
Date: Wed, 28 Feb 2018 21:00:24 +0100
Subject: [PATCH] Mesos UI: updated the URL generation to make it work with
adminrouter.

- Use /mesos/agent/{agent_id}/{process_name} as the agent URL prefix.
- Redirect from Mesos webui location (host:5050) to adminrouter
(host/mesos).
---
src/webui/app/controllers.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/webui/app/controllers.js b/src/webui/app/controllers.js
index 7c228a162..81008052b 100644
--- a/src/webui/app/controllers.js
+++ b/src/webui/app/controllers.js
@@ -51,10 +51,9 @@
// (e.g., hosting '/slave/log' for each agent log, we don't
// namespace metrics within '/metrics/snapshot', etc).
function agentURLPrefix(agent, includeProcessId) {
- var port = agent.pid.substring(agent.pid.lastIndexOf(':') + 1);
var processId = agent.pid.substring(0, agent.pid.indexOf('@'));

- var url = '//' + agent.hostname + ':' + port;
+ var url = '/agent/' + agent.id;

if (includeProcessId) {
url += '/' + processId;
@@ -372,6 +371,12 @@
mesosApp.controller('MainCtrl', [
'$scope', '$http', '$location', '$timeout', '$modal',
function($scope, $http, $location, $timeout, $modal) {
+ // Redirect from the direct Mesos webui URL to the DC/OS URL that goes through adminrouter.
+ if ($location.port() === 5050) {
+ var url = $location.protocol() + "://" + $location.host() + "/mesos";
+ window.location = url;
+ }
+
$scope.doneLoading = true;

// Adding bindings into scope so that they can be used from within
@@ -554,7 +559,7 @@
var update = function() {
$scope.streamLogs = function(_$event) {
pailer(
- '//' + hostname,
+ '/mesos',
'/master/log',
'Mesos Master (' + hostname + ')');
};
--
2.16.3

@@ -0,0 +1,73 @@
From 9796bf3d889397aa6ee707c937af4e8c757c9f2a Mon Sep 17 00:00:00 2001
From: Joseph Wu <josephwu@apache.org>
Date: Thu, 10 Nov 2016 11:29:19 -0800
Subject: [PATCH] Revert "Fixed the broken metrics information of master in
WebUI."

This reverts commit b2fc58883e2cd0ca144fd1b0e10cad4235a50223.

In DC/OS, redirection to the leading master is handled by the
Adminrouter component.
---
src/webui/app/controllers.js | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/webui/app/controllers.js b/src/webui/app/controllers.js
index 81008052b..631c0d5a8 100644
--- a/src/webui/app/controllers.js
+++ b/src/webui/app/controllers.js
@@ -348,7 +348,8 @@
}

// Update the outermost scope with the metrics/snapshot endpoint.
- function updateMetrics($scope, $timeout, metrics) {
+ function updateMetrics($scope, $timeout, data) {
+ var metrics = JSON.parse(data);
$scope.staging_tasks = metrics['master/tasks_staging'];
$scope.starting_tasks = metrics['master/tasks_starting'];
$scope.running_tasks = metrics['master/tasks_running'];
@@ -445,18 +446,6 @@
if (!matched) $scope.navbarActiveTab = null;
});

- var leadingMasterURL = function(path) {
- // Use current location as address in case we could not find the
- // leading master.
- var address = location.hostname + ':' + location.port;
- if ($scope.state && $scope.state.leader_info) {
- address = $scope.state.leader_info.hostname + ':' +
- $scope.state.leader_info.port;
- }
-
- return '//' + address + path;
- }
-
var popupErrorModal = function() {
if ($scope.delay >= 128000) {
$scope.delay = 2000;
@@ -516,7 +505,7 @@
// the leading master automatically. This would cause a CORS error if we
// use XMLHttpRequest here. To avoid the CORS error, we use JSONP as a
// workaround. Please refer to MESOS-5911 for further details.
- $http.jsonp(leadingMasterURL('/master/state?jsonp=JSON_CALLBACK'))
+ $http.jsonp('master/state?jsonp=JSON_CALLBACK')
.success(function(response) {
if (updateState($scope, $timeout, response)) {
$scope.delay = updateInterval(_.size($scope.agents));
@@ -531,9 +520,10 @@
};

var pollMetrics = function() {
- $http.jsonp(leadingMasterURL('/metrics/snapshot?jsonp=JSON_CALLBACK'))
- .success(function(response) {
- if (updateMetrics($scope, $timeout, response)) {
+ $http.get('metrics/snapshot',
+ {transformResponse: function(data) { return data; }})
+ .success(function(data) {
+ if (updateMetrics($scope, $timeout, data)) {
$scope.delay = updateInterval(_.size($scope.agents));
$timeout(pollMetrics, $scope.delay);
}
--
2.16.3

@@ -0,0 +1,55 @@
From 7659c405f51c1771fd341c9fad34085982774014 Mon Sep 17 00:00:00 2001
From: Kevin Klues <klueska@gmail.com>
Date: Thu, 9 Feb 2017 19:39:42 -0800
Subject: [PATCH] Updated mesos containerizer to ignore GPU isolator creation
failure.

This cherry-pick will be maintained in DC/OS to avoid the problem of
requiring NVML to be installed on *every* node in the cluster, even if
GPUs aren't available on them.

Without this patch, we would need some sort of per-agent configuration
to only enable the GPU isolator on agents that had NVML intstalled on
them, and that is currently difficult (or undesirable) to do in DC/OS
today.

This is a decent compromise.

Cherry-picked and modified from
`a9f5ddb8614ef057537994f389eb7e19f0c85652` due to changes introduced
by https://reviews.apache.org/r/62472/
---
src/slave/containerizer/mesos/containerizer.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 01386ac3d..991fe1163 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -437,8 +437,10 @@ Try<MesosContainerizer*> MesosContainerizer::create(
{"gpu/nvidia",
[&nvidia] (const Flags& flags) -> Try<Isolator*> {
if (!nvml::isAvailable()) {
- return Error("Cannot create the Nvidia GPU isolator:"
- " NVML is not available");
+ LOG(ERROR) << "Cannot create the Nvidia GPU isolator:"
+ " NVML is not available";
+
+ return nullptr;
}

CHECK_SOME(nvidia)
@@ -498,7 +500,9 @@ Try<MesosContainerizer*> MesosContainerizer::create(
isolator.error());
}

- isolators.push_back(Owned<Isolator>(isolator.get()));
+ if (isolator.get() != nullptr) {
+ isolators.push_back(Owned<Isolator>(isolator.get()));
+ }
}

// Next, apply any custom isolators in the order given by the flags.
--
2.16.3

22 changes: 0 additions & 22 deletions packages/mesos/patches.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/metronome/buildinfo.json
Expand Up @@ -2,8 +2,8 @@
"requires": ["java", "exhibitor"],
"single_source": {
"kind": "url_extract",
"url": "https://s3.amazonaws.com/downloads.mesosphere.io/metronome/releases/0.5.0/metronome-0.5.0.tgz",
"sha1": "b2c3b5c2ad4bfc45da82cc13538c23c483d05062"
"url": "https://s3.amazonaws.com/downloads.mesosphere.io/metronome/releases/0.4.2/metronome-0.4.2.tgz",
"sha1": "61652afa0f1209635dcf9839f985ae5ee64486ba"
},
"username": "dcos_metronome",
"state_directory": true
Expand Down

0 comments on commit ac2cc2c

Please sign in to comment.