Skip to content

raise host-shared file size limits to 50MB#715

Merged
kvinwang merged 2 commits into
masterfrom
raise-host-shared-size-limits
Jun 5, 2026
Merged

raise host-shared file size limits to 50MB#715
kvinwang merged 2 commits into
masterfrom
raise-host-shared-size-limits

Conversation

@kvinwang
Copy link
Copy Markdown
Collaborator

@kvinwang kvinwang commented Jun 5, 2026

Why

To support small, self-contained applications that ship their content inline instead of pulling images/assets from a Docker registry. With everything embedded directly in the compose / user-config, these files can grow well beyond the previous caps, so the host-shared size limits need to be raised.

What

Raise the size limits for files shared from the host into a dstack CVM, so larger app-compose.json and .user-config files are supported.

Changes

  • dstack-util/src/system_setup.rs — in HostShared::copy, bump the per-file copy caps:
    • app-compose.json: 256 KB → 50 MB
    • .user-config: 1 MB → 50 MB
    • (other files — .sys-config.json 32 KB, .instance_info 10 KB, .encrypted-env 256 KB — unchanged)
  • vmm/src/app/qemu.rs — grow the vhd-mode shared FAT32 disk from 8 MB → 128 MB so it can still hold the larger files (2×50 MB worst case) plus FAT32 overhead. The default 9p mode is unaffected by this.

Notes

  • The default host_share_mode is 9p, which has no fixed transport-size limit; the vhd bump only matters when host_share_mode = "vhd".
  • There is also a default 10 MiB pRPC payload limit (ra-rpc/src/rocket_helper.rs) on the VMM CreateVm/UpdateVm/UpgradeApp/GetComposeHash methods that carry compose_file/user_config. That is not changed here — it is overridable per-deployment via Rocket's [limits] config and was intentionally left out of this PR.
  • KMS / verifier / dstack-mr only compute the compose hash; they do not impose a file-size limit, so attestation is unaffected.

bump the per-file copy caps for app-compose.json and .user-config from
256KB/1MB to 50MB in HostShared::copy, and grow the vhd shared disk from
8MB to 128MB so it can still hold the larger files plus FAT32 overhead.
Copilot AI review requested due to automatic review settings June 5, 2026 08:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Raises the maximum allowed sizes for host-shared app-compose.json and .user-config so larger deployment configurations can be delivered into a dstack CVM, and increases the vhd host-share transport disk size to accommodate the larger payloads.

Changes:

  • Increase guest-side host-shared copy caps for app-compose.json and .user-config to 50 MiB each.
  • Increase the vhd-mode in-memory FAT32 disk image size from 8 MiB to 128 MiB.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
vmm/src/app/qemu.rs Enlarges the vhd-mode FAT32 shared disk image to fit larger host-shared files.
dstack-util/src/system_setup.rs Raises per-file max size limits when copying host-shared files into the guest work directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vmm/src/app/qemu.rs
Comment on lines +146 to 150
// Must be large enough to hold all host-shared files (app-compose.json and
// .user-config can each be up to 50 MB, see HostShared::copy) plus FAT32 overhead.
const DISK_SIZE: usize = 128 * 1024 * 1024;
let mut disk_data = vec![0u8; DISK_SIZE];

Comment thread vmm/src/app/qemu.rs Outdated
Comment on lines +146 to +147
// Must be large enough to hold all host-shared files (app-compose.json and
// .user-config can each be up to 50 MB, see HostShared::copy) plus FAT32 overhead.
address review feedback on PR #715:
- back the vhd shared disk by a file (File::set_len) and stream files in
  via io::copy instead of building the whole 128MiB image plus per-file
  buffers in memory, keeping peak RSS bounded during VM start
- use MiB consistently in the DISK_SIZE comment
@kvinwang kvinwang merged commit 115fbd9 into master Jun 5, 2026
14 checks passed
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