Skip to content

chore: remove ssh background config #97

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

Merged
merged 2 commits into from
Apr 28, 2025
Merged

chore: remove ssh background config #97

merged 2 commits into from
Apr 28, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Apr 25, 2025

From my testing, Toolbox forwards through SSH (i.e. through Coder) a remote port associated with the IDE
running in server mode, to localhost in order for the server (i.e. the remote IDE) to communicate with
JBClient. Unlike with Gateway, Toolbox manages to reuse the SSH connection, and it doesn't open a separate
one for port forwarding.

From Gateway we inherited two ssh hostnames per each workspace, one for background connections that did not
involve running IDEs. Coder discards the bg. connection from the collected metrics in order to
avoid double counting. Since Toolbox manages to re-use the connection we don't need to worry
about double counting.

For this particular change, I deployed the latest Coder version with prometheus metrics and experiments
enabled (i.e. --prometheus-enable --prometheus-collect-agent-stats --experiments=workspace-usage) and made the following experiment:

  1. Opened up Toolbox, logged into Coder. At this point:
  • agent_sessions_total and coderd_agentstats_session_count_jetbrains were missing from prometheus metrics
  • jetbrains session count from api/v2/deployment/stats showed 0
  1. Opened up a Workspace at which point Toolbox established the SSH connection:
  • agent_sessions_total and coderd_agentstats_session_count_jetbrains increased to 1
  • jetbrains session count from api/v2/deployment/stats increased to 1 as well
  1. Hit the install button on RustRover, everything stayed unchanged

  2. Open RustRover, nothing changes in the stats.

fioan89 added 2 commits April 26, 2025 01:17
From my testing, Toolbox forwards through SSH (i.e. through Coder) a remote port associated with the IDE
running in server mode, to localhost in order for the server (i.e. the remote IDE) to communicate with
JBClient. Unlike with Gateway, Toolbox manages to reuse the SSH connection, and it doesn't open a separate
one for port forwarding.

From Gateway we inherited two ssh hostnames per each workspace, one for background connections that did not
involve running IDEs. Coder discards the bg. connection from the collected metrics in order to
avoid double counting. Since Toolbox manages to re-use the connection we don't need to worry
about double counting.

For this particular change, I deployed the latest Coder version with prometheus metrics and experiments
enabled (i.e. --prometheus-enable --prometheus-collect-agent-stats --experiments=workspace-usage) and made the following experiment:

1. Opened up Toolbox, logged into Coder. At this point:
- agent_sessions_total and coderd_agentstats_session_count_jetbrains were missing from prometheus metrics
- jetbrains session count from api/v2/deployment/stats showed 0

2. Opened up a Workspace at which point Toolbox established the SSH connection:
- agent_sessions_total and coderd_agentstats_session_count_jetbrains increased to 1
- jetbrains session count from api/v2/deployment/stats increased to 1 as well

3. Hit the install button on RustRover, everything stayed unchanged

4. Open RustRover, nothing changes in the stats.
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

Great news on Toolbox using a single connection!

I tried running Toolbox 2.6.1 on my Windows VM (for some reason I cannot seem to get it running on Linux) but I keep getting "exit code: 7" and blank stderr, so I have not been able to test, but the code change looks good to me.

@fioan89
Copy link
Collaborator Author

fioan89 commented Apr 28, 2025

I'll have to get my hands on Windows machine/VM, honestly I only tested on macOS.

@fioan89 fioan89 merged commit 970f4c5 into main Apr 28, 2025
5 checks passed
@fioan89 fioan89 deleted the remove-bg-ssh-config branch April 28, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants