Code Monkey home page Code Monkey logo

golang-job-scheduler's Issues

Create gRPC client to interact with the Worker library

  • Use GRPC for API to start/stop/get status of a running process;
  • Add streaming log output of a running job process;
  • Use mTLS and verify client certificate;
  • Set up a strong set of cipher suites for TLS and a good crypto setup for certificates;
  • Authentication and Authorization.
syntax = "proto3";
option go_package = "goteleport.com/worker/pb";

message StartRequest {
  string name = 1;
  repeated string args = 2;
}

message StartResponse {
  string jobID = 1;
}

message StopRequest {
  string jobID = 1;
}

message StopResponse {
}

message QueryRequest {
  string jobID = 1;
}

message QueryResponse {
  int32 pid = 1;
  int32 exitCode = 2;
  bool exited = 3;
}

message StreamRequest {
  string jobID = 1;
}

message StreamResponse {
  string output = 1;
}

service WorkerService {
  rpc Start(StartRequest) returns (StartResponse);
  rpc Stop(StopRequest) returns (StopResponse);
  rpc Query(QueryRequest) returns (QueryResponse);
  rpc Stream(StreamRequest) returns (stream StreamResponse);
}

Create a command line interface to interact with Worker API

Client to provide communication between the user and Worker Library through the gRPC API.

$ ./worker-client ls -lha
Job 46305a32-a2d6-11eb-bcbc-0242ac130002 was created.

$ ./worker-client query 46305a32-a2d6-11eb-bcbc-0242ac130002
pid: 1324 ExitCode: 1  Exited: false

$ ./worker-client stream 46305a32-a2d6-11eb-bcbc-0242ac130002
total 0
drwxr-xr-x   2 renatoguimaraes  staff    64B Apr 22 12:38 .
drwxrwxr-x@ 54 renatoguimaraes  staff   1.7K Apr 22 12:38 ..

$ ./worker-client stop 46305a32-a2d6-11eb-bcbc-0242ac130002
Job not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.