Skip to content

workspace proxy enhancements #7397

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

Closed
15 of 21 tasks
bpmct opened this issue May 3, 2023 · 7 comments
Closed
15 of 21 tasks

workspace proxy enhancements #7397

bpmct opened this issue May 3, 2023 · 7 comments
Labels
☂️ epic An issue of issues

Comments

@bpmct
Copy link
Member

bpmct commented May 3, 2023

👋🏼 I tried out workspace proxies and have some feedback on the feature. (I know it's still in MVP and some of these things are planned. I tried to write out everything I noticed)

Cool 😎

  • Love that you can have output formats for coder proxy create for automation
  • After a proxy went offline, my client gracefully switched back to the default one. When it was restored, my client gracefully switched back to the proxy
  • Being able to set proxy icons + display names is awesome

High user impact

  • Do proxies include DERP yet? It doesn't look like it from this tooltip, but I was also confused that in the instructions I should add this

    CODER_DERP_SERVER_ENABLE=true
    CODER_DERP_SERVER_RELAY_ADDRESS="https://127.0.0.1:8443"
    Screenshot 2023-05-03 at 3 11 43 PM Then I also saw this open PR: chore: add derpserver to proxy, add proxies to derpmap #7311

    Assuming they don't 🤷🏼

  • Do not show a list of workspace proxies on the "account" page if there are no external proxies added

    • On the deployment page, I think it would be nice to list the proxies, even if none are added. This is a good way for admins to discover the feature without adding more overhead to users.
  • Typo on workspace proxies description (https://github.com/coder/coder/pull/7448/files)

    Workspace proxies are used to reduce the latency of connections to aworkspace. To get the best experience, choose the workspace proxy that isclosest located to you. This selection only affects browser connections to your workspace.

    to

    Workspace proxies are used to reduce the latency of connections to your workspaces. To get the best experience, choose the workspace proxy that is closest to you. This selection only affects browser connections to your workspace.

  • Add latency indicator to web terminal (add latency indicator to web terminal #7382) (two people who tried thought that it wasn't enabled for the web terminal)

  • Add basic docs for deploying via a system service

  • Add basic docs for deploying on Kubernetes

  • Add basic docs for deploying via docker run (most people will not use docker run but may try to run with app engine or AWS ECS

  • Improve "Route not found." error if no license is not present (chore: Make better error message if missing license #7440)

    ubuntu@ben-coder:~$ coder proxy ls
    Route not found.
  • workspace proxies: DERP only #7374

Medium user impact

Low user impact

  • coder proxy create polish #7908

    $ coder proxy create
    ubuntu@ben-coder:~$ coder proxy create
    proxy name is required
  • Redesign workspace proxy picker to be a bit more slick, perhaps collaborate with Bruno on it?

  • The 404 message on the proxy root endpoint is a bit jarring

    • A) Proxies should probably redirect to the access URL by default (e.g. bundled in all deployment methods or set by `coder proxy server)
    • B) add some type of general "health"/landing page that shows when the users is authenticated
  • Improve recovery time when a proxy goes offline, perhaps if it was gracefully stopped it can report shutdown to Coder? chore: Implement workspace proxy going away (graceful shutdown) #7459

    • Currently, the user has to wait around 60 seconds to get back to their workspace with no error

Unknown impact / open questions

  • What is the current behavior with Detect out-of-date coder proxies, or configuration mismatches #6592? Are workspace proxies still enabled when out-of-date?
  • Does the proxy health endpoint include more details than coder proxy ls? Is it worth documenting that an admin can hit this endpoint to get more details
  • It seemed like after stopping the proxy, and after my client began using the built-in proxy, the agent disconnected for a second and it was another minute before I could open code-server (it was using the original address, but still not resolving). Does this have to do with some type of DERP disconnect?
    • My agent also appeared to disconnect briefly when the proxy came back online.
    • Here's a video. This time it was very fast, but sometimes it takes ~10 seconds to reconnect
@matifali
Copy link
Member

matifali commented May 3, 2023

Are proxies a replacement for HA?

@deansheather
Copy link
Member

@matifali they are for reducing latency for geographically sparse teams like Coder's. You can host a proxy in regions far from the primary deployment and it will help make web connections faster and aid in speeding up CLI connections (proxies ones anyways).

@deansheather
Copy link
Member

deansheather commented May 3, 2023

Regarding system service point:

  • I've added coder-workspace-proxy.service to the deb, rpm and apk packages
  • It's identical to coder.service but it calls coder proxy start instead of coder server, and it uses /etc/coder.d/coder-workspace-proxy.env as the env file

Add basic docs for deploying on Kubernetes:

Add basic docs for deploying via docker run (most people will not use docker run but may try to run with app engine or AWS ECS

  • Basically just use coder proxy server as the entrypoint instead of the default.

List latency in the picker in "Account" settings (#7381):

  • We need a websocket endpoint on proxies and the primary that replies with ping

Automatically pick a workspace proxy based on latency (#7381):

  • To avoid opening multiple websockets when launching the dashboard, this computation should be done once and saved forever. If people want to change their proxy after that they can do it manually.
  • While determining an app we should default to the built-in region so the buttons still work, once the region is selected we can change the buttons

Add a small section for troubleshooting proxies

  • We should show the errors in the dashboard,
  • And the wildcard app URL

coder proxy create does not feel as polished as coder user create or coder template create. Some other "rough" features have this (e.g. coder provisionerd create will panic) but I think the error handling could be improved/standardized a bit before we make this feature GA.

  • Ideally if no values are provided as args we should prompt

The 404 message on the proxy root endpoint is a bit jarring

  • We could redirect
  • I don't think we should serve a health page because authenticating endpoints on the proxy is not easy, hence all of the ticket stuff we've had to do for apps and terminal
  • Also means we need to serve static files from the proxy which we avoid. The current error page is self-contained and doesn't need any static assets served.

Improve recovery time when a proxy goes offline, perhaps if it was gracefully stopped it can report shutdown to Coder?

  • I'm doing something like this with my derpmesh stuff so I'll try to throw it in

What is the current behavior with #6592? Are workspace proxies still enabled when out-of-date?

  • They are disabled if they're unreachable, and I'm making changes as part of my Derp code to prevent them from starting/registering if the version doesn't match the primary

... the agent disconnected for a second and it was another minute before I could open code-server (it was using the original address, but still not resolving). Does this have to do with some type of DERP disconnect?

  • Right now the workspace proxy doesn't influence workspace agent connections at all and doesn't contain a DERP server until my PR is merged.
  • In your video the agent is already disconnected before you hit ctrl+c so I don't think it's related.

@bpmct
Copy link
Member Author

bpmct commented May 4, 2023

@Emyrk
Copy link
Member

Emyrk commented May 8, 2023

It is confusing for a proxy to not immediately become healthy when started, especially if it was unhealthy before

This should aready be happening. I will check to confirm

@Emyrk
Copy link
Member

Emyrk commented May 10, 2023

@deansheather I did not use a websocket to measure latency. I used the Performance API: https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Resource_timing

See #7486

@Emyrk
Copy link
Member

Emyrk commented Jul 20, 2023

closing in favor of individual tickets opened

@Emyrk Emyrk closed this as completed Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ epic An issue of issues
Projects
None yet
Development

No branches or pull requests

4 participants