Skip to content
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

add: AgentSelect when hideAgent configuration is disabled #2599

Conversation

lizable
Copy link
Contributor

@lizable lizable commented Aug 1, 2024

Resolves #2589

Changes:
Adds agent selection capability to the session launcher, allowing users to manually choose specific compute agents instead of relying solely on automatic scheduler allocation.

Key additions:

  • New AgentSelect component displaying available agents with their remaining resource capacities
  • Integration into resource allocation form with auto-select option as default
  • Agent selection is restricted to single-node single-container environments
  • Added translations for agent selection UI elements across multiple languages

When a specific agent is selected:

  • Cluster mode is forced to single-node
  • Cluster size is set to 1
  • The selection is passed to the backend via the agent_list parameter

The agent selector includes a refresh button to update the available agent list and displays real-time resource availability for each agent.

Minimum requirements to check:

  • Agent selection dropdown shows available agents with correct resource information
  • Selecting a specific agent properly restricts cluster configuration
  • Auto-select option works as default
  • Refresh button updates the agent list
  • Agent selection is only available when not hidden by configuration

Test cases:

⚠️ Prerequisites:

  1. Set the value of hideAgents in config file to false.
  2. Change the branch of Backend.AI Core to this PR (https://app.graphite.dev/github/pr/lablup/backend.ai/2614/refactor-apply-session-allocation-at-specific-agent-when-hide-agent-option-is-disabled)
  3. Set the value of hide-agents to false in manager.toml file
  4. Restart Manager process.
  1. Verify agent list displays with resource information
  2. Confirm cluster settings are restricted when specific agent is selected
  3. Test refresh functionality updates available agents
  4. Validate auto-select behavior works as expected

Screenshot(s)

After Before
Screenshot 2024-11-05 at 6.23.47 PM.png Screenshot 2024-11-05 at 6.24.18 PM.png

Copy link

graphite-app bot commented Aug 1, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

lizable commented Aug 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @lizable and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added area:ux UI / UX issue. area:i18n Localization size:L 100~500 LoC size:XL 500~ LoC and removed size:L 100~500 LoC labels Aug 1, 2024
Copy link

github-actions bot commented Aug 2, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
5.04% (+0.08% 🔼)
367/7287
🔴 Branches
4.4% (-0.03% 🔻)
221/5025
🔴 Functions
2.95% (-0.01% 🔻)
71/2405
🔴 Lines
4.94% (+0.08% 🔼)
352/7126
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / AgentSelect.tsx
6.25% 0% 0% 6.25%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / ResourceAllocationFormItems.tsx
15.28% (-0.51% 🔻)
10.33% (-0.31% 🔻)
12.33% (-0.71% 🔻)
15.02% (-0.44% 🔻)

Test suite run success

100 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from 5a12000

@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from 8fbe099 to db4f228 Compare August 2, 2024 10:17
@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from db4f228 to 9621fc9 Compare August 13, 2024 02:00
@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from 9621fc9 to ec7dde3 Compare November 5, 2024 09:12
@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from ec7dde3 to b1f9d48 Compare November 5, 2024 09:21
@lizable lizable marked this pull request as ready for review November 5, 2024 09:27
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

🙏 Please resolve conflicts. @lizable

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

Please resolve the conflicts :)

react/src/components/AgentSelect.tsx Outdated Show resolved Hide resolved
@lizable lizable added this to the 24.09 milestone Nov 6, 2024
@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from b1f9d48 to e52d075 Compare November 6, 2024 07:41
@github-actions github-actions bot added field:UI / UX type:enhance Add new features urgency:5 It is imperative that action be taken right away. labels Nov 6, 2024
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

"Currently, agent selection is only available in a single-node single-container environment."

~~It's better to disable and change the form values related to cluster setting when user set the specific agent.~~Oh, I see you've already handled this. I'll check again when the multi-node test server is ready.

react/src/components/AgentSelect.tsx Outdated Show resolved Hide resolved
@lizable lizable requested review from agatha197 and yomybaby November 8, 2024 03:01
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

Additional work to be necessary:

  • Add agent info to preview step
    image.png
  • Please add a version condition to ensure version compatibility.

Below is not related to this PR's changes, but need to be fix

  • When pending status, "null(undefined)" in Agent column
    image.png

@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from e52d075 to 3d9fc31 Compare November 8, 2024 04:31
@github-actions github-actions bot added the area:lib Library and SDK related issue. label Nov 8, 2024
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM 💪

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

AgentSelector still remains.

react/src/components/ResourceAllocationFormItems.tsx Outdated Show resolved Hide resolved
react/src/components/ResourceAllocationFormItems.tsx Outdated Show resolved Hide resolved
react/src/components/ResourceAllocationFormItems.tsx Outdated Show resolved Hide resolved
@lizable lizable force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from dac7afe to 7841cbb Compare November 11, 2024 02:23
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

Let's handle the resource preset issue separately. LGTM

Copy link

graphite-app bot commented Nov 11, 2024

Merge activity

Resolves #2589

**Changes:**
Adds agent selection capability to the session launcher, allowing users to manually choose specific compute agents instead of relying solely on automatic scheduler allocation.

Key additions:
- New `AgentSelect` component displaying available agents with their remaining resource capacities
- Integration into resource allocation form with auto-select option as default
- Agent selection is restricted to single-node single-container environments
- Added translations for agent selection UI elements across multiple languages

When a specific agent is selected:
- Cluster mode is forced to single-node
- Cluster size is set to 1
- The selection is passed to the backend via the `agent_list` parameter

The agent selector includes a refresh button to update the available agent list and displays real-time resource availability for each agent.

**Minimum requirements to check:**
- Agent selection dropdown shows available agents with correct resource information
- Selecting a specific agent properly restricts cluster configuration
- Auto-select option works as default
- Refresh button updates the agent list
- Agent selection is only available when not hidden by configuration

**Test cases:**
> ⚠️ Prerequisites:
> 1. Set the value of  `hideAgents` in config file to false.
> 2. Change the branch of Backend.AI Core to this PR (https://app.graphite.dev/github/pr/lablup/backend.ai/2614/refactor-apply-session-allocation-at-specific-agent-when-hide-agent-option-is-disabled)
> 3. Set the value of `hide-agents` to false in manager.toml file
> 4. Restart Manager process.

1. Verify agent list displays with resource information
2. Confirm cluster settings are restricted when specific agent is selected
3. Test refresh functionality updates available agents
4. Validate auto-select behavior works as expected

### Screenshot(s)
| After | Before |
|------|--------|
| ![Screenshot 2024-11-05 at 6.23.47 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/Dgoz5XqHffJdivyccymr/a7a8c6ff-1ba2-4efd-a713-8f33df11c084.png) | ![Screenshot 2024-11-05 at 6.24.18 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/Dgoz5XqHffJdivyccymr/37e308b0-0463-4959-a455-0701f6cc9a9a.png) |
@agatha197 agatha197 force-pushed the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch from 7841cbb to 5a12000 Compare November 11, 2024 03:03
@graphite-app graphite-app bot merged commit 5a12000 into main Nov 11, 2024
7 checks passed
@graphite-app graphite-app bot deleted the feature/provide-agent-select-option-when-hideAgent-config-is-disabled branch November 11, 2024 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:i18n Localization area:lib Library and SDK related issue. area:ux UI / UX issue. field:UI / UX size:XL 500~ LoC type:enhance Add new features urgency:5 It is imperative that action be taken right away.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide selecting agent when creating a session in Neo Session launcher.
3 participants