Page MenuHomePhabricator

Spec out needed glue for Differential to Gearman to Nodepool
Closed, ResolvedPublic

Description

something like:

Changeset uploaded to Differentialrun Harbormaster build plancall gearman apinodepool (on Gallium)CI job runner (labs instance)clone the repo from phabricatorrun testsreport test results (via conduit)differential test status updated

Event Timeline

greg moved this task from To Triage to Tooling on the Gerrit-Migration board.
mmodell updated the task description. (Show Details)

So first we need to unblock the gearman port for iridiumgallium and then write a trivial script to enqueue build details via the gearman api.

Personally I feel like it would be cleaner if gallium offered an http api that phabricator could call directly from harbormaster's existing configurable http rest client, however, some sort of gearman client in phabricator won't be too hard to build.

Pasting here so it's not lost...

An email from Antoine about Gearman examples in PHP:

The Gearman doc has a few examples illustrating how to use the PHP class
to act as a client:

http://gearman.org/examples/

So Harbormaster would do something like:

<?php
// Create our client object
$client = new GearmanClient();

// Add a server
$client->addServer(); // by default host/port will be "localhost" & 4730

echo "Sending job\n";

$params = [
  'REPO' => 'RSCAP',
  'DIFF' => 'D1234',
  'REF'  => 'ref/diff/D1234',
];

// Send reverse job
$result = $client->doNormal("build:npm", json_encode( $params ) );
if ($result) {
  echo "Success: $result\n";
}
mmodell claimed this task.

The reason I wanted jobs to be triggered via Gearman (instead of Jenkins REST API) was because the Jenkins Gearman Plugin can only put the slaves offline when a job is triggered over Gearman.

However, Mukunda has found the Jenkins Single Use Slave plugin which given a list of labels would put the associated slave offline on job completion. That fulfill the requirement and let us trigger build via the Jenkins REST API.

So this task is moot and no more needed.