Skip to content

Fix runner server not respecting max code upload size#2689

Closed
colinjc wants to merge 0 commit intodstackai:masterfrom
colinjc:cc/05-23-fix_runner_server_not_respecting_max_code_upload_size
Closed

Fix runner server not respecting max code upload size#2689
colinjc wants to merge 0 commit intodstackai:masterfrom
colinjc:cc/05-23-fix_runner_server_not_respecting_max_code_upload_size

Conversation

@colinjc
Copy link
Copy Markdown
Contributor

@colinjc colinjc commented May 23, 2025

No description provided.

@r4victor r4victor self-assigned this 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
Copy link
Copy Markdown
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
Copy Markdown
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