You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/16 14:51:04 UTC
[24/27] git commit: AMBARI-7321. Slider view: Iron out story on how
app-packages are deployed and instances created (srimanth)
AMBARI-7321. Slider view: Iron out story on how app-packages are deployed and instances created (srimanth)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/63f5ed2c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/63f5ed2c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/63f5ed2c
Branch: refs/heads/branch-alerts-dev
Commit: 63f5ed2cc25f495cf216a350b32f45132adc0725
Parents: a412da8
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Mon Sep 15 20:48:07 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Mon Sep 15 20:48:12 2014 -0700
----------------------------------------------------------------------
contrib/views/slider/pom.xml | 8 ++++++++
.../ambari/view/slider/SliderAppsViewControllerImpl.java | 7 +++++++
.../slider/src/main/resources/ui/app/models/slider_app.js | 2 +-
3 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/63f5ed2c/contrib/views/slider/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index cfb0abc..82d27bb 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -549,6 +549,14 @@
<filtering>false</filtering>
<directory>target/lib</directory>
</resource>
+ <resource>
+ <targetPath>WEB-INF/lib</targetPath>
+ <filtering>true</filtering>
+ <directory>lib</directory>
+ <includes>
+ <include>slider-agent.tar.gz</include>
+ </includes>
+ </resource>
</resources>
<pluginManagement>
<plugins>
http://git-wip-us.apache.org/repos/asf/ambari/blob/63f5ed2c/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index c4871f2..cc35dec 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -57,6 +57,7 @@ import org.apache.slider.client.SliderClient;
import org.apache.slider.common.SliderKeys;
import org.apache.slider.common.params.ActionCreateArgs;
import org.apache.slider.common.params.ActionFreezeArgs;
+import org.apache.slider.common.params.ActionInstallPackageArgs;
import org.apache.slider.common.params.ActionThawArgs;
import org.apache.slider.common.tools.SliderFileSystem;
import org.apache.slider.core.exceptions.SliderException;
@@ -678,9 +679,15 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
createArgs.image = new Path(hdfsLocation
+ "/user/yarn/agent/slider-agent.tar.gz");
+ final ActionInstallPackageArgs installArgs = new ActionInstallPackageArgs();
+ installArgs.name = appName;
+ installArgs.packageURI = getAppsFolderPath() + configs.get("application.def").getAsString();
+ installArgs.replacePkg = true;
+
return invokeSliderClientRunnable(new SliderClientContextRunnable<String>() {
@Override
public String run(SliderClient sliderClient) throws YarnException, IOException, InterruptedException {
+ sliderClient.actionInstallPkg(installArgs);
sliderClient.actionCreate(appName, createArgs);
ApplicationId applicationId = sliderClient.applicationId;
if (applicationId != null) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/63f5ed2c/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
index 3710877..7408911 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
@@ -114,7 +114,7 @@ App.SliderApp = DS.Model.extend({
showMetrics: function() {
var global = this.get('configs')['global'];
//check whether slider has GANGLIA configured if not metrics should be hidden
- if (!(global['ganglia_server_host'] && global['ganglia_server_id'] && global['ganglia_server_port'])) {
+ if (!(global && global['ganglia_server_host'] && global['ganglia_server_id'] && global['ganglia_server_port'])) {
return false;
}
return App.SliderApp.Status.running === this.get('status');