-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate NxDaemon and NxCache to support use of shared cache - NX_CACHE_DIRECTORY #10000
Comments
This originated as a discussion - admittedly not attracting a lot of attention :-( |
@vsavkin This was the issue ticket I referred to in our zoom meeting today |
Error complaining about different versions of When cache directory is shared among multiple git worktrees (i.e. in CI environment) what will happen is that there will be many parallel/colliding updates to We have exactly same limitation in our CI setup. This results in high saved hours on Nx Cloud as all cache hits must be downloaded from remote. I have not tried yet, but there is a hypothesis that using emptyDir mount with subPath on containers:
- volumeMounts:
- name: shared-cache
mountPath: /tmp/shared-cache
- name: nxdeps
mountPath: /tmp/shared-cache/nxdeps.json
subPath: nxdeps.json
volumes:
- name: shared-cache
persistentVolumeClaim:
claimName: shared-cache
- name: nxdeps
emptyDir: {} If this approach does not work, one can only hope for proper solution on Nx. That being said, I do like idea of having Update: above mentioned "solution" with |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
Could we not have NX_CACHE_DIRECTORY only hold cache artefacts and
~/node_modules/.cache/nxdeps/
(orNX_DEPS_DIRECTORY
) holdnxdeps.json
and then we could use the same directory asDAEMON_DIR_FOR_CURRENT_WORKSPACE
?Motivation
When using NX_CACHE_DIRECTORY environment variable to share Nx cache directory among multiple git work-trees an error occurs when different work-trees are on different versions of the
nxdeps.json
file format - e.g.This will effectively make it impossible to have one common Nx Cache for all you work
NxCloud is not a solution as we do not want developers write access to the NxCloud
I believe it is wrong that
nxdeps.json
is stored in the cache directory - it should allways be stored in the workspace e.g.~/node_modules/nxdeps/
?I also wondered if the current setup will work with NX_DAEMON as I see that
and again this should be workspace local
Suggested Implementation
Alternate Implementations
The text was updated successfully, but these errors were encountered: