Update Phabricator for new daemon pool changes
Summary: Ref T12298. This updates `bin/phd` for minor changes to daemon configuration. In particular: - Every daemon now has an autoscale pool (for trigger/pull, the maximum pool size is 1). - Pools now have labels to make debugging a little easier. - Some minor structural changes. Test Plan: See D17389. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12298 Differential Revision: https://secure.phabricator.com/D17390
This commit is contained in:
		| @@ -28,10 +28,6 @@ final class PhabricatorDaemonManagementDebugWorkflow | |||||||
|               'instead of the configured %s', |               'instead of the configured %s', | ||||||
|               'phd.user'), |               'phd.user'), | ||||||
|           ), |           ), | ||||||
|           array( |  | ||||||
|             'name' => 'autoscale', |  | ||||||
|             'help' => pht('Put the daemon in an autoscale group.'), |  | ||||||
|           ), |  | ||||||
|         )); |         )); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -44,16 +40,11 @@ final class PhabricatorDaemonManagementDebugWorkflow | |||||||
|         pht('You must specify which daemon to debug.')); |         pht('You must specify which daemon to debug.')); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $config = array(); |     $config = array( | ||||||
|  |       'class' => array_shift($argv), | ||||||
|     $config['class'] = array_shift($argv); |       'label' => 'debug', | ||||||
|     $config['argv'] = $argv; |       'argv' => $argv, | ||||||
|  |  | ||||||
|     if ($args->getArg('autoscale')) { |  | ||||||
|       $config['autoscale'] = array( |  | ||||||
|         'group' => 'debug', |  | ||||||
|     ); |     ); | ||||||
|     } |  | ||||||
|  |  | ||||||
|     return $this->launchDaemons( |     return $this->launchDaemons( | ||||||
|       array( |       array( | ||||||
|   | |||||||
| @@ -362,18 +362,18 @@ abstract class PhabricatorDaemonManagementWorkflow | |||||||
|     $daemons = array( |     $daemons = array( | ||||||
|       array( |       array( | ||||||
|         'class' => 'PhabricatorRepositoryPullLocalDaemon', |         'class' => 'PhabricatorRepositoryPullLocalDaemon', | ||||||
|  |         'label' => 'pull', | ||||||
|       ), |       ), | ||||||
|       array( |       array( | ||||||
|         'class' => 'PhabricatorTriggerDaemon', |         'class' => 'PhabricatorTriggerDaemon', | ||||||
|  |         'label' => 'trigger', | ||||||
|       ), |       ), | ||||||
|       array( |       array( | ||||||
|         'class' => 'PhabricatorTaskmasterDaemon', |         'class' => 'PhabricatorTaskmasterDaemon', | ||||||
|         'autoscale' => array( |         'label' => 'task', | ||||||
|           'group' => 'task', |  | ||||||
|         'pool' => PhabricatorEnv::getEnvConfig('phd.taskmasters'), |         'pool' => PhabricatorEnv::getEnvConfig('phd.taskmasters'), | ||||||
|         'reserve' => idx($options, 'reserve', 0), |         'reserve' => idx($options, 'reserve', 0), | ||||||
|       ), |       ), | ||||||
|       ), |  | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
|     $this->launchDaemons($daemons, $is_debug = false); |     $this->launchDaemons($daemons, $is_debug = false); | ||||||
| @@ -618,23 +618,12 @@ abstract class PhabricatorDaemonManagementWorkflow | |||||||
|       pht('(Logs will appear in "%s".)', $log_dir)); |       pht('(Logs will appear in "%s".)', $log_dir)); | ||||||
|  |  | ||||||
|     foreach ($daemons as $daemon) { |     foreach ($daemons as $daemon) { | ||||||
|       $is_autoscale = isset($daemon['autoscale']['group']); |       $pool_size = pht('(Pool: %s)', idx($daemon, 'pool', 1)); | ||||||
|       if ($is_autoscale) { |  | ||||||
|         $autoscale = $daemon['autoscale']; |  | ||||||
|         foreach ($autoscale as $key => $value) { |  | ||||||
|           $autoscale[$key] = $key.'='.$value; |  | ||||||
|         } |  | ||||||
|         $autoscale = implode(', ', $autoscale); |  | ||||||
|  |  | ||||||
|         $autoscale = pht('(Autoscaling: %s)', $autoscale); |  | ||||||
|       } else { |  | ||||||
|         $autoscale = pht('(Static)'); |  | ||||||
|       } |  | ||||||
|  |  | ||||||
|       $console->writeOut( |       $console->writeOut( | ||||||
|         "    %s %s\n", |         "    %s %s\n", | ||||||
|  |         $pool_size, | ||||||
|         $daemon['class'], |         $daemon['class'], | ||||||
|         $autoscale, |  | ||||||
|         implode(' ', idx($daemon, 'argv', array()))); |         implode(' ', idx($daemon, 'argv', array()))); | ||||||
|     } |     } | ||||||
|     $console->writeOut("\n"); |     $console->writeOut("\n"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley