Skip to content

Comments

Add submission logic#79

Merged
yangw-dev merged 17 commits intomainfrom
addsubmit
Aug 28, 2025
Merged

Add submission logic#79
yangw-dev merged 17 commits intomainfrom
addsubmit

Conversation

@yangw-dev
Copy link
Collaborator

@yangw-dev yangw-dev commented Aug 26, 2025

Description

Introduce submission to gpumode

Call submission api

it calls post submission apifrom cluster-management pr. The api return sub_id immediately, and update the job status in the background.

Details

  • Auth: add web_auth_token if it does not exist in user_info in db, create user_info with web_auth_token if it does not exists
  • Submit:
    • backend: guarded by @required_login
    • frontend: guarded by login info and expired date
  • rate limiter:[only submission api]Restrict a single user 60 per minute to avoid malicious upload
  • File size: max 1MB (limited on both fe and be)

Demo

Login user

User logged in can see the submission and submission history
login_show_submission

Submission

when submit success, user is notified immediately, and user can refresh the submission history to see the status of the submission:

submit_return_immediately

When no login info

User cannot see submission infos when they are not logged in

nologin

Handle Submission Failure

![showerrowhensubmissiofail](https://github.com

Block submission button when Expired

submission_blocked_when_expired
/user-attachments/assets/d35b18f9-6c45-41ea-8f31-705cc1cc3795)

Rate limit

Render error when user hit rate limit:
hit_rate_limit

@yangw-dev yangw-dev changed the title Addsubmit Add submission logic Aug 26, 2025
return items, total


def is_rate_limited(user_id: int, window: dt.timedelta = WINDOW) -> bool:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@b9r5
I set rate limite 10 submission per person in 30 mins, let me know if this is reasonable

@yangw-dev yangw-dev requested a review from b9r5 August 26, 2025 19:36
@yangw-dev yangw-dev marked this pull request as ready for review August 27, 2025 01:36
login_user(User(f"{provider}:{identity}"))

# 6) Clean up and redirect
# 6) Clean up and redirec
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# 6) Clean up and redirec
# 6) Clean up and redirect

Copy link
Collaborator

@b9r5 b9r5 left a comment

Choose a reason for hiding this comment

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

Some fairly minor comments, but basically looks good!

yangw-dev and others added 3 commits August 27, 2025 17:07
@yangw-dev yangw-dev requested a review from b9r5 August 28, 2025 00:20
@yangw-dev yangw-dev merged commit 1403d9a into main Aug 28, 2025
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 this pull request may close these issues.

2 participants