Skip to content

feat: Add workspace proxy enterprise cli commands #7123

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

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Apr 13, 2023

What this does

Makes a cli command to spin up external workspace proxies!

coder proxy register # ....
coder proxy server # ....

Testing/Development

This gives develop.sh an option --use-proxy which will spin up the devserver with an external workspace proxy. This should allow easier manual validation.

Features added to make this work

  • Cli command to delete workspace proxies.
  • clibase.Optionset filter to filter out options that do not pertain to the workspace proxy.
  • Ability to hard code app-security-key

Logs

Run ./develop.sh --use-proxy

====================================================================
==                                                                ==
==            Coder is now running in development mode.           ==
==                  API:    http://localhost:3000                 ==
==                  API:    http://127.0.0.1:3000                 ==
==                  API:    http://192.168.1.17:3000              ==
==                  API:    http://192.168.1.18:3000              ==
==                  API:    http://172.25.0.1:3000                ==
==                  Web UI: http://localhost:8080                 ==
==                  Web UI: http://127.0.0.1:8080                 ==
==                  Web UI: http://192.168.1.17:8080              ==
==                  Web UI: http://192.168.1.18:8080              ==
==                  Web UI: http://172.25.0.1:8080                ==
==                  Proxy:  http://localhost:3010                 ==
==                  Proxy:  http://127.0.0.1:3010                 ==
==                  Proxy:  http://192.168.1.17:3010              ==
==                  Proxy:  http://192.168.1.18:3010              ==
==                  Proxy:  http://172.25.0.1:3010                ==
==                                                                ==
==      Use ./scripts/coder-dev.sh to talk to this instance!      ==
==       alias cdr=/home/steven/go/src/github.com/cdr/coder/scripts/coder-dev.sh              ==
====================================================================

cli.PrintDeprecatedOptions(),
clibase.RequireNArgs(0),
// We need a client to connect with the primary coderd instance.
r.InitClient(client),
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this just be a proxysdk client that we construct in the handler?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was honestly just using this for the version checking.

primaryAccessURL clibase.URL
appSecuritYKey clibase.String
)
opts.Add(
Copy link
Member

Choose a reason for hiding this comment

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

Can't these be added to the regular config struct, and then the primary server can filter them out?

Copy link
Member Author

Choose a reason for hiding this comment

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

We talked on discord. I think the best move here is to autogenerate the Deployment struct from the Options. Then we can create all the options in 1 place, and filter them.

I will do this in another branch, this is ok for now here just to get a cmd working.

Follow up PRs will make the workspace proxy creation/register experience better.

@Emyrk Emyrk force-pushed the dreamteam/external_proxy_cli_cmd branch 2 times, most recently from abc7415 to 27d1476 Compare April 17, 2023 19:51
@Emyrk Emyrk force-pushed the dreamteam/external_proxy_cli_cmd branch from 27d1476 to ea3593d Compare April 17, 2023 19:53
Base automatically changed from dreamteam/external_proxy to main April 17, 2023 19:57
@Emyrk Emyrk changed the base branch from main to stevenmasley/external_proxy_2 April 17, 2023 20:22
@Emyrk
Copy link
Member Author

Emyrk commented Apr 17, 2023

Rebased to #7176

@Emyrk Emyrk closed this Apr 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2023
@github-actions github-actions bot deleted the dreamteam/external_proxy_cli_cmd branch October 18, 2023 00:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants