Skip to content

Fix runner server not respecting max code upload size #2689

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

Conversation

colinjc
Copy link
Contributor

@colinjc colinjc commented May 23, 2025

No description provided.

@r4victor r4victor self-assigned this May 26, 2025
@@ -38,6 +38,7 @@
VolumeProvisioningData,
)
from dstack._internal.core.services import is_valid_dstack_resource_name
from dstack._internal.server.settings import SERVER_CODE_UPLOAD_LIMIT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to http.MaxBytesReader(w, r.Body, math.MaxInt64)

@colinjc colinjc closed this May 26, 2025
@colinjc colinjc force-pushed the cc/05-23-fix_runner_server_not_respecting_max_code_upload_size branch from 0552a34 to 3d5ab80 Compare May 26, 2025 13:30
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.

2 participants