-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add exec-agent #2163
Merged
Merged
Add exec-agent #2163
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need .com files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no we don't but we need to keep
vendor/github.com
directoryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll fix it thank you