Open maxirmx opened 1 month ago
The docker volume functionality is described here:
I am afraid Rails support reuires a 'real' filesystem. 'Real' here means a file system which is accessible by other processes.
For example, Rails tmp folder contains pid
and restart
files that shall be used to send commands/signals to tebako package or log files that would be nice to keep when tebako package terminates.
If we 'embed' OverlayFS in a way we do it with DwarFS it won't be accesiible from other processes.
So even with docker-style volumes they have to link to a filesystem that is mounted by the operating system. It can be OverlayFS, of course.
In this case, it can only be a directory created inside the system $TMPDIR? i.e. it is not a self-contained working directory.
As far as I understand Rails have 'tmp' and 'cache'
Cache may be self-contained and OverlayFS will suit perfectly
Tmp has to be 'real'. It is configurable but there are three Rails methods that ignore configuration and use hardcoded
File.join(Rails.root, "tmp")
instead of config.paths["tmp"]
This issue did not exist in the ruby-packer times.
I see three possible approaches to it:
/__tebako_memfs__/tmp
to system folder. In this case the user can start tebako package app
with additional parameter like app --with-tebako-tmp-folder=$TMPDIR/rails
docker --volume
app --tebako-volume=tmp:$TMPDIR/rails
Methods 1,2 will take a week Method 3 will take a month
There is one argument for approach 3 https://github.com/tamatebako/tebako/issues/154 will require similar functionality to mount a second instance of memfs
I agree with 3.
Rails has hardcoded path to tmp folder as described in https://github.com/rails/rails/issues/39583 If tebako is used this path is within memfs, is readonly and cannot be used for temporarily files
We either patch it tebako-runtime or implement a feature similar to docker volume.