Files
floci/docs/configuration/advanced
Alex Banna 45ed00ebc7 feat(ecs): apply EFS access point POSIX ownership to shared local volumes (#1686)
* feat(ecs): apply EFS access point POSIX ownership to shared local volumes

#1569 materialises an ECS task's efsVolumeConfiguration volume as a shared
local Docker named volume (floci-efs-<fileSystemId>). Docker creates a named
volume root:root 0755, so a task whose image runs as a non-root USER — as
containers mounting an EFS access point typically do — cannot create files on
it and fails with EACCES.

Real EFS initialises an access point's root directory per
RootDirectory.CreationInfo {OwnerUid, OwnerGid, Permissions} and applies the
access point's PosixUser to all I/O regardless of the process uid. This change
emulates that mechanism for the shared local volume, driven by generic config:

- New floci.storage.efs.* block (owner-uid, owner-gid, root-permissions,
  setgid, init-image, mount-user, mount-group-add). Every value is empty/false
  by default, so a shared volume behaves exactly as before (a plain named
  volume, no ownership change) unless explicitly configured.
- ContainerLifecycleManager.ensureSharedVolume(...) ensures the volume then, if
  ownership is configured, chowns/chmods the mount root once (run-once guard;
  optional setgid so subdirectories inherit the owner gid) inside a short-lived
  helper container.
- ContainerSpec/ContainerBuilder gain withUser/withGroupAdd; wired into
  createContainerCmd.withUser and HostConfig.withGroupAdd.
- EcsContainerManager initialises the EFS volume root via ensureSharedVolume
  before mounting it.

Unit tests cover the no-op default (no helper container, no image pull), the
one-off chown/chmod/setgid helper with the run-once guard, the builder
round-trip, and the EcsContainerManager wiring.

* fix(ecs): apply configured EFS PosixUser to containers mounting a shared volume

Wire the previously-inert floci.storage.efs.mount-user / mount-group-add config into the
ECS container spec: a container mounting an EFS-backed shared volume now runs under the
configured uid[:gid] and adds the supplementary group, emulating the access point's
PosixUser squashing. Without this a non-root image USER could not write a volume owned by
owner-uid/owner-gid. Also add the floci.storage.efs.* section to application.yml (the
source of truth for effective defaults) and correct the root-permissions Javadoc, which
implied leaving it empty always skips volume init even when owner/setgid are set.

* docs: regenerate action tables
2026-07-08 23:24:48 -05:00
..