I’ve just noticed that even after we’ve moved a device from one app to another, the data associated with the “old” app is still there:
root@2c877ee:/mnt/data/resin-data# ls -ltrh
total 12K
drwx--x--x 11 root root 4.0K Apr 25 08:23 155867
drwx--x--x 11 root root 4.0K May 12 07:29 310575
drwxr-xr-x 2 root root 4.0K May 12 08:16 resin-supervisor
Is there a way to stop this, short of manually deleting the old app? As we’re pulling a lot of containers, we’ve got about 4GB of space used by the old app that’s kind of wasted.
Yes, that’s intentional, as we don’t delete data unless you explicitly ask for that with a purge (e.g. in the dashboard or theough the API). It’s common for moving devices back and forth between apps and this is the “path of least surprise”.
We’re running a docker-in-docker setup, and we’re first sending devices into a staging environment (i.e. Application), and then graduating them to the production application by “moving” them into that app.
Because of the way the data partition is mounted into the application, our docker image cache can not be reused by different applications after moving, so each app causes the full set of docker images to be built or downloaded - which is around 3GB worth of data.
The way purge seems to work, is that it only purges the data for the current app, this is evidenced by the following device, which was purged a couple of hours ago, but still has data from “old” apps stored:
If there was a hook on “move app”, then we could delete our local docker cache before the move happens, which would at least free up the ~3gb image cache. In order to do this with the current purge function, we’d have to purge the data, and then quickly move the App before anything further is downloaded - which doesn’t really seem like a very clean approach.
And how about the option of keeping the information in the /data folder available after moving it to a new application? This would definitely help me. Now I have to manually copy the /data folder, then move the device, then put all the files back in the /data folder.