-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yevhenii Voevodin
authored
Dec 8, 2016
1 parent
4c587d5
commit ab9b094
Showing
93 changed files
with
15,051 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ config/ | |
|
||
# Compiled source # | ||
################### | ||
*.com | ||
!*.com/ | ||
*.class | ||
*.dll | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
logs/ | ||
exec-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Summary | ||
--- | ||
Golang based server for executing commands and streaming process output logs, | ||
also websocket-terminal. | ||
|
||
|
||
Requirements | ||
-- | ||
- golang 1.6+ | ||
|
||
|
||
Docs | ||
--- | ||
- jsonrpc2.0 based [Webscoket API](docs/ws_api.md) | ||
- jsonrpc2.0 based [Events](docs/events.md) | ||
- [REST API](docs/rest_api.md) | ||
|
||
Development | ||
--- | ||
|
||
##### Link the sources to standard go workspace | ||
|
||
```bash | ||
export CHE_PATH=~/code/che | ||
mkdir $GOPATH/src/github.com/eclipse/che -p | ||
ln -s $CHE_PATH/exec-agent/src $GOPATH/src/github.com/eclipse/che/exec-agent | ||
``` | ||
|
||
##### Install godep | ||
```bash | ||
go get github.com/tools/godep | ||
``` | ||
|
||
##### Get all dependencies | ||
|
||
```bash | ||
cd $GOPATH/src/github.com/eclipse/che/exec-agent | ||
$GOPATH/bin/godep restore | ||
``` | ||
|
||
That's it, `$GOPATH/src/github.com/eclipse/che/exec-agent` project is ready. | ||
|
||
##### Building linked project | ||
|
||
```bash | ||
cd $GOPATH/src/github.com/eclipse/che/exec-agent && go build | ||
``` | ||
|
||
##### Running linked project tests | ||
|
||
```bash | ||
cd $GOPATH/src/github.com/eclipse/che/exec-agent && go test ./... | ||
``` | ||
|
||
##### Formatting linked project sources | ||
|
||
```bash | ||
cd $GOPATH/src/github.com/eclipse/che/exec-agent && go fmt ./... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
Events | ||
=== | ||
Messages sent via websocket connections to clients | ||
|
||
Channel Events | ||
--- | ||
|
||
#### Connected | ||
|
||
The first event in the channel, published when client successfully connected to the exec-agent. | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "connected", | ||
"params": { | ||
"time": "2016-09-24T16:40:05.098478609+03:00", | ||
"channel": "channel-1", | ||
"text": "Hello!" | ||
} | ||
} | ||
``` | ||
|
||
Process Events | ||
--- | ||
|
||
#### Process started | ||
|
||
Published when process is successfully started. | ||
This is the first event from all the events produced by process, | ||
it appears only once for one process | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "process_started", | ||
"params": { | ||
"time": "2016-09-24T16:40:55.930743249+03:00", | ||
"pid": 1, | ||
"nativePid": 22164, | ||
"name": "print", | ||
"commandLine": "printf \"\n1\n2\n3\"" | ||
} | ||
} | ||
``` | ||
|
||
#### STDOUT event | ||
|
||
Published when process writes to stdout. | ||
One stdout event describes one output line | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "process_stdout", | ||
"params": { | ||
"time": "2016-09-24T16:40:55.933255297+03:00", | ||
"pid": 1, | ||
"text": "Starting server..." | ||
} | ||
} | ||
``` | ||
|
||
#### STDERR event | ||
|
||
Published when process writes to stderr. | ||
One stderr event describes one output line | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "process_stderr", | ||
"params": { | ||
"time": "2016-09-24T16:40:55.933255297+03:00", | ||
"pid": 1, | ||
"text": "sh: ifconfig: command not found" | ||
} | ||
} | ||
``` | ||
|
||
#### Process died | ||
|
||
Published when process is done, or killed. This is the last event from the process, | ||
it appears only once for one process | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "process_died", | ||
"params": { | ||
"time": "2016-09-24T16:40:55.93354086+03:00", | ||
"pid": 1, | ||
"nativePid": 22164, | ||
"name": "print", | ||
"commandLine": "printf \"\n1\n2\n3\"" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
##### Websocket messages order | ||
|
||
The order is respected | ||
``` | ||
Message fragments MUST be delivered to the recipient in the order sent by the sender. | ||
``` | ||
Helpful Sources | ||
* https://tools.ietf.org/html/rfc6455 (search the sentence above) | ||
* http://stackoverflow.com/questions/11804721/can-websocket-messages-arrive-out-of-order | ||
* http://stackoverflow.com/questions/14287224/processing-websockets-messages-in-order-of-receiving |
Oops, something went wrong.