Lissy93 / dashy

🚀 A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
https://dashy.to
MIT License
16.96k stars 1.3k forks source link

[BUG] The attempt to rmdir the dist folder prevents cache the dist on an NFS share #1666

Closed chevdor closed 1 month ago

chevdor commented 1 month ago

Environment

Self-Hosted (Docker)

System

K8S

Version

3.1.1

Describe the problem

Dashy builds in /app/dist and unlike user-data that is customizable via ENV, /app/dist seems to be hardcoded (please tell me if this is not the case).

I was thrilled to read:

image

and it looks like it is not very close to be true for most scenarii... but not yet for all :)

image

Dashy itself does not need much resources, and since my K8S limits are low, I alos run into a:

image

which should be read as "it is ok, it just takes longer than expected".

Since the build takes a while, to avoid a new build, I considered mounting a volume for /app/dist. This however fails when using a NFS share since, during the build, dashy attempts to rmdir /app/dist and the root of a NFS share cannot be removed.

I understand that wiping the dist folder is easier when an upgrade is required. I hope it triggers only on upgrades btw :)

This NFS issue is not typical to dashy (people often run into it when using NFS shares, k8s and databases for instance). The Solution is known and simple: let the user define the /app/dist location with an ENV. This would allow telling dashy to work in say /app/dist/subdist (subdist is an example, it could be foobar, the key point is that it is a folder under the /app/dist mounting point).

The NFS share is then still mounted as /app/dist but using a sub folder, allows to let the build script to control the subdist folder (and remove it). It is not possible and won't be possible for the build script (or anything else for that matter) to rm/chmod/chown the root of the NFS share, in this example /app/dist.

Using Dashy V-3.1.1. Update Check Complete
✅ Dashy is Up-to-Date
-  Building for production...
 WARN  A new version of sass-loader is available. Please upgrade for best experience.
 ERROR  Error: EBUSY: resource busy or locked, rmdir '/app/dist'
Error: EBUSY: resource busy or locked, rmdir '/app/dist'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.

Additional info

No response

Please tick the boxes

CrazyWolf13 commented 1 month ago

Hi

This has been discussed before: https://github.com/Lissy93/dashy/issues/1570

Dashy's config loading is fully dynamic, however smaller things like adding files (icons), changing default view, auth.... still require a rebuild, and as lissy was a bit busy, we tried without the rebuild on the container reboot, however this lead to quite some issues and we hotfix/reverted this back to the yarn build-and-start command.

I will close this issue as a duplicate.