1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

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:
epriestley 2017-02-20 12:43:17 -08:00
parent bf44210dc8
commit 6f50729a91
2 changed files with 12 additions and 32 deletions

View file

@ -28,10 +28,6 @@ final class PhabricatorDaemonManagementDebugWorkflow
'instead of the configured %s',
'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.'));
}
$config = array();
$config['class'] = array_shift($argv);
$config['argv'] = $argv;
if ($args->getArg('autoscale')) {
$config['autoscale'] = array(
'group' => 'debug',
);
}
$config = array(
'class' => array_shift($argv),
'label' => 'debug',
'argv' => $argv,
);
return $this->launchDaemons(
array(

View file

@ -362,17 +362,17 @@ abstract class PhabricatorDaemonManagementWorkflow
$daemons = array(
array(
'class' => 'PhabricatorRepositoryPullLocalDaemon',
'label' => 'pull',
),
array(
'class' => 'PhabricatorTriggerDaemon',
'label' => 'trigger',
),
array(
'class' => 'PhabricatorTaskmasterDaemon',
'autoscale' => array(
'group' => 'task',
'pool' => PhabricatorEnv::getEnvConfig('phd.taskmasters'),
'reserve' => idx($options, 'reserve', 0),
),
'label' => 'task',
'pool' => PhabricatorEnv::getEnvConfig('phd.taskmasters'),
'reserve' => idx($options, 'reserve', 0),
),
);
@ -618,23 +618,12 @@ abstract class PhabricatorDaemonManagementWorkflow
pht('(Logs will appear in "%s".)', $log_dir));
foreach ($daemons as $daemon) {
$is_autoscale = isset($daemon['autoscale']['group']);
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)');
}
$pool_size = pht('(Pool: %s)', idx($daemon, 'pool', 1));
$console->writeOut(
" %s %s\n",
$pool_size,
$daemon['class'],
$autoscale,
implode(' ', idx($daemon, 'argv', array())));
}
$console->writeOut("\n");