Skip to content

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 (guarded by auth, and expiration)

    • Only allow submit single python file (guarded in both FE and API)
    • Rate limit per user: user can only submit 10 submission per 30 mins through all leaderboard
  • Submit History(guarded by auth)

    • List the history of submission user has for the leaderboard

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

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.

1 participant