-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EFS functional testing #2247
EFS functional testing #2247
Conversation
t.Skip("TEST_DISABLE_EXECUTION_ROLE was set to true") | ||
} | ||
|
||
if IsCNPartition() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this URL will not work in the CN partition: addr=FILESYSTEM_ID.efs.TEST_REGION.amazonaws.com
, there is currently a TODO in the feature branch (and design doc) to deal with this in EFSVolumeConfiguration (see https://github.com/aws/amazon-ecs-agent/pull/2234/files#diff-a617e6edf02b5af84b984ccb06ce315fR547)
7a40418
to
cf2e1da
Compare
cf2e1da
to
88e5d8c
Compare
if aerr, ok := err.(awserr.Error); ok { | ||
switch aerr.Code() { | ||
case efs.ErrCodeFileSystemAlreadyExists: | ||
t.Logf("EFS filesystem already exists") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect to reuse the same file system created once for the tests? I don't see any cleanup logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we expect to reuse the filesystem, that's why we check for ErrCodeFileSystemAlreadyExists (filesystem already exists) and ErrCodeMountTargetConflict (mount target already exists)
The main reason for this is speed, and the EFS api makes it easy with the CreationToken: https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#API_CreateFileSystem_RequestSyntax
// getSubnetID gets the subnet id for the instance from ec2 instance metadata | ||
func getSubnetID() (string, error) { | ||
// GetSubnetID gets the subnet id for the instance from ec2 instance metadata | ||
func GetSubnetID() (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
LGTM. Don't forget to squash your commits before merging to dev. |
* Add efs client to Gopkg.* * Add efs client to vendor directory * EFS functional test * Reuse EFS filesystem and mount target(s) * review fixups * more code review fixups
* Add efs client to Gopkg.* * Add efs client to vendor directory * EFS functional test * Reuse EFS filesystem and mount target(s) * review fixups * more code review fixups
* Add efs client to Gopkg.* * Add efs client to vendor directory * EFS functional test * Reuse EFS filesystem and mount target(s) * review fixups * more code review fixups
* Added EFSVolumeConfiguration (#2234) * Added EFSVolumeConfiguration models * Translate EFS volumes from ACS to Docker volume type * fix gocyclo failure * code review comments * remove readonly config * remove readonly options from code * code review comments * code review * naming is hard * Add efs capability (#2248) * EFS functional testing (#2247) * Add efs client to Gopkg.* * Add efs client to vendor directory * EFS functional test * Reuse EFS filesystem and mount target(s) * review fixups * more code review fixups * EFSVolumeConfiguration -> efsVolumeConfiguration (#2254) * EFSVolumeConfiguration -> efsVolumeConfiguration * Fix FileSystemId and write json marshalling unit tests * unit test PostUnmarshalTask efsVolumeConfiguration behavior * windows unit test fix * Update ECS client and task defs (#2256) * add memoryUnbounded to task volume marshal unit tests * rebase mistake
Summary
Adds a functional test testing writing/reading from EFS volumes mounted via Docker's NFS integration.
Implementation details
In this test we will setup an EFS volume with mount target. We will then mount this into two tasks: first a task that writes to the EFS volume, then a task that reads from the EFS volume.
Both tasks exit with code
42
if they are successful, so we check for this exit code to verify that the test passed.Currently this is implemented using the existing
dockerVolumeConfiguration
model. When the feature is ready this will be changed to theEFSVolumeConfiguration
model.Description for the changelog
EFS volume configuration functional testing
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.