Skip to content

Conversation

@agatha197
Copy link
Contributor

@agatha197 agatha197 commented Aug 5, 2025

Resolves #4048 (FR-1318)

Summary

Adds a "Run This Model" button to the ModelCardModal that enables users to start model services immediately after cloning folders if no cloned folder exists. The implementation includes smart folder management, validation, and user confirmation workflows.

Changes

Core Implementation

  • ModelTryContentButton: Enhanced component with folder cloning and service creation workflow
    • Removed modelCardMetadata dependency for cleaner
      interface
    • Added folder existence checking and validation logic
    • Implemented smart workflow: clone folder → validate
      files → create service
    • Added proper error handling and user confirmation
      dialogs

Key Features

  • Smart Folder Management: Detects existing folders vs.
    new cloning needs
  • File Validation: Checks for required
    service-definition.toml and model-definition.yaml files
  • User Confirmation: Modal dialogs for cloning and
    using existing folders
  • Background Tasks: Progress tracking with
    notifications for clone and service operations
  • Error Handling: User-friendly error messages when
    files are missing or operations fail

UI Integration

  • ModelCardModal: Re-enabled ModelTryContentButton in
    modal footer
  • Internationalization: Added translation keys across
    all language files

Technical Details

The component now follows this workflow:

  1. Check if similar named folder exists using GraphQL query
    with filters
  2. If no folder exists → Confirm clone → Clone folder →
    Validate service definition → Create service
  3. If folder exists → Confirm use existing → Validate
    service definition → Create service
  4. Show progress notifications throughout the process

Test Plan

Endpoint: 10.82.230.49

  • Verify "Run This Model" button appears in
    ModelCardModal
  • Test cloning workflow when no similar folder exists
  • Test using existing folder workflow
  • Verify service-definition.toml validation
  • Check error handling for missing files
  • Confirm progress notifications work properly
  • Test across different language localizations

@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 10:18
@github-actions github-actions bot added area:ux UI / UX issue. area:i18n Localization size:XL 500~ LoC labels Aug 5, 2025
Copy link
Contributor Author

agatha197 commented Aug 5, 2025


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.

@agatha197 agatha197 requested review from ironAiken2, lizable, nowgnuesLee and yomybaby and removed request for Copilot August 5, 2025 10:19
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 implements a button to start model services after cloning folders, introducing confirmation dialogs and validation for folder-based model service creation.

  • Adds internationalization strings for clone confirmation and folder validation messages
  • Implements folder definition file validation before service creation
  • Modifies the model card modal to include the model service button

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

File Description
Multiple i18n files Adds translation strings for folder clone confirmation dialogs and validation messages
ModelTryContentButton.tsx Major refactoring to add folder validation, confirmation dialogs, and improved service creation flow
ModelCardModal.tsx Re-enables the ModelTryContentButton in the modal footer
UserSettingsPage.tsx Updates Antd API usage from bodyStyle to styles.body
Comments suppressed due to low confidence (1)

react/src/components/ModelTryContentButton.tsx:109

  • The notification redirect URL uses data?.bgtask_id as the endpointId, but this should use the actual service endpoint ID from the service creation result. Background task ID and service endpoint ID are different values.
        method: 'GET',

@github-actions
Copy link

github-actions bot commented Aug 5, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.68% (-0.01% 🔻)
532/11360
🔴 Branches
3.78% (-0.01% 🔻)
302/7997
🔴 Functions
2.9% (+0% 🔼)
102/3517
🔴 Lines
4.63% (-0.01% 🔻)
514/11101

Test suite run success

121 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 58ed4db

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 0543a89 to b0a90af Compare August 5, 2025 10:27
@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from b0a90af to 31fcd9e Compare August 7, 2025 02:47
@github-actions
Copy link

github-actions bot commented Aug 7, 2025

Coverage report for ./packages/backend.ai-ui

St.
Category Percentage Covered / Total
🔴 Statements
51.18% (-1.93% 🔻)
130/254
🔴 Branches
32.79% (-0.41% 🔻)
80/244
🔴 Functions
34.48% (-1.23% 🔻)
20/58
🔴 Lines
53.36% (-2.04% 🔻)
119/223
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡 helper/index.ts
66.17% (-5.5% 🔻)
46.98% (-0.97% 🔻)
61.54% (-5.13% 🔻)
70% (-6% 🔻)

Test suite run success

55 tests passing in 3 suites.

Report generated by 🧪jest coverage report action from 2e63cf8

@agatha197 agatha197 requested a review from nowgnuesLee August 7, 2025 06:19
@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 31fcd9e to 8a79014 Compare August 12, 2025 02:00
@agatha197 agatha197 requested a review from ironAiken2 August 12, 2025 02:01
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

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 8a79014 to 2e63cf8 Compare August 21, 2025 01:51
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

image.png

The payload is coming in with undefined image information.

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 2e63cf8 to 1397308 Compare September 2, 2025 07:18
Copy link
Contributor Author

@ironAiken2 It is intended. The image will be set by service-definition.yaml

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 check my reviews

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 3dd1053 to fcfcf89 Compare September 17, 2025 02:35
@agatha197 agatha197 requested a review from yomybaby September 17, 2025 02:35
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.

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch 2 times, most recently from a9056e2 to 2ecca83 Compare September 23, 2025 05:23
@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch from 2ecca83 to 735b8bb Compare September 30, 2025 10:21
@agatha197 agatha197 requested a review from yomybaby September 30, 2025 10:23
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.

There is an issue where the service creation request keeps retrying indefinitely when the service creation fails.

iShot_2025-10-01_11.30.52.mp4 (uploaded via Graphite)

@agatha197 agatha197 force-pushed the feat/FR-1318-add-run-model-button branch 9 times, most recently from 8b45164 to e50a9a8 Compare October 17, 2025 05:37
@agatha197 agatha197 requested a review from yomybaby October 17, 2025 05:38
- Add ModelTryContentButton to ModelCardModal with run model functionality
- Implement folder cloning and service creation workflow
- Add validation for model-definition.yaml and service-definition.toml files
- Support both cloning new folders and using existing folders
- Add proper error handling and user confirmation dialogs
- Update internationalization files with new translation keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a button that starts the new service immediately after cloning the folder if no cloned folder exists to the ModelCardModal

4 participants