Remote service runners #49

Closed
opened 2019-05-21 21:27:08 +00:00 by jamie · 10 comments
jamie commented 2019-05-21 21:27:08 +00:00 (Migrated from git.hazaar.io)

Had an idea for something cool. I'd like to see if it's possible to get a runner to execute standalone on a separate host and connect back to another warlock server.

I should be a ke to do with a service class by creating a socket class internally and using that for communication instead of its internal "send" method.

Had an idea for something cool. I'd like to see if it's possible to get a runner to execute standalone on a separate host and connect back to another warlock server. I should be a ke to do with a service class by creating a socket class internally and using that for communication instead of its internal "send" method.
jamie commented 2019-05-21 21:27:20 +00:00 (Migrated from git.hazaar.io)

changed milestone to %1

changed milestone to %1
jamie commented 2019-05-21 21:27:20 +00:00 (Migrated from git.hazaar.io)

assigned to @jamie

assigned to @jamie
jamie commented 2019-05-21 23:55:14 +00:00 (Migrated from git.hazaar.io)

changed title from Remote runners to Remote {+service +}runners

changed title from **Remote runners** to **Remote {+service +}runners**
jamie commented 2019-05-21 23:55:14 +00:00 (Migrated from git.hazaar.io)

changed the description

changed the description
jamie commented 2019-05-22 02:37:17 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 9c6f4291ad

mentioned in commit 9c6f4291ad0908b362f24910a95000d4bea97770
jamie commented 2019-05-22 03:04:34 +00:00 (Migrated from git.hazaar.io)

Here is some prototype code to connect a service back to Warlock master via sockets.

protected function connect($application, $protocol, $guid = null){

        $config = new \Hazaar\Application\Config('warlock', APPLICATION_ENV, Config::$default_config);

        $conn = new Connection\Socket($application, $protocol);

        $headers = array('X-WARLOCK-JOB' => 'true');

        if($config->admin->key !== null)
            $headers['X-WARLOCK-ACCESS-KEY'] = base64_encode($this->config->admin->key);

        if(!$conn->connect($config->sys['application_name'], '127.0.0.1', 8000, $headers))
            $conn->disconnect(FALSE);

        return $conn;

    }

I still need to sort out access keys and job ID and whatnot, but the connection and websocket handshake part works.

Here is some prototype code to connect a service back to Warlock master via sockets. ```php protected function connect($application, $protocol, $guid = null){ $config = new \Hazaar\Application\Config('warlock', APPLICATION_ENV, Config::$default_config); $conn = new Connection\Socket($application, $protocol); $headers = array('X-WARLOCK-JOB' => 'true'); if($config->admin->key !== null) $headers['X-WARLOCK-ACCESS-KEY'] = base64_encode($this->config->admin->key); if(!$conn->connect($config->sys['application_name'], '127.0.0.1', 8000, $headers)) $conn->disconnect(FALSE); return $conn; } ``` I still need to sort out access keys and job ID and whatnot, but the connection and websocket handshake part works.
jamie commented 2019-05-28 02:22:57 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !23

mentioned in merge request !23
jamie commented 2019-05-28 02:22:57 +00:00 (Migrated from git.hazaar.io)

created merge request !23 to address this issue

created merge request !23 to address this issue
jamie commented 2019-05-28 06:48:31 +00:00 (Migrated from git.hazaar.io)

closed via merge request !23

closed via merge request !23
jamie commented 2019-05-28 06:48:31 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 18c7a876b0

mentioned in commit 18c7a876b0f19841f0d04d355b18f97297fcb85c
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-warlock#49
No description provided.