Storing models on a NAS
Models can live on a NAS (e.g. TrueNAS) while Kaname runs on another machine. Mount the share on
the Docker host and point KANAME_MODELS_DIR at the mount.
1. Mount the share on the Docker host
Add a line to /etc/fstab (adjust host, export and mount point):
Then mount it:
2. Point Kaname at it
Requirements
- NFSv4. The
hf CLI uses file locks, which aren't reliable with NFSv3 or nolock.
- Writable for Kaname's user. Kaname runs as uid/gid 1000 unless you set
PUID/PGID in
.env. Either set those to the share's owner (ls -ln /mnt/nas/models), make 1000 the owner of
the dataset, or on TrueNAS set Mapall User/Group on the NFS share to that user.
- Mounted before Docker starts.
_netdev makes the mount wait for the network. If the share
isn't mounted when the worker starts, Docker uses the empty local folder and models end up on the
host's disk. After mounting later, recreate the worker (docker compose up -d --force-recreate worker).
hard mount. If the NAS is unreachable, downloads wait instead of writing broken files.
What not to put on the NAS
Keep KANAME_DATA_DIR (the SQLite database) on the Docker host's local disk. SQLite relies on file
locking and shared memory that don't work reliably over NFS or SMB.