SWAuk / website

Student Windsurfing Association website
www.swa.co.uk
5 stars 3 forks source link

Consider removing the CopyIn/CopyOut scripts in favour of using OverlayFS #220

Closed arontsang closed 3 years ago

arontsang commented 3 years ago

Using OverlayFS to mount the Joomla files in the lower fs and the SWA src files in the upper fs would solve all the issues that the CopyIn/CopyOut scripts are meant to fix.

oshotton commented 3 years ago

This is a good idea now that we are using Linux Containers - previously a lot of development happened on windows machines so wouldn't have been possible. It might still be a good idea to keep the copy scripts around for now in case there are people not on Linux or using Docker.

Would you be up for submitting a PR to implement this and update the docs?

oshotton commented 3 years ago

Although thinking on this some more... The structure of the git repo is the same as the structure that Joomla requires for the zip file when installing a plugin. This is different from the structure of the Joomla install once the plugin is installed.

You might be able to get around this by having a read-only merge of 4 layers:

Other things to consider:

  1. Won't be able to update the Joomla install via the admin panel (probably not an issue as best to pull/rebuild the container than to update in place)
  2. I liked opening the whole Joomla install in my IDE as smart features (e.g. autocomplete) worked better. I think using overlayfs would stop this from being possible (at least the way I laid out above).
  3. Is overlayfs the best tool for the job or would another union file system be more appropriate? Genuine question, I don't know loads about overlayfs or other union file systems out there but before we implement anything new we should make sure we are using the best tool for the job.
arontsang commented 3 years ago

You are right, come to think about it. There is a much better solution to the problem.

Symlinks.

Simply mount the git repo in the joomla docker container. Add a few symlinks from the joomla folders to the git repo. Et voila.

Added bonus of being all in user space rather than in kernel space, which means you can do it without root or privileged mode docker.

Probably best to implement it as a Docker image.

BTW I haven't worked on this code base since I left uni in 08

oshotton commented 3 years ago

Symlinks do seem like a better idea. Although, as both the Joomla install and the git repo are local directories mounted into the container you would have to create the symlink after the container is created and not when building the image (otherwise I think the symlinks would be overwritten by the mount points). Perhaps this could go in the firstSetup.php script.

Are you looking at contributing to the SWA website again or just dropping off some ideas? =)