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

CHE-4098: separate terminal and exec agents #4486

Merged
merged 14 commits into from
Mar 27, 2017

Conversation

garagatyi
Copy link

@garagatyi garagatyi commented Mar 20, 2017

What does this PR do?

Separate terminal and exec agents.
Refactor golang terminal code.
Add ping frames into terminal websocket connection.

What issues does this PR fix or reference?

Fixes #4098
Fixes #4159
Fixes #3253

Changelog

Separated terminal and exec agents.
Fix terminal disconnects due to request timeout behind a proxy.
Fix terminal failure after regular HTTP request to a websocket entrypoint.

Release Notes

We have separated the terminal and exec agents in this release to make behaviors clearer and give users the freedom to control whether terminal, command execution or both are required for their machines.

In order to provide a smooth transition period the REST API services will automatically add the exec agent into every machine that has a terminal agent for the next two releases. This temporary service will be removed in 5.8.0. At that point any machines that do not have an exec agent added will be unable to have commands executed against them.

You can add the terminal and/or exec agent to your machine through the user dashboard in the Workspace detail view, or via the workspace API.

We have also fixed a bug in the terminal that would cause the terminal to become disconnected when a request timed out behind a proxy. Terminal and exec agents now send ping frames to clients to prevent this disconnection issue.

Docs PR

Refactor golang terminal code.
Add ping frames into terminal websocket connection.
Signed-off-by: Alexander Garagatyi <[email protected]>
@codenvy-ci
Copy link

@codenvy-ci
Copy link

@codenvy-ci
Copy link

@codenvy-ci
Copy link

Build # 2254 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2254/ to view the results.

Alexander Garagatyi added 2 commits March 23, 2017 11:23
Signed-off-by: Alexander Garagatyi <[email protected]>
@@ -846,7 +846,7 @@ setupSSHKeys(workspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto
let promises : Array<Promise<any>> = new Array<Promise<any>>();
let workspaceCommands : Array<any> = workspaceDto.getConfig().getCommands();

// get terminal URI
// get exec-agent URI
let execAgentServer = workspaceDto.getRuntime().getDevMachine().getRuntime().getServers().get("4411/tcp");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe port should be 4412?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Alexander Garagatyi added 2 commits March 23, 2017 14:33
Signed-off-by: Alexander Garagatyi <[email protected]>
Signed-off-by: Alexander Garagatyi <[email protected]>
@garagatyi garagatyi requested a review from benoitf March 23, 2017 13:18
@garagatyi garagatyi changed the title WIP CHE-4098: separate terminal and exec agents CHE-4098: separate terminal and exec agents Mar 23, 2017
@garagatyi garagatyi requested a review from bmicklea March 23, 2017 13:40
@garagatyi
Copy link
Author

@bmicklea I added release notes. Feel free to change them as you want.

http.Handler
}

type routerImpl struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to create a separate go file and move httprouter based implementation there + add routes registration to the contract of the Router interface.

)

// BasePathChopper cuts base path of a request
type BasePathChopper struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of workaround for the httprouter implementation.
The previous (gorilla mux) based router could deal with regexp in paths, which didn't require such workaround,
i think it makes sense to make this code Router implementation specific

@codenvy-ci
Copy link

Signed-off-by: Alexander Garagatyi <[email protected]>
@garagatyi
Copy link
Author

@evoevodin I've commited changes to adress your comments

@codenvy-ci
Copy link

Alexander Garagatyi added 2 commits March 24, 2017 13:22
Signed-off-by: Alexander Garagatyi <[email protected]>
Signed-off-by: Alexander Garagatyi <[email protected]>
@codenvy-ci
Copy link

Signed-off-by: Alexander Garagatyi <[email protected]>
@codenvy-ci
Copy link

@AndrienkoAleksandr
Copy link
Contributor

Great job, @garagatyi!

@garagatyi garagatyi merged commit 798ca08 into eclipse-che:master Mar 27, 2017
@garagatyi garagatyi deleted the goSeparateAgents branch March 27, 2017 09:27
@codenvy-ci
Copy link

@JamesDrummond JamesDrummond added this to the 5.6.0 milestone Mar 30, 2017
@JamesDrummond JamesDrummond mentioned this pull request Apr 2, 2017
9 tasks
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
Refactor golang terminal code.
Add ping frames into terminal websocket connection.
Signed-off-by: Alexander Garagatyi <[email protected]>
skabashnyuk pushed a commit that referenced this pull request Jan 3, 2020
Refactor golang terminal code.
Add ping frames into terminal websocket connection.
Signed-off-by: Alexander Garagatyi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants