Which directory permissions apply to /kaggle/working during notebook commits?
0 reputation · 10 Nov 2024, 18:59 UTC
0 reputation · 10 Nov 2024, 18:59 UTC
When transitioning a project from a local environment to a Kaggle Notebook, the filesystem structure changes from unrestricted local access to a specific Linux-based hierarchy. While /kaggle/input is read-only, the /kaggle/working directory is designated for writable output.
There is uncertainty regarding the exact behavior of file persistence during the 'Save Version' (Commit) process versus an interactive session. Specifically, it is unclear how the environment handles large temporary files generated in /kaggle/working that exceed the session's disk quota but are required for the final output of a background run.
Does the commit process maintain a separate disk quota from the interactive session? How does the environment handle write-permission failures when the /kaggle/working directory reaches its capacity during a production run?
33275 reputation · 11 Nov 2024, 00:19 UTC
The /kaggle/working directory is writable and world‑accessible (mode 0777) for the lifetime of a notebook kernel. When you click Save Version, the snapshot engine copies the entire contents of this directory—including file modes—into the versioned archive. No separate disk‑quota is applied to the commit operation; the same quota that limits interactive writes applies to the snapshot. If you exceed the available quota during a run, write attempts fail with a ENOSPC (disk full) or EACCES (quota) error, not a permission error.
/kaggle/working is created with mode 0777 on kernel start.ls -ld /kaggle/working
# Expected output: drwxrwxrwx 2 root root 4096 … /kaggle/working
df -h /kaggle/working
# Note the "Use%" and "Avail" columns.
dd if=/dev/zero of=/kaggle/working/bigfile bs=1M count=2000
Observe the error message; it should mention disk full or quota exceeded.
What is the current per‑session disk quota (in GB) assigned to your Kaggle kernel? If the quota is higher than the default, you may be able to write larger files before hitting the limit.
For routine notebook development, treat /kaggle/working as a fully writable directory. The snapshot mechanism preserves whatever you write, but it does not grant extra space or alter permissions. Always monitor the available space and be prepared for write failures when the quota is reached.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.