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:
- Run
mriya initto create and format a Block Storage volume in the configured zone. The command writes the new volume ID intomriya.toml. Usemriya init --forceto replace an existing configured volume ID. - (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"
- Configure the build tool to use the mounted volume. For Cargo:
mriya run -- cargo build
When the volume is mounted successfully, Mriya:
- 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). - Exports environment variables in the remote session to route common language
caches to the volume. These include
CARGO_HOME,RUSTUP_HOME, andCARGO_TARGET_DIR(Rust/Cargo);GOMODCACHEandGOCACHE(Go);PIP_CACHE_DIR(Python/pip);npm_config_cache,YARN_CACHE_FOLDER, andPNPM_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 initformats the volume automatically. - Only one instance can attach a given volume at a time.