-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[supervisor] Add port management #1909
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
Conversation
db4b8b0
to
ac5c9dd
Compare
3b8a0c9
to
fff5231
Compare
7b11e2f
to
e0a316b
Compare
d19fed3
to
da20152
Compare
if config != nil { | ||
ports = config.Ports | ||
} | ||
portConfigs, rangeConfigs := service.parser.parseInstanceConfigs(ports) |
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.
It took me a minute to understand this function. If I understand correctly, when there's no config, service.parser.parseInstanceConfigs(ports)
will always return empty lists. In that case we could exit early returning false
.
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 don't think it would be correct, if the file was removed we should remove the previous state as well
I've tested the PR with
all worked as intended. |
1e8a032
to
975cb50
Compare
so that we get the last log output rather than a termination message.
including exposed ports, not just the served ones. Also, auto-expose newly served ports.
975cb50
to
6924012
Compare
First is helpful, second is correct and enabled server side events.
6924012
to
47968aa
Compare
@csweichel I've addressed all your comments and retested everything. Could you please have a look again? |
Thank you for the changes. As I'm the original author of the PR, I cannot approve it. |
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.
Reviewed and tested by me and Chris.
This feature was introduced by gitpod-io/gitpod#1909
This feature was introduced by gitpod-io/gitpod#1909
This PR adds holistic port management to supervisor.
Until now Theia had multiple tasks when it comes to ports. For one, it was listening to ports being served in the workspace (moved to supervisor in #1827), it's listening for workspace instance status updates to determine which ports are exposed, and it combines those two sources to auto-expose ports when neccesary. It also offers a UI where users can expose ports publicly.
We're looking to move this functionality out of Theia and into supervisor. To this end, this PR
openPorts
on the server)This PR also changes the termination log behaviour of workspaces to include the last few lines of log output. This makes debugging supervisor crashes tenable.
Open Points
ExposedPortsInterface
that listens to workspace instance updates rather than polling. To this end one would first need to extend the Go Gitpod API support to provide access to incoming notifications.How to test
node server.js
to test that the localhost service gets served and exposed via the proxy as privateecho localhost:5000
and then click on a link, given that 5000 is not exposed yetdevops
role, switch toCode
as the default IDE and do testing again:update d_b_user set rolesOrPermissions = '["admin","devops"]' where name = 'akosyakov';