-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1004): use server provided session resource setting in launching session #4694
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
base: main
Are you sure you want to change the base?
feat(FR-1004): use server provided session resource setting in launching session #4694
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.42% (+0% 🔼) |
517/11685 |
| 🔴 | Branches | 3.6% (+0% 🔼) |
297/8240 |
| 🔴 | Functions | 2.57% | 92/3580 |
| 🔴 | Lines | 4.4% (+0% 🔼) |
503/11429 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🔴 | ... / ResourceAllocationFormItems.tsx |
13.58% (-0.17% 🔻) |
9.35% (-0.06% 🔻) |
12% | 13.33% (-0.17% 🔻) |
Test suite run success
118 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from f5fa6ff
f90d7e3 to
b9a6cc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes hardcoded resource requirements for system sessions (SFTP and file browser), allowing the Backend.AI server to determine appropriate resource allocation instead of using client-specified values. This improves resource management flexibility and prevents issues with insufficient resource specifications for system sessions.
Key changes:
- Modified
useStartSessionhook to make resource specifications optional by omitting 'resource' from default form values and conditionally including resources in session creation payloads - Removed hardcoded resource allocations (
cpu: 1-2,mem: 0.5g) fromFileBrowserButtonandSFTPServerButtoncomponents - Enhanced system session handling in
SessionActionButtonsto properly check for RUNNING status and removed unnecessary app support checks for SFTP buttons
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
react/src/pages/SessionLauncherPage.tsx |
Added default resource values (all zeros) to FormValuesParam query parameter defaults and explicit type annotation for mergedInitialValues |
react/src/hooks/useStartSession.tsx |
Removed 'resource' from default form values and made resources/resource_opts conditional in session creation config |
react/src/components/SFTPServerButton.tsx |
Removed hardcoded resource allocation logic (cpu/mem calculation) from SFTP session creation |
react/src/components/FileBrowserButton.tsx |
Removed hardcoded resource requirements from file browser session configuration |
react/src/components/ComputeSessionNodeItems/SessionActionButtons.tsx |
Added system session status check to isActive function and removed isAppSupported check from SFTP button disabled condition |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
b9a6cc3 to
b2ad530
Compare
agatha197
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b2ad530 to
f5fa6ff
Compare
Previously, the |
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM


Removed resource values for filebrowser and sftp session
resolves #3673(FR-1004)
This PR removes explicit resource requirements when creating system sessions (like SFTP and file browser sessions), allowing the server to determine appropriate resource allocation. Key changes:
Features
useStartSessionto make resource specifications optional (The session launcher side uses ResourceAllocationFormItems, so no separate modifications are needed. Instead, the useStartSession side, which imports the type, is modified to allow the resource to be optional. )FileBrowserButtonandSFTPServerButtonFixed Bugs
How to test
These changes ensure system sessions use server-defined resource allocations rather than client-specified values, which improves resource management and prevents potential issues with insufficient resources.
Checklist: