Skip to main content

File and folder sources

File-based sources — file, csv, excel, json, parquet, sqlite, duckdb and folder — point to a path. That path is read by the worker process, on the machine or in the container where the worker runs. It is never read from your workstation, nor from the platform.

Which path to enter​

How the worker runsPath to enter
Installed with pipA path on that machine, for example /srv/data/orders.csv.
Docker containerA path inside the container, for example /data/orders.csv. Never the path on the Docker host, nor a path on your workstation.
Docker Desktop on WindowsMount the folder with -v C:\data:/data:ro, then enter /data/orders.csv. Never C:\data\orders.csv, nor a mapped network drive.
Kubernetes podA path under the mountPath of a volume mounted in the worker pod (see Kubernetes).

From QALITA CLI 3.2.0, the local UI states this under each path field. When the worker runs in a container, the form also lists the volumes mounted in the container — mount point, filesystem type, read-only flag, and a worker state tag on the worker's own state directory. It says when no data volume is mounted besides that state directory, and hides the Browse… button, because its file picker cannot open inside a container. qalita source add prints the same information before it asks for the path, and a failed validation of a path source in a container reminds you that the path is a container path.

Local directory of the Docker host​

Bind-mount the directory into the worker container, preferably read-only, and enter the container path:

docker run -d --name qalita-worker --restart unless-stopped \
-v /srv/qalita:/home/qalita/.qalita \
-v /srv/data:/data:ro \
... \
qalita/cli worker run

Then declare the source with /data/orders.csv, or the folder /data.

The container runs as the non-root user uid 10001 (see Image layout): the files must be readable, and the directories traversable, by that user. With :ro, the worker cannot modify your data.

Network share (SMB/CIFS or NFS)​

The worker container does not mount network shares itself: the image runs as a non-root user, and mounting a share from inside a container would require the CAP_SYS_ADMIN capability. Chain three steps instead:

network share                  host or VM mount     worker container     source path
//fileserver.example/exports → /mnt/exports → /data/exports → /data/exports/2026/orders.csv

1. Mount the share on the host or VM​

SMB/CIFS. Keep the share credentials in a file that only root can read:

sudo apt-get install cifs-utils
sudo mkdir -p /mnt/exports /etc/qalita
# Create the file with mode 600 before writing the password into it
sudo install -m 600 /dev/null /etc/qalita/exports.cred
sudo tee /etc/qalita/exports.cred > /dev/null <<'EOF'
username=svc-qalita
password=change-me
domain=EXAMPLE
EOF

Then declare the mount in /etc/fstab (one line):

/etc/fstab
//fileserver.example/exports  /mnt/exports  cifs  credentials=/etc/qalita/exports.cred,uid=10001,gid=10001,file_mode=0440,dir_mode=0550,ro,vers=3.0,_netdev,nofail  0  0
  • uid=10001,gid=10001 hand every file to the worker user, and file_mode=0440,dir_mode=0550 keep them read-only;
  • ro mounts the share read-only;
  • _netdev waits for the network, and nofail lets the host boot even when the file server is down;
  • adapt vers= to what your file server supports.

Mount it and check: sudo mount /mnt/exports && ls /mnt/exports.

NFS.

/etc/fstab
nas.example:/archive  /mnt/archive  nfs4  ro,_netdev,nofail  0  0

NFS keeps the owners and permissions of the server: the files must be readable by uid 10001 (or by everyone), and the export must allow the host. Root squashing does not matter, since the worker does not run as root.

Start Docker after the mounts (optional). After a reboot, a systemd drop-in makes Docker wait for the mount attempts, so the workers do not start on an empty mount point. systemd-escape -p --suffix=mount /mnt/exports gives the name of each mount unit (mnt-exports.mount). Then:

sudo systemctl edit docker.service
[Unit]
Wants=mnt-exports.mount mnt-archive.mount
After=mnt-exports.mount mnt-archive.mount

Docker waits for each mount attempt but does not depend on its result. When a file server is down at boot, Docker starts once the attempt fails or times out, and only the worker of that share sees an empty folder (see Troubleshooting). After=remote-fs.target is not enough: with nofail, the boot does not wait for these mounts.

Do not put Requires= or RequiresMountsFor= on docker.service. One unavailable share would then keep Docker, and every container on the host, from starting. Stopping or restarting a mount unit would also stop or restart Docker.

2. Bind-mount it into the worker container​

Add -v /mnt/exports:/data/exports:ro to docker run, or a volumes: entry as in the docker-compose example below.

3. Declare the source with the container path​

In the local UI or with qalita source add, enter /data/exports/..., the path inside the container. Never //fileserver.example/exports/..., \\fileserver.example\exports\..., a drive letter, nor the host path /mnt/exports/....

docker-compose example: one worker per share​

Two shares, two workers. Each worker has its own state directory, its own token and only the share it reads:

docker-compose.yml
services:
worker-exports:
image: qalita/cli:latest # pin the tag matching your platform version
command: worker run
restart: unless-stopped
environment:
QALITA_WORKER_NAME: worker-exports
QALITA_WORKER_MODE: worker
QALITA_WORKER_ENDPOINT: https://backend.example.com:3080
QALITA_WORKER_TOKEN: ${EXPORTS_WORKER_TOKEN}
QALITA_WORKER_UI: "true"
QALITA_WORKER_UI_PORT: "7070"
QALITA_WORKER_UI_HOST: 0.0.0.0
volumes:
- /srv/qalita/worker-exports:/home/qalita/.qalita
- /mnt/exports:/data/exports:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:7070:7070"

