Skip to content

Allow overriding popcorn id with POPCORN_SUBMITTER_ID env arg#57

Open
Jack-Khuu wants to merge 4 commits intogpu-mode:mainfrom
Jack-Khuu:id-env
Open

Allow overriding popcorn id with POPCORN_SUBMITTER_ID env arg#57
Jack-Khuu wants to merge 4 commits intogpu-mode:mainfrom
Jack-Khuu:id-env

Conversation

@Jack-Khuu
Copy link
Copy Markdown

When submitting via proxy or in a setting with multiple accounts it is difficult to switch submitter identites (currently always reads from .popcorn.yaml)

This PR adds POPCORN_SUBMITTER_ID as an env flag override

Build

./build.sh

Normal run

> ./target/release/popcorn-cli submissions list --leaderboard matmul_v2

ID       Leaderboard          File                 Time                 GPU(s)       Status          Score
---------------------------------------------------------------------------------------------------------

Override

> POPCORN_SUBMITTER_ID=0987654 ./target/release/popcorn-cli submissions list --leaderboard matmul_v2

**Application error: Server returned status 401 Unauthorized: Invalid or unauthorized auth header elaine**
>   POPCORN_SUBMITTER_ID=$(grep 'cli_id:' ~/.popcorn.yaml | awk '{print $2}') ./target/release/popcorn-cli submissions list --leaderboard matmul_v2

ID       Leaderboard          File                 Time                 GPU(s)       Status          Score
---------------------------------------------------------------------------------------------------------

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/mod.rs 73.33% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

dirs::home_dir() on Windows uses the shell API (SHGetKnownFolderPath),
not the HOME env var, so we cannot redirect config lookup in tests.
Gate config-fallback tests with #[cfg(not(windows))]. The env var
override path is still tested cross-platform. Also recover from
poisoned mutex so one test failure doesn't cascade.
@Jack-Khuu
Copy link
Copy Markdown
Author

@msaroufim @S1ro1 lmk what you think? We'd use it on the HLH server side to submit on behalf of users

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