Skip to content

Fix upload_code limit message #2691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2025
Merged

Fix upload_code limit message #2691

merged 2 commits into from
May 26, 2025

Conversation

r4victor
Copy link
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