worker-archive:
image: qalita/cli:latest
command: worker run
restart: unless-stopped
environment:
QALITA_WORKER_NAME: worker-archive
QALITA_WORKER_MODE: worker
QALITA_WORKER_ENDPOINT: https://backend.example.com:3080
QALITA_WORKER_TOKEN: ${ARCHIVE_WORKER_TOKEN}
QALITA_WORKER_UI: "true"
QALITA_WORKER_UI_PORT: "7070"
QALITA_WORKER_UI_HOST: 0.0.0.0
volumes:
- /srv/qalita/worker-archive:/home/qalita/.qalita
- /mnt/archive:/data/archive:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:7080:7070"

The tokens go in a .env file next to docker-compose.yml, readable only by you:

.env
EXPORTS_WORKER_TOKEN=...
ARCHIVE_WORKER_TOKEN=...
sudo mkdir -p /srv/qalita/worker-exports /srv/qalita/worker-archive
sudo chown -R 10001:10001 /srv/qalita
chmod 600 .env
docker compose up -d

The UI of worker-exports answers on 127.0.0.1:7070 of the host, the UI of worker-archive on 127.0.0.1:7080. In each one, declare the sources with the container paths /data/exports/... and /data/archive/....

The local UI has no authentication, and it can read the shares mounted in its container. Keep its port on the loopback interface, as above: QALITA_WORKER_UI_HOST: 0.0.0.0 is needed inside the container, and the 127.0.0.1: prefix keeps the port off the host's network. Reach the UI through an SSH tunnel (ssh -L 7070:127.0.0.1:7070 you@docker-host) or a reverse proxy with authentication, never on an open network.

Alternative: a Docker-managed CIFS volume​

Docker can also mount the share itself, through a named volume. The Docker daemon performs the mount, not the worker:

docker-compose.yml
services:
worker-exports:
# ... as above, except the share volume:
volumes:
- /srv/qalita/worker-exports:/home/qalita/.qalita
- exports:/data/exports:ro

volumes:
exports:
driver: local
driver_opts:
type: cifs
device: //fileserver.example/exports
o: addr=fileserver.example,username=${SHARE_USER},password=${SHARE_PASSWORD},uid=10001,gid=10001,ro,vers=3.0

This is useful with Docker Desktop, where the network drives mapped in Windows are invisible to containers, and on hosts where you cannot edit /etc/fstab. Keep in mind that:

  • the share credentials sit in the .env file: restrict its permissions (chmod 600 .env);
  • anyone allowed to run docker volume inspect on the host can read the mount options, password included;
  • Docker keeps the options a volume was created with: after changing them, remove the volume (docker volume rm <project>_exports) so that it is recreated.

Prefer the host mount with a root-only credentials file whenever you can.

When the data lives on several shares, run one worker per share rather than a single worker with every share mounted:

  • Isolated diagnosis: an unreachable file server, an expired password or a permission problem shows up on one worker and in its logs only (docker compose logs worker-exports).
  • Independent restarts: remounting a share or restarting its worker does not interrupt the jobs that read the other shares.
  • Scoped credentials: each host mount and each worker token gives access to one share only.
  • Clear ownership: each source is declared on the worker that can read it. Naming the worker after its share (worker-exports) tells you at a glance, in the platform's worker list, which share a source or a job depends on.

Check from the command line​

# The share is mounted on the host
findmnt /mnt/exports

# The worker sees the files, as uid 10001
docker compose exec worker-exports ls -la /data/exports

# Mounts of the container: host path, container path, read-only flag
docker inspect --format '{{json .Mounts}}' $(docker compose ps -q worker-exports)

Troubleshooting​

SymptomCause and fix
Validation failed, or an invalid path, although the path is right on the hostThe path was entered as seen from the host or from a workstation. Enter the container path (/data/...): the local UI lists the mounted volumes under the path field.
Permission deniedThe files are not readable by uid 10001. CIFS: mount with uid=10001,gid=10001,file_mode=0440,dir_mode=0550. NFS: fix the permissions on the server or the export options. Local directory: chown or chmod it.
Permission denied on an SELinux host, although the owner and modes are rightSELinux keeps containers away from network filesystems: run sudo setsebool -P virt_use_samba 1 (CIFS) or sudo setsebool -P virt_use_nfs 1 (NFS). For a local directory, relabel it with the z volume option: -v /srv/data:/data:ro,z.
The folder is empty in the container but not on the hostThe share was mounted on the host after the container started, or the host mount failed. Check with findmnt /mnt/exports, mount at boot with _netdev and the Wants=/After= drop-in on docker.service (never RequiresMountsFor=), then restart the worker. Alternatively, bind-mount the parent directory with rslave propagation (-v /mnt:/data:ro,rslave) so that later host mounts show up in the running container.
Stale file handle (NFS)The export changed or the server restarted: remount it (sudo umount -l /mnt/archive && sudo mount /mnt/archive), then restart the worker.

Kubernetes​

On Kubernetes, the share is a volume of the worker pod: a PersistentVolume backed by NFS, or by the SMB CSI driver for CIFS, bound to a PersistentVolumeClaim and mounted in the worker pod with readOnly: true. The source path is under the mountPath of that volume, for example /data/exports/.... For CIFS, set uid=10001 and gid=10001 in the mount options of the volume. The local UI lists the volumes mounted in the pod the same way as in Docker.