Skip to content

Use named docker volume for sources on Mac #3

@theCapypara

Description

@theCapypara

Performance with host path volumes is an issue under Mac (and possible Windows).
To solve this, one performance option Riptide 0.5.0 introduced was dont_sync_unimportant_src and the unimportant_paths field of apps.

This option has the drawback that for those paths all changes are lost when the containers shut down, which means that paths like vendor for PHP or node_modules for NodeJS can't be used this way. They also never get synced with the host. It uses OverlayFS.

The proposal of this issue is, to implement a way to have projects use a named volume for the entrie source except for some defined paths. The mechanism is the one proposed by Mark Shust: https://markshust.com/2018/12/30/docker-mac-filesystem-volume-mount-approach-performance/

Tasks:

  • Remove the dont_sync_unimportant_src performance option (remove implementation, deprecate all fields)
    • Also deprecate App.unimportant_paths
  • Add a new performance option use_named_src_volume
    • If enabled and supports_named_src_volume is true for an app: Enable Performance option for project
    • Else: Disable performance option for project
  • Add new field supports_named_src_volume to apps
  • Add a new field always_mount_from_host to apps.
    • Defaults to empty

If performance option is enabled for a project:

  • The /src project volume itself is a named docker volume and not the usual host path volume.
  • All paths relative from src of a project that are defined under App.always_mount_from_host are mounted directly from the host system
  • Add a new service codesync to the app:
    • Get's /src as host path and named volume
    • Every 60 seconds: Synchronize code between host path and native volume using unison
    • Run with low CPU priority to not disrupt development
  • On first riptide start (before starting containers) and riptide codesync (new command):
    • Start a container with unison and synchronize code between host path and named volume like described for service codesync, but with high priority. Wait for it to finish.

If performance option is disabled:

  • The /src project volume is a host path volume like it is right now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions