Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mute_ip_detect_script_test
- Loading branch information
Showing
10 changed files
with
230 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/mesos/extra/patches/0001-Set-LIBPROCESS_IP-into-docker-container.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
54 changes: 54 additions & 0 deletions
54
packages/mesos/extra/patches/0002-Mesos-UI-updated-the-URL-generation-to-make-it-work-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
73 changes: 73 additions & 0 deletions
73
packages/mesos/extra/patches/0003-Revert-Fixed-the-broken-metrics-information-of-maste.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
55 changes: 55 additions & 0 deletions
55
packages/mesos/extra/patches/0004-Updated-mesos-containerizer-to-ignore-GPU-isolator-c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters