Skip to content

Make local code upload size limit configurable#2673

Merged
r4victor merged 1 commit intodstackai:masterfrom
colinjc:cc/05-20-make_local_code_upload_size_limit_configurable
May 21, 2025
Merged

Make local code upload size limit configurable#2673
r4victor merged 1 commit intodstackai:masterfrom
colinjc:cc/05-20-make_local_code_upload_size_limit_configurable

Conversation

@colinjc
Copy link
Copy Markdown
Contributor

@colinjc colinjc commented May 20, 2025

Resolves #2663

Adds an env variable which can be used to configure the max code upload size, or disable it. Also improves error message when hitting limit by including size of diff.

USER_PROJECT_DEFAULT_QUOTA = int(os.getenv("DSTACK_USER_PROJECT_DEFAULT_QUOTA", 10))
FORBID_SERVICES_WITHOUT_GATEWAY = os.getenv("DSTACK_FORBID_SERVICES_WITHOUT_GATEWAY") is not None

SERVER_CODE_UPLOAD_LIMIT = int(os.getenv("DSTACK_SERVER_CODE_UPLOAD_LIMIT", 2 * 2**20))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it be easy to implement this as a friendly string like 2M or 1G?

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.

LGTM, so merging it now. Feel free to open a new PR if parsing human-readable strings is needed.

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.

@dakota-shop, other environment variables like DSTACK_DEFAULT_SERVICE_CLIENT_MAX_BODY_SIZE do not support human-readable strings as well, so probably makes sense to add the parsing to all of them if at all.

@r4victor r4victor merged commit 3d8ab62 into dstackai:master May 21, 2025
25 checks passed
@r4victor
Copy link
Copy Markdown
Collaborator

Thanks!

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.

[Feature]: Make local code upload size limit configurable

3 participants