-
Notifications
You must be signed in to change notification settings - Fork 618
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
Added EFSVolumeConfiguration #2234
Conversation
096a9ca
to
523741d
Compare
@@ -285,6 +285,22 @@ func TaskFromACS(acsTask *ecsacs.Task, envelope *ecsacs.PayloadMessage) (*Task, | |||
return task, nil | |||
} | |||
|
|||
func (task *Task) initializeVolumes(cfg *config.Config, dockerClient dockerapi.DockerClient, ctx context.Context) 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.
this had to be factored out to make gocyclo happy
agent/acs/model/ecsacs/api.go
Outdated
type EFSVolumeConfiguration struct { | ||
_ struct{} `type:"structure"` | ||
|
||
Filesystem *string `locationName:"filesystem" type:"string"` |
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.
FilesystemID
makes more sense
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.
👍
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.
I've changed it to FilesystemId
as this is auto-generated code that depends on the ACS model, which will have the d
lowercase.
agent/acs/model/api/api-2.json
Outdated
"EFSVolumeConfiguration": { | ||
"type":"structure", | ||
"members":{ | ||
"filesystemId":{"shape":"String"}, |
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.
In our PRFAQ, this attribute is defined as filesystem, ACS will keep the consistency and use filesystem. Just a reminder that we may want to wait for ACS model get finalized and regenerate the file again.
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.
yep, the exact shape of this is subject to change, we'll keep this code in a feature branch until the ACS model is finalized
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.
* 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
* 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
* 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
* 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
This adds support for a new field in the task definition: EFSVolumeConfiguration
For now we only support a minimal version of EFS support that essentially just translates the EFS volume configuration into an NFS docker volume.
In the future we expect to roll out support for EFS-specific features by utilizing the efs-agent to mount the volumes.
Implementation details
ECS already supports a field
dockerVolumeConfiguration
in the task definition that can be used to mount EFS volumes via NFS (see here). By utilizing this, we can translateEFSVolumeConfiguration
into a dockerVolumeConfiguration for basic support of mounting EFS volumes (although without support for EFS-specific features).The plan is to maintain this "simple mode" mount whenever customers want to mount an EFS volume without utilizing any EFS-specific features. Simple EFS configuration would look something like this:
Testing
New tests cover the changes: yes
Description for the changelog
Added support for EFSVolumeConfiguration in task definition
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.