Skip to content

Conversation

@ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Nov 25, 2025

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

  • Modified useStartSession to 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. )
  • Removed hardcoded resource requirements from FileBrowserButton and SFTPServerButton

Fixed Bugs

  • Added handling for system session status checking
  • Removed unnecessary SFTP button disabling condition

How to test

  • folder explorer 에서 filebrowser 혹은 sftp session 을 생성합니다.
  • 네트워크 payload 에 resource 설정이 비어있는지 확인합니다.
  • 생성된 세션에 자원이 잘 할당되었는지 확인합니다.

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:

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@github-actions github-actions bot added the size:M 30~100 LoC label Nov 25, 2025
Copy link
Contributor Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Coverage report for ./react

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

@ironAiken2 ironAiken2 force-pushed the feat/FR-1004-use-server-provided-session-resource-setting branch from f90d7e3 to b9a6cc3 Compare November 25, 2025 04:48
@ironAiken2 ironAiken2 marked this pull request as ready for review November 25, 2025 04:49
Copilot AI review requested due to automatic review settings November 25, 2025 04:49
Copilot finished reviewing on behalf of ironAiken2 November 25, 2025 04:52
Copy link
Contributor

Copilot AI left a 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 useStartSession hook 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) from FileBrowserButton and SFTPServerButton components
  • Enhanced system session handling in SessionActionButtons to 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.

@ironAiken2 ironAiken2 force-pushed the feat/FR-1004-use-server-provided-session-resource-setting branch from b9a6cc3 to b2ad530 Compare November 25, 2025 05:26
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.

LGTM

Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

CleanShot 2025-11-26 at 14.27.34@2x.png

When a filebrowser session has already been created, clicking the filebrowser launch button displays an empty notification.

@ironAiken2 ironAiken2 force-pushed the feat/FR-1004-use-server-provided-session-resource-setting branch from b2ad530 to f5fa6ff Compare November 26, 2025 07:17
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Nov 26, 2025
Copy link
Contributor Author

CleanShot 2025-11-26 at 14.27.34@2x.png

When a filebrowser session has already been created, clicking the filebrowser launch button displays an empty notification.

Previously, the useStartSession hook rejected cases where created was false but a session response was received. We modified this hook to treat session creation as successful from its perspective. Since the response passes fulfilled, the existing session will be retrieved via upsertSessionNotification.

Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set SFTP session resource allocation using server-provided setting

4 participants