Skip to content

Fix upload_code limit message#2691

Merged
r4victor merged 2 commits intomasterfrom
pr_uplode_code_limit_msg
May 26, 2025
Merged

Fix upload_code limit message#2691
r4victor merged 2 commits intomasterfrom
pr_uplode_code_limit_msg

Conversation

@r4victor
Copy link
Copy Markdown
Collaborator

@r4victor r4victor commented May 26, 2025

The error message reported size in base 10 (MB) while the default limit is in base 2 and dstack usually reports sizes in base 2 (MiB):

Repo diff size is 3.2 MB, which exceeds the limit of 2.1 MB. Use .gitignore to 
exclude large files from the repo. This limit can be modified by setting the 
DSTACK_SERVER_CODE_UPLOAD_LIMIT environment variable

Also the error message could be unclear due to rounding:

Repo diff size is 2.1 MB, which exceeds the limit of 2.1 MB. Use .gitignore to 
exclude large files from the repo. This limit can be modified by setting the 
DSTACK_SERVER_CODE_UPLOAD_LIMIT environment variable

Fixed by always displaying size in base 2 and also displaying bytes for close sizes:

Repo diff size is 3.0MiB, which exceeds the limit of 2.0MiB. Use .gitignore to 
exclude large files from the repo. This limit can be modified by setting the 
DSTACK_SERVER_CODE_UPLOAD_LIMIT environment variable.
Repo diff size is 3183563B, which exceeds the limit of 3145728B. Use .gitignore 
to exclude large files from the repo. This limit can be modified by setting the 
DSTACK_SERVER_CODE_UPLOAD_LIMIT environment variable.

Also dropped humanize dependency in favor of existing function sizeof_fmt in #2692.

@r4victor r4victor merged commit a6f857c into master May 26, 2025
25 checks passed
@r4victor r4victor deleted the pr_uplode_code_limit_msg branch May 26, 2025 09:38
@r4victor r4victor mentioned this pull request May 26, 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.

1 participant