Author: yusaku
Date: Fri Mar 1 22:34:04 2013
New Revision: 1451744
URL: http://svn.apache.org/r1451744
Log:
AMBARI-1537. Constrain the width of all wizard popups. (Xi Wang via yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/conf/unix/ambari-agent.ini
incubator/ambari/trunk/ambari-agent/pom.xml
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/Grep.py
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/NetUtil.py
incubator/ambari/trunk/ambari-web/app/styles/application.less
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Mar 1 22:34:04 2013
@@ -75,6 +75,8 @@ Trunk (unreleased changes):
IMPROVEMENTS
+ AMBARI-1537. Constrain the width of all wizard popups. (Xi Wang via yusaku)
+
AMBARI-1536. Hosts page layout fixes. (Xi Wang via yusaku)
AMBARI-1502. Add the ability to assign configuration to a cluster. (Nate Cole
via tbeerbower)
Modified: incubator/ambari/trunk/ambari-agent/conf/unix/ambari-agent.ini
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/conf/unix/ambari-agent.ini?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/conf/unix/ambari-agent.ini (original)
+++ incubator/ambari/trunk/ambari-agent/conf/unix/ambari-agent.ini Fri Mar 1
22:34:04 2013
@@ -22,6 +22,7 @@ prefix=/var/lib/ambari-agent/data
[stack]
installprefix=/var/ambari-agent/
+upgradeScriptsDir=/var/lib/ambari-agent/upgrade_stack
[puppet]
puppetmodules=/var/lib/ambari-agent/puppet
Modified: incubator/ambari/trunk/ambari-agent/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/pom.xml?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/pom.xml (original)
+++ incubator/ambari/trunk/ambari-agent/pom.xml Fri Mar 1 22:34:04 2013
@@ -204,6 +204,17 @@
</sources>
</mapping>
<mapping>
+
<directory>/var/lib/${project.artifactId}/upgrade_scripts</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>src/main/upgrade_scripts</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
<directory>${package.conf.dir}</directory>
<configuration>true</configuration>
<filemode>755</filemode>
Modified:
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/ActionQueue.py?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
Fri Mar 1 22:34:04 2013
@@ -33,7 +33,9 @@ import os
import time
import subprocess
import copy
-import puppetExecutor
+import PuppetExecutor
+import UpgradeExecutor
+import PythonExecutor
import tempfile
from Grep import Grep
@@ -43,26 +45,31 @@ installScriptHash = -1
class ActionQueue(threading.Thread):
""" Action Queue for the agent. We pick one command at a time from the queue
and execute that """
- global commandQueue, resultQueue #, STATUS_COMMAND, EXECUTION_COMMAND
+
commandQueue = Queue.Queue()
resultQueue = Queue.Queue()
STATUS_COMMAND='STATUS_COMMAND'
EXECUTION_COMMAND='EXECUTION_COMMAND'
+ UPGRADE_STATUS='UPGRADE'
+
IDLE_SLEEP_TIME = 5
def __init__(self, config):
super(ActionQueue, self).__init__()
- #threading.Thread.__init__(self)
self.config = config
self.sh = shellRunner()
self._stop = threading.Event()
self.maxRetries = config.getint('command', 'maxretries')
self.sleepInterval = config.getint('command', 'sleepBetweenRetries')
- self.executor = puppetExecutor.puppetExecutor(config.get('puppet',
'puppetmodules'),
+ self.puppetExecutor = PuppetExecutor.PuppetExecutor(
+ config.get('puppet', 'puppetmodules'),
config.get('puppet', 'puppet_home'),
config.get('puppet', 'facter_home'),
config.get('agent', 'prefix'), config)
+ self.pythonExecutor = PythonExecutor.PythonExecutor()
+ self.upgradeExecutor = UpgradeExecutor.UpgradeExecutor(self.pythonExecutor,
+ PuppetExecutor, config)
self.tmpdir = config.get('agent', 'prefix')
self.commandInProgress = None
@@ -72,24 +79,16 @@ class ActionQueue(threading.Thread):
def stopped(self):
return self._stop.isSet()
- def getshellinstance(self):
- """ For Testing purpose only."""
- return self.sh
-
def put(self, command):
logger.info("The " + command['commandType'] + " from the server is \n" +
pprint.pformat(command))
- commandQueue.put(command)
+ self.commandQueue.put(command)
pass
- def getCommandQueue(self):
- """ For Testing purpose only."""
- return commandQueue
-
def run(self):
result = []
while not self.stopped():
- while not commandQueue.empty():
- command = commandQueue.get()
+ while not self.commandQueue.empty():
+ command = self.commandQueue.get()
logger.info("Took an element of Queue: " + pprint.pformat(command))
if command['commandType'] == self.EXECUTION_COMMAND:
try:
@@ -103,8 +102,8 @@ class ActionQueue(threading.Thread):
pass
for entry in result:
- resultQueue.put((ActionQueue.EXECUTION_COMMAND, entry))
- pass
+ self.resultQueue.put((command['commandType'], entry))
+
elif command['commandType'] == self.STATUS_COMMAND:
cluster = command['clusterName']
service = command['serviceName']
@@ -116,7 +115,7 @@ class ActionQueue(threading.Thread):
logger.info("Got live status for component " + component + " of
service " + str(service) +\
" of cluster " + str(cluster) + "\n" +
pprint.pformat(result))
if result is not None:
- resultQueue.put((ActionQueue.STATUS_COMMAND, result))
+ self.resultQueue.put((ActionQueue.STATUS_COMMAND, result))
except Exception, err:
traceback.print_exc()
logger.warn(err)
@@ -130,9 +129,9 @@ class ActionQueue(threading.Thread):
def result(self):
resultReports = []
resultComponentStatus = []
- while not resultQueue.empty():
- res = resultQueue.get()
- if res[0] == ActionQueue.EXECUTION_COMMAND:
+ while not self.resultQueue.empty():
+ res = self.resultQueue.get()
+ if res[0] == self.EXECUTION_COMMAND:
resultReports.append(res[1])
elif res[0] == ActionQueue.STATUS_COMMAND:
resultComponentStatus.append(res[1])
@@ -147,7 +146,7 @@ class ActionQueue(threading.Thread):
tmpout='...'
tmperr='...'
grep = Grep()
- output = grep.tail(tmpout,
puppetExecutor.puppetExecutor.OUTPUT_LAST_LINES)
+ output = grep.tail(tmpout, Grep.OUTPUT_LAST_LINES)
inprogress = {
'role' : self.commandInProgress['role'],
'actionId' : self.commandInProgress['actionId'],
@@ -166,12 +165,6 @@ class ActionQueue(threading.Thread):
}
return result
- def registerCommand(self, command):
- return {}
-
- def statusCommand(self, command):
- return {}
-
def executeCommand(self, command):
logger.info("Executing command \n" + pprint.pformat(command))
clusterName = command['clusterName']
@@ -196,7 +189,11 @@ class ActionQueue(threading.Thread):
'tmperr': self.tmpdir + os.sep + 'errors-' + str(taskId) + '.txt'
}
# running command
- commandresult = self.executor.runCommand(command,
self.commandInProgress['tmpout'], self.commandInProgress['tmperr'])
+ if command['commandType'] == ActionQueue.EXECUTION_COMMAND:
+ if command['roleCommand'] == ActionQueue.UPGRADE_STATUS:
+ commandresult = self.upgradeExecutor.perform_stack_upgrade(command,
self.commandInProgress['tmpout'], self.commandInProgress['tmperr'])
+ else:
+ commandresult = self.puppetExecutor.runCommand(command,
self.commandInProgress['tmpout'], self.commandInProgress['tmperr'])
# dumping results
self.commandInProgress = None
status = "COMPLETED"
@@ -218,17 +215,8 @@ class ActionQueue(threading.Thread):
if roleResult['stderr'] == '':
roleResult['stderr'] = 'None'
result.append(roleResult)
- pass
return result
- def noOpCommand(self, command):
- result = {'commandId' : command['Id']}
- return result
-
- def unknownAction(self, action):
- logger.error('Unknown action: %s' % action['id'])
- result = { 'id': action['id'] }
- return result
def isIdle(self):
- return commandQueue.empty()
+ return self.commandQueue.empty()
Modified:
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
Fri Mar 1 22:34:04 2013
@@ -38,6 +38,7 @@ prefix=/tmp/ambari-agent
[stack]
installprefix=/tmp
+upgradeScriptsDir=/var/lib/ambari-agent/upgrade_stack
[puppet]
puppetmodules=/var/lib/ambari-agent/puppet/
Modified:
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/Grep.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/Grep.py?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/Grep.py
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/Grep.py
Fri Mar 1 22:34:04 2013
@@ -17,6 +17,13 @@ import re
class Grep:
+ # How many lines from command output send to server
+ OUTPUT_LAST_LINES = 10
+ # How many lines from command error output send to server (before Err phrase)
+ ERROR_LAST_LINES_BEFORE = 30
+ # How many lines from command error output send to server (after Err phrase)
+ ERROR_LAST_LINES_AFTER = 30
+
def __init__(self):
pass
Modified:
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/NetUtil.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/NetUtil.py?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/NetUtil.py
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/NetUtil.py
Fri Mar 1 22:34:04 2013
@@ -29,7 +29,6 @@ class NetUtil:
CONNECT_SERVER_RETRY_INTERVAL_SEC = 10
HEARTBEAT_IDDLE_INTERVAL_SEC = 10
HEARTBEAT_NOT_IDDLE_INTERVAL_SEC = 5
- HEARTBEAT_STATE_INTERVAL = 6 # default one per minute
# Url within server to request during status check. This url
# should return HTTP code 200
Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1451744&r1=1451743&r2=1451744&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Fri Mar 1
22:34:04 2013
@@ -645,8 +645,7 @@ a:focus {
/*90% width modal window start*/
.full-width-modal {
.modal {
- width: 90%;
- margin: -350px 0 0 -45%;
+
}
.clear {
@@ -676,6 +675,7 @@ a:focus {
/*60% width modal window start*/
.sixty-percent-width-modal {
+
.modal {
width: 60%;
margin: 0 0 0 -30%;
@@ -2603,6 +2603,14 @@ ul.inline li {
width: 120px;
}
}
+
+ // when the scree is narrow, the popup modal width is adjustable
+ .full-width-modal {
+ .modal{
+ width: 90%;
+ margin: 350px 0 0 -45%;
+ }
+ }
}
//
@@ -2672,6 +2680,15 @@ i.icon-asterisks {
//styles for screen width more than 1200px
@media (min-width: 1200px) {
+
+ //when screen is wide, the modal width is fixed
+ .full-width-modal {
+ .modal{
+ width: 1170px;
+ margin: -350px 0 0 -583px;
+ }
+ }
+
.row {
margin-left: -30px;
*zoom: 1;