Skip to content

Change order of coder agents in web interface #7964

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
Tracked by #8995
jaulz opened this issue Jun 12, 2023 · 10 comments · Fixed by #12121
Closed
Tracked by #8995

Change order of coder agents in web interface #7964

jaulz opened this issue Jun 12, 2023 · 10 comments · Fixed by #12121
Assignees

Comments

@jaulz
Copy link

jaulz commented Jun 12, 2023

Is there any possibility to change the order of coder agents in web interface when you view the workspace? I have multiple agents and my main workspace is listed last. This is not a big deal but when I try to connect from CLI to my workspace (via coder ssh) it connects to the one listed first.

@cdr-bot cdr-bot bot added the feature label Jun 12, 2023
@mafredri
Copy link
Member

Hi @jaulz, thanks for opening the issue.

I can think of a couple of options that may help here.

  1. Introduce a new terraform option to toggle ssh for the agent
resource "coder_agent" "coder" {
  ssh = false
}

This would remove the agent from the pool of possible agents to connect to. If you only have one, you'll get the desired behavior. Otherwise you'll need to specify which agent you want (ssh coder.workspace.agent1).

  1. Introduce a sorting/prioritizing option in terraform
resource "coder_agent" "agent2" {
  priority = 2
}
resource "coder_agent" "agent1" {
  priority = 1
}

This could be reflected in the UI and also when e.g. generating ssh configs. (This could be called order instead.)

  1. Manual sorting in WebUI

This doesn't help with SSH, but perhaps another option is to allow each user to manually sort their workspaces. Could be combined with option 1 and it might be useful even in the presence of option 2.

Do any of these sound like what you would like to see in the Coder?

PS. If you can share, I would love to know more about your use-case for multiple agents.

@jaulz
Copy link
Author

jaulz commented Jun 12, 2023

@mafredri yep, point 2 actually sounds like a good solution which would be even better than just having a default property which I had originally in mind. My use-case for having multiple-agents is actually what I mentioned in another issue: I would like to run commands in some of the containers in order to view logs etc.

@ammario
Copy link
Member

ammario commented Jun 12, 2023

Not sure about putting layout controls in the template HCL. We have a similar problem with the display of agent / resource metadata. Maybe we should introduce a new product concept for layout.

@jaulz
Copy link
Author

jaulz commented Jun 13, 2023

@ammario the actual idea would be that the priority can be used to define the default agent. The actual order in the layout would just be a nice side effect 😊

@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 11, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@jaulz
Copy link
Author

jaulz commented Dec 19, 2023

@ammario could you elaborate why this one is not planned? Thanks!

@ammario
Copy link
Member

ammario commented Jan 2, 2024

@jaulz — that's stalebot so it's more a matter of insufficient engineering resources to tackle this than thinking it's out of scope of the Coder project.

I see one approach that may be orthogonal with our existing concepts:

coder_metadata at the moment has a hide boolean. We could replace this with a priority number and sort ascending on the UI. If priority is <0 we could hide the value. This would be a breaking change but the upgrade path is simple enough that it may not even be worth deprecating hide before removing it.

@mafredri since you were thinking about this recently I'm curious for your thought on the idea.

@ammario ammario reopened this Jan 2, 2024
@github-actions github-actions bot removed the stale This issue is like stale bread. label Jan 3, 2024
@matifali
Copy link
Member

matifali commented Jan 3, 2024

Is there any possibility to change the order of coder agents in web interface when you view the workspace? I have multiple agents and my main workspace is listed last. This is not a big deal but when I try to connect from CLI to my workspace (via coder ssh) it connects to the one listed first.

As per my observation, this current order is random and the agent that connects first goes to the top.

@mafredri
Copy link
Member

mafredri commented Jan 3, 2024

@ammario I think that's an acceptable strategy for both agent and metadata. Currently we use order for parameters, and I don't think we have a precedent for priority, but I think the terminology is acceptable. It'd be nice to unify all three, though.

While we're at it, I think it'd be a good idea to ensure we have a robust ordering in the case of collision/absence of prioritization (e.g. alphabetical), which behaves the same way everywhere. (It'd be how we pick the default agent to SSH to, for instance.)

OTOH, I think it's sensible to have hide as well, from the perspective of it being easier to explain/understand than having prioritization affecting visibility.

@ammario
Copy link
Member

ammario commented Jan 3, 2024

order is a good point. We should keep the terminology the same.

@mtojek mtojek self-assigned this Feb 12, 2024
@mtojek
Copy link
Member

mtojek commented Feb 12, 2024

I'm going with this issue.

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 a pull request may close this issue.

5 participants