Fix runner server not respecting max code upload size#2689
Closed
colinjc wants to merge 0 commit intodstackai:masterfrom
Closed
Fix runner server not respecting max code upload size#2689colinjc wants to merge 0 commit intodstackai:masterfrom
colinjc wants to merge 0 commit intodstackai:masterfrom
Conversation
r4victor
reviewed
May 26, 2025
| VolumeProvisioningData, | ||
| ) | ||
| from dstack._internal.core.services import is_valid_dstack_resource_name | ||
| from dstack._internal.server.settings import SERVER_CODE_UPLOAD_LIMIT |
Collaborator
There was a problem hiding this comment.
backends code must not depend on server modules and cannot import from dstack._internal.server. A solution would be to make the environment variable non server specific (e.g. define DSTACK_CODE_UPLOAD_LIMIT in dstack._internal.settings. Alternatively, we can fix 413 by always setting http.MaxBytesReader(w, r.Body, math.MaxInt64). It shouldn't lead to problems since the runner API is exposed in a trusted environment only and will be effectively limited by the server upload limit anyway.
Collaborator
There was a problem hiding this comment.
I'm inclined to http.MaxBytesReader(w, r.Body, math.MaxInt64)
0552a34 to
3d5ab80
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.