Persistent cache volume

Updated Dec 26, 2025

Mriya can attach a Block Storage volume to the ephemeral VM for caching build artefacts between runs. When configured, the volume is attached before the instance starts and mounted at /mriya. Place build caches (such as Cargo's target directory) on this volume to persist compiled dependencies across runs.

To enable the cache volume:

  1. Run mriya init to create and format a Block Storage volume in the configured zone. The command writes the new volume ID into mriya.toml. Use mriya init --force to replace an existing configured volume ID.
  2. (Optional) override the volume ID explicitly via configuration:
   export SCW_DEFAULT_VOLUME_ID="11111111-2222-3333-4444-555555555555"

Or in mriya.toml:

   [scaleway]
   default_volume_id = "11111111-2222-3333-4444-555555555555"
  1. Configure the build tool to use the mounted volume. For Cargo:
   mriya run -- cargo build

When the volume is mounted successfully, Mriya:

  1. Creates cache subdirectories under the mount point so toolchains can write immediately (cargo, rustup, target, go/pkg/mod, go/build-cache, pip/cache, npm/cache, yarn/cache, pnpm/store).
  2. Exports environment variables in the remote session to route common language caches to the volume. These include CARGO_HOME, RUSTUP_HOME, and CARGO_TARGET_DIR (Rust/Cargo); GOMODCACHE and GOCACHE (Go); PIP_CACHE_DIR (Python/pip); npm_config_cache, YARN_CACHE_FOLDER, and PNPM_STORE_PATH (Node tooling).

If mounting fails (for example, when the volume has no filesystem), the run continues without the cache — this allows graceful degradation for first-time setups.

mriya init uses a temporary formatter instance and runs mkfs.ext4 against the new volume. Adjust the default size with MRIYA_INIT_VOLUME_SIZE_GB or in mriya.toml:

[init]
volume_size_gb = 50

Requirements:

  • The volume must exist in the same zone as the instance.
  • The volume should be formatted with a filesystem (ext4 recommended) before first use. mriya init formats the volume automatically.
  • Only one instance can attach a given volume at a time.