<@ULVA73B9P> I am using ECS + EC2 + EFS (for persi...
# ask-marvin
s
@Marvin I am using ECS + EC2 + EFS (for persistent storage) to run my flows. However, while EFS is mounting to my EC2 instances, I am unable to mount an efs volume to my container. Even if I add it to the workpool configuration AND The deploy code. The task definition generated on ECS never has EFS volumes. test_file_storage.deploy( ... job_variables={ "task_definition": { "volumes": [ { "name": "efs-volume", "efsVolumeConfiguration": { "fileSystemId": "fs-08e58a286cadca546", "rootDirectory": "/", "transitEncryption": "ENABLED", "transitEncryptionPort": 2999 } } ], "containerDefinitions": [ { "mountPoints": [ { "sourceVolume": "efs-volume", "containerPath": "/root/.prefect/", "readOnly": False } ] } ] } }
m
Mounting EFS volumes to ECS containers can be tricky, especially when integrating with Prefect. Here are some insights based on the information gathered: 1. Configuration in Prefect: Make sure that your task definition JSON configuration is correctly set up. It seems you're already adding the EFS volume configuration under
job_variables
. Ensure that this configuration is correctly passed to the ECS task definition. 2. AWS ECS Requirements: When registering your task definition, make sure that all required permissions and configurations are set on AWS. This includes having the correct IAM role permissions for ECS to access EFS. 3. Task Definition Registration: The Prefect documentation suggests that you might need to manually register the task definition using AWS CLI or SDK if automated registration isn't capturing all configurations. You can reference the ECS Worker Guide for more details. 4. Potential Issues: There might be issues related to how Prefect handles the task definition registration, particularly with EFS configurations. You might want to explore recent changes or issues in the Prefect repository related to ECS and EFS. 5. GitHub Insights: A recent pull request suggests improvements in handling
mountPoints
for ECS task definitions. This might indicate ongoing developments or fixes related to your issue. If the above steps don't resolve your issue, consider checking for any updates or patches in the Prefect repository that might address this problem. You can also explore the possibility of manually adjusting the task definition in AWS after Prefect deploys it. If you continue to face issues, providing more detailed logs or error messages could help in diagnosing the problem further.
s
Can you give me a link to the recent github pr? @Marvin
m
Certainly! You can view the recent pull request related to ECS task definitions and mount points on GitHub here. This PR discusses leveraging the
mountPoints
key of the
containerDefinitions
kwarg, which might be relevant to your issue with EFS volumes.