Scratch

Working with Intermediate Data in Code Ocean

When launching a cloud workstation, working with a large volume of data can significantly affect the performance of the capsule. Disk space is limited and copying large volumes of data back and forth between the cloud workstation and capsule is time-consuming and not recommended.

The scratch folder is a dedicated folder mounted to the capsule. The storage space in this folder is practically unlimited and is persisted throughout the capsule's lifetime across all of its cloud workstation sessions. Regardless of how large the data stored is, the capsule's performance is unaffected.

To improve the efficiency, you should always save intermediate works in the scratch folder.

The path for the scratch is:

/root/capsule/scratch or /scratch

This folder is not available for reproducible runs and should only be used for storing large intermediate data.

If the data is used by other capsules or required for reproducibility, you should create/store it as a Data Asset.

You can create a Data Asset directly from the data you store or prepare in the scratch folder. See Create a Dataset From a Folder for more detail.

Should the capsule be deleted, both the capsule and the scratch folder would be deleted as well.

Last updated