mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* chore(efs): initialize service structure * feat: implement EFS service models for file system and mount target management * feat(efs): implement EFS metadata service emulator This introduces support for the AWS Elastic File System (EFS) service, handling the control plane operations across the 2015-02-01 REST API. - Scaffolded and generated EFS DTO models with Jackson PascalCase mapping Created EfsService with StorageBackend capabilities for File Systems, Mount Targets, Access Points, and Policies Created EfsController for all mapped REST-JSON routes under /2015-02-01 Registered EFS in the global EmulatorConfig and ResolvedServiceCatalog Added comprehensive EfsIntegrationTest verifying end-to-end API lifecycle Created EFS service documentation in docs/services/efs.md * feat(efs): implement EFS metadata service emulator This introduces support for the AWS Elastic File System (EFS) service, handling the control plane operations across the 2015-02-01 REST API. - Scaffolded and generated EFS DTO models with Jackson PascalCase mapping - Created EfsService with StorageBackend capabilities for File Systems, Mount Targets, Access Points, and Policies - Created EfsController for all mapped REST-JSON routes under /2015-02-01 - Registered EFS in the global EmulatorConfig and ResolvedServiceCatalog - Added comprehensive EfsIntegrationTest verifying end-to-end API lifecycle - Created EFS service documentation in docs/services/efs.md * fix(efs): address code review comments - Fixed describe listings to be appropriately region-scoped - Ensured idempotency token caching for AccessPoint and FileSystem creations - Altered creation timestamps to use standard epoch seconds * fix(efs): register models for reflection to satisfy native-image requirements * fix(efs): resolve remaining review comments and add documentation - Prevented file system deletion when mount targets exist - Cleaned up policies and access points upon file system deletion - Validated parent file system exists during Access Point creation - Added proper logging for tolerated exceptions during mount target deletion - Created missing documentation page docs/services/efs.md * fix(efs): prevent deletion races by locking on file system ID Wraps all state-mutating operations on file systems and their dependent resources in synchronized blocks keyed by the file system ID. This guarantees that CreateMountTarget, CreateAccessPoint, and similar operations cannot race with DeleteFileSystem, satisfying the Greptile review for P1 Deletion races dependent creation. * fix(efs): resolve additional concurrency bugs identified by Greptile - Prevents duplicate access point creation when concurrent requests reuse the same ClientToken across different file systems by adding a dedicated token lock. - Prevents resurrection of deleted mount targets by wrapping modifyMountTargetSecurityGroups and deleteMountTarget in target-specific locks. * fix(efs): enforce idempotent parameter matching for access points * fix(efs): enforce parameter matching for idempotent creation requests - Compares all parameters in CreateFileSystem (PerformanceMode, ThroughputMode, Encrypted, KmsKeyId, ProvisionedThroughputInMibps) when CreationToken matches - Compares all parameters in CreateAccessPoint (FileSystemId, PosixUser, RootDirectory) when ClientToken matches - Throws IdempotentParameterMismatch if parameters differ on a retried token, satisfying Greptile bot review * fix(efs): enforce idempotent parameter matching for nested access point fields - Compares PosixUser.SecondaryGids - Compares RootDirectory.CreationInfo (OwnerUid, OwnerGid, Permissions) - Throws IdempotentParameterMismatch if nested parameters differ on a retried token, satisfying Greptile bot review * fix(efs): enforce idempotent parameter matching for default field omission and tags - Treats null PerformanceMode as 'generalPurpose' for equality checks - Treats null ThroughputMode as 'bursting' for equality checks - Treats null Encrypted as false for equality checks - Strictly compares tag lists in both CreateFileSystem and CreateAccessPoint - Throws IdempotentParameterMismatch if these differ on a retried token, satisfying Greptile bot review * fix(efs): override equals and hashCode on Tag model to enable correct idempotency comparison - Resolves issue where identical tag values on retries were evaluated as mismatched due to object identity comparison - Satisfies Greptile bot review for Tag idempotency checks * fix(efs): enforce idempotent parameter matching for AvailabilityZoneName and Backup settings - Persists AvailabilityZoneName (and derived ID) on the FileSystem during creation if supplied - Implicitly creates an ENABLED/DISABLED BackupPolicy during CreateFileSystem to match AWS default behavior - Compares AvailabilityZoneName on retry - Evaluates Backup request flag against stored BackupPolicy status - Satisfies final Greptile bot review for missing idempotency parameters * fix(efs): evaluate creation-time backup configuration rather than current mutable policy during retries - Adds originalBackupParameter to FileSystem model to immutably capture the configuration at creation time - Refactors idempotency check to evaluate this stored value rather than querying the potentially modified live BackupPolicy - Addresses Greptile P1 defect where PutBackupPolicy broke CreateFileSystem retries * fix(efs): resolve backup retry snapshot persistence across emulator restarts - Replaces @JsonIgnore FileSystem property with a dedicated originalBackupStore - Ensures the original backup parameter is properly persisted and reloaded from disk - Maintains AWS API contract fidelity while preventing IdempotentParameterMismatch on restarts * fix(config): resolve EmrServerless and EFS configuration syntax * fix(efs): prevent stale mount targets by deleting them inside the file system lock * fix(efs): correct file-system policy endpoint path to singular /policy * fix(efs): apply query string filters correctly for describe operations * fix: align EFS emulator with AWS specifications - Fix idempotency matching logic for CreateFileSystem and CreateAccessPoint - Implement modern TagResource, UntagResource, and ListTagsForResource APIs - Dynamically resolve regions and ARNs via RegionResolver - Detect mount target subnet conflicts and dynamically resolve AZs - Remove unused obsolete EFS model classes - Ensure UpdateFileSystem returns 202 Accepted status code * docs: generate EFS action table from controller Resolves 'make docs-check' failure by injecting the floci:actions sentinel markers so the automated docs tool can maintain the supported actions list. * fix: align EFS emulator with AWS specifications - Fix idempotency matching logic for CreateFileSystem and CreateAccessPoint - Implement modern TagResource, UntagResource, and ListTagsForResource APIs - Dynamically resolve regions and ARNs via RegionResolver - Detect mount target subnet conflicts and dynamically resolve AZs - Remove unused obsolete EFS model classes - Ensure UpdateFileSystem returns 202 Accepted status code * docs: generate EFS action table from controller Resolves 'make docs-check' failure by injecting the floci:actions sentinel markers so the automated docs tool can maintain the supported actions list. * fix: prevent stale count on mount target deletion failure Removes the generic catch block in deleteMountTarget so that an unexpected exception during the file system update causes the entire operation to fail, leaving the mount target intact instead of silently deleting it and causing an inconsistent parent count. * fix: store original creation requests to prevent false idempotency conflicts When a file system or access point is updated or retagged, its mutable state changes. Retries using the original creation token were incorrectly compared against this mutated state, causing IdempotentParameterMismatch conflicts. This commit introduces dedicated storage backends to retain the original CreateFileSystemRequest and CreateAccessPointRequest, ensuring that idempotent retries correctly compare their parameters against the original request rather than the current mutated state. * fix: store original creation requests to prevent false idempotency conflicts When a file system or access point is updated or retagged, its mutable state changes. Retries using the original creation token were incorrectly compared against this mutated state, causing IdempotentParameterMismatch conflicts. This commit introduces dedicated storage backends to retain the original CreateFileSystemRequest and CreateAccessPointRequest, ensuring that idempotent retries correctly compare their parameters against the original request rather than the current mutated state. * refactor: remove unused idempotent parameter stores in EFS Dropping originalFileSystemRequestStore, originalAccessPointRequestStore, and originalBackupStore, as parameter matching is no longer performed by the EFS emulator. These stores were persistent and written to on every create but never read, unnecessarily keeping state files around. * fix(efs): resolve compliance issues and reviewer feedback - Populate AccessPointDescription.Name from tags during create and describe - Return 404 FileSystemNotFound for unknown IDs or CreationTokens in DescribeFileSystems - Implement Marker/MaxItems pagination for DescribeTags - Refactor AZ-ID generation to match exact AWS shapes (e.g. usw2-az1) - Clear ProvisionedThroughputInMibps on transition to elastic/bursting mode - Reject update requests setting ProvisionedThroughputInMibps on non-provisioned filesystems - Add trailing newline to ThroughputMode.java - Expand integration tests for ThroughputMode transitions --------- Signed-off-by: NAMAN JAIN <naman.049259@tmu.ac.in>
1.7 KiB
1.7 KiB
Elastic File System (EFS)
Protocol: REST JSON
Endpoint: http://localhost:4566/2015-02-01/...
The EFS emulator provides a metadata control plane for file systems, mount targets, access points, and policies across the 2015-02-01 API.
Supported Operations
| Action | Description |
|---|---|
CreateFileSystem |
- |
DescribeFileSystems |
- |
UpdateFileSystem |
- |
DeleteFileSystem |
- |
CreateTags |
- |
DescribeTags |
- |
DeleteTags |
- |
TagResource |
- |
UntagResource |
- |
ListTagsForResource |
- |
CreateMountTarget |
- |
DescribeMountTargets |
- |
DeleteMountTarget |
- |
DescribeMountTargetSecurityGroups |
- |
ModifyMountTargetSecurityGroups |
- |
CreateAccessPoint |
- |
DescribeAccessPoints |
- |
DeleteAccessPoint |
- |
PutFileSystemPolicy |
- |
DescribeFileSystemPolicy |
- |
DeleteFileSystemPolicy |
- |
PutBackupPolicy |
- |
DescribeBackupPolicy |
- |
PutLifecycleConfiguration |
- |
DescribeLifecycleConfiguration |
- |
Limitations
- Metadata Only: Floci provides an EFS API simulation (the control plane) so you can provision file systems for your ECS tasks and Lambda functions. It does not provide an actual NFSv4.1 data plane endpoint. Reading or writing files via standard file-system mounts will fail.
- Lifecycle Evaluation: Lifecycle policies are saved but no background worker evaluates them to move data across storage classes. Transition fields will remain static.
- Backup: Backup policies are recorded, but Floci does not currently interface with the AWS Backup emulator to generate real snapshot resources.