question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add readonly mode for filesystem cache

See original GitHub issue

Feature request

Add readonly mode for filesystem cache to outcome shared cache missing limitation

What is the expected behavior?

It should be possible to use already existing cache without tackling problems of concurrent write access, handling unused entries and managing uncontrolled grow of cache.

What is motivation or use case for adding/changing the behavior?

This will allow reuse at least common node_modules cached entries when running multiple compilations in parallel.

To clarify situation, where it’s need:

  1. Project is monorepo with several (or more) packages where every one of them is compiled to single js file. Packages are quite big (result file is about 1-2 Mb). node_modules are hoisted to root and can be effectivly cached between all packages.
  2. Build is almost always production and not in watch mode.
  3. We need to somehow reduce compilation time of all packages. Especially in CI.
  4. Separate cache for every package is not efficient in terms of time: in CI it’s not helping and memory: we have server and client builds and cache for them is about 100 Mb for one package
  5. Multiple entries not share they memory cache (at least that what it’s looks like when i try that) and even result to build hang.

So this solution looks pretty light and bring our build with webpack 5 to be at least not slower than with webpack 4, which, in turns, will allow us to move to webpack 5.

How should this be implemented in your opinion?

Flag cache.readonly in config, which is disable cache store in store method of PackFileCacheStrategy

Are you willing to work on this yourself? yes

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
alexander-akaitcommented, Jun 17, 2021

You can implement this using custom plugin

1reaction
Jack-Workscommented, Jul 27, 2021

I’d like to share our use case on this issue. We have a single application that builds multiple times with different flags. This is what I do: build the base version on its own (so it can write cache into the fs), then parallelly build the rest targets (they share the cache). The problem is those parallel builds will try to write the file system cache.

Happy to see this fixed, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache directory on read-only filesystem #10003 - GitHub
Description Hi, We run astropy in a Docker container on an HPC system using the Shifter container-running platform.
Read more >
Creating a Read-Only Filesystem - MityDSP-L138 (ARM9 ...
My first attempt was to change the rootfs to read-only in a startup script, ... Read-only file system chown: /var/volatile/cache: Read-only file system...
Read more >
Read only filesystem populated on demand - nfs - Server Fault
Mount the NFS share. If desired, read only. Either server side for the export, or locally with the rdonly mount option.
Read more >
How to Fix "Read-only file system" error when I run something ...
This worked for me: First, run this command with sudo permission: sudo fsck -n -f. Then reboot the machine.
Read more >
Read-only filesystems in Docker and Kubernetes
You should harden your containerized workloads to minimize the attack surface of your overall application. Paying close attention while ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found