Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review and define agent bootstrapper events #5266

Closed
voievodin opened this issue Jun 2, 2017 · 4 comments
Closed

Review and define agent bootstrapper events #5266

voievodin opened this issue Jun 2, 2017 · 4 comments
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.

Comments

@voievodin
Copy link
Contributor

voievodin commented Jun 2, 2017

Agent installation spec defines agent bootstrapper events(see Agent lifecycle events).
According to new generation SPI, defined events - do not provide enough information. For example each agent event should provide machine identifier as well as its own identifier, it can be either structured id like

"workspaceId" : "workspace123",
"environment" : "main",
"machine" : "dev"

or it can be a path like

"machine" : "workpsace123/main/dev"

or it can be a machine id

"machine" : "machine123"

Another point is that the format of events names should fit the concept of workspace master events.

The DOD of the issue is to provide a list of jsonrpc2.0 events needed to be produced by bootstrapper,
which allows to develop java client & installer separately.

@voievodin voievodin added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Jun 2, 2017
@skabashnyuk skabashnyuk added sprint/current status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. team/platform labels Jun 8, 2017
@voievodin
Copy link
Contributor Author

voievodin commented Jun 12, 2017

I reviewed bootstrapper events, after they approved here i will change the spec.

Bootstrapper events

  • Bootstrapper is ready to push events. Occurs when bootstrapper is configured to push events on start, it connects to the specified websocket url(workspace master probably) and publishes this event before any other event.
{
  "jsonrpc": "2.0",
  "method": "bootstrapper/statusChanged",
  "params": {
    "status": "READY",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Bootstrapping done, everything is started ok.
{
  "jsonrpc": "2.0",
  "method": "bootstrapper/statusChanged",
  "params": {
    "status": "DONE",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Bootstrapping failed(when any agent fails or any error occurs), followed by disconnect and os.Exit(1).
{
  "jsonrpc": "2.0",
  "method": "bootstrapper/statusChanged",
  "params": {
    "status": "FAILED",
    "error" : "couldn't start agent X",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}

Agents events

  • Bootstrapper starts agent X
{
  "jsonrpc": "2.0",
  "method": "installer/statusChanged",
  "params": {
    "status": "STARTING",
    "installer": "org.eclipse.che.ws-agent",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Bootstrapper successfully started agent X(No server defined)
{
  "jsonrpc": "2.0",
  "method": "installer/statusChanged",
  "params": {
    "status": "DONE",
    "installer": "org.eclipse.che.ws-agent",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Bootstrapper successfully started agent X(Server defined)
{
  "jsonrpc": "2.0",
  "method": "installer/statusChanged",
  "params": {
    "status": "RUNNING",
    "installer": "org.eclipse.che.ws-agent",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Bootstrapper failed to start agent X
{
  "jsonrpc": "2.0",
  "method": "installer/statusChanged",
  "params": {
    "status": "FAILED",
    "installer": "org.eclipse.che.my-agent",
    "error": "Install script exit code -1",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Agent X stderr
{
  "jsonrpc": "2.0",
  "method": "installer/log",
  "params": {
    "text": "no command found",
    "stream": "STDERR",
    "installer": "org.eclipse.che.ws-agent",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}
  • Agent X stdout
{
  "jsonrpc": "2.0",
  "method": "installer/log",
  "params": {
    "text": "Starting server...",
    "stream": "STDOUT",
    "installer": "org.eclipse.che.ws-agent",
    "machineName": "my-machine",
    "runtimeId": {
      "workspace": "workspace123",
      "environment": "default",
      "owner": "user123"
    },
    "time": "2017-02-23T16:22:22.50287146+02:00"
  }
}

@voievodin
Copy link
Contributor Author

@gazarenkov, @garagatyi, @dkuleshov, @mshaposhnik WDYT?

@voievodin voievodin changed the title Review and define agent installer events Review and define agent bootstrapper events Jun 12, 2017
@mshaposhnik
Copy link
Contributor

LGTM

@voievodin
Copy link
Contributor Author

Added events to the spec

@voievodin voievodin removed the status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. label Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

No branches or pull requests

3 participants