dappnode / DNP_DAPPMANAGER

Dappnode package responsible for providing the Dappnode Package Manager
GNU General Public License v3.0
31 stars 40 forks source link

Docker doesn't recognize docker volumes not on main filesystem #920

Open alexpeterson91 opened 3 years ago

alexpeterson91 commented 3 years ago

Describe the bug Currently the admin UI does not recognize any docker volumes installed on external disks.

To Reproduce Add additional physical drive and mount permanently. Install new package (i.e. BItcoin) checking advanced options, show advanced editor and select your permanently mounted external drive as the docker volume path instead of default path. Sync package, as it is synced it will show no volumes for the package or in the system tab of the admin UI.

Expected behavior Would be great to actually see the size of docker volumes regardless of where they are installed such as an external drive.

The bitcoin package is installed and has its volume permanently mounted at /mnt/ssd1/bitcoin and even though it's fully synced it lists its volume as 0B. It would be great if it at least could list the size of the volume even though its not on the primary filesystem. Screenshots

Screen Shot 2021-11-12 at 3 55 04 PM Screen Shot 2021-11-12 at 3 54 35 PM

DAppNode version:

Core DAppNode Packages versions bind.dnp.dappnode.eth: 0.2.6 dappmanager.dnp.dappnode.eth: 0.2.43, commit: 4044dae4 https.dnp.dappnode.eth: 0.1.1 ipfs.dnp.dappnode.eth: 0.2.15 vpn.dnp.dappnode.eth: wifi.dnp.dappnode.eth: 0.2.8 wireguard.dnp.dappnode.eth: 0.1.1 System info dockerComposeVersion: 1.25.5 dockerServerVersion: 20.10.6 dockerCliVersion: 20.10.6 os: debian versionCodename: bullseye architecture: amd64 kernel: 5.10.0-8-amd64 Disk usage: 36% Additional context

dapplion commented 3 years ago

Getting the size of volumes outside of docker is not easy as far as I'm concerned since we need to manually compute the size with du. Can you take a look @3alpha ?

3alpha commented 3 years ago

Yes, non-standard mountpoints are handled with bind mounts and docker doesn't track their size. As you say, only way to use is du, but since blockchain databases are made of tons of small files it takes some time and it is not feasible to calculate it continuously. We would need to come up with custom solution for that.

alexpeterson91 commented 3 years ago

Ok @pablomendezroyo suggested I add this issue. He also said you guys are working on a project to expand the file system without using LVM perhaps that'll resolve the issue once implemented?

3alpha commented 3 years ago

Well, we are and it won't. 😅

But can we add a little button on the frontend that would run du command and print its output only when it is clicked? @pablomendezroyo

pablomendezroyo commented 3 years ago

So docker containers with these "non-standard volumes" should have tags (to be added during installation):

How can we parse du command or set the necessary flags to get the output needed for a specific container? @3alpha

3alpha commented 3 years ago

They are easily recognised because they begin always (in dappnode's case) with /, as they are path. Flag we need to use is -s because du output then is just one final line.

pablomendezroyo commented 2 years ago

@3alpha Do you know the current status of this?

3alpha commented 2 years ago

It is not implemented and it is more complicated than it looks, du command can last for a long time especially on big volumes like ones which hold chaindata. Thats why we would need to implement some kind of caching which calculates volume sizes either periodically or on each request checks when size was last calculated and if it is long ago it refreshes it.

Maybe this periodical stuff would be easier because we can write daemon which goes through volumes completely decoupled from frontend.

alexpeterson91 commented 2 years ago

im confused about this one, it doesnt work on a few of my machines, but it does for external USB RAID array filesystems that have been permanently mounted on at least one local node. And it does in a different way of displaying it but it's very helpful still