Skip to content
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

Merged
merged 9 commits into from
Oct 11, 2019
Merged

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Oct 8, 2019

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 translate EFSVolumeConfiguration 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:

"EFSVolumeConfiguration": {
    "filesystem": "fs-abcde",
    "rootDirectory": "/mydata",
    "readonly": true
}

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.

@sparrc sparrc force-pushed the efs-volumes branch 2 times, most recently from 096a9ca to 523741d Compare October 9, 2019 22:58
@@ -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 {
Copy link
Contributor Author

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/api/task/task.go Outdated Show resolved Hide resolved
@sparrc sparrc changed the base branch from feature/efs-volume-config to dev October 10, 2019 17:19
@sparrc sparrc changed the base branch from dev to feature/efs-volume-config October 10, 2019 17:19
agent/api/task/task.go Show resolved Hide resolved
agent/acs/model/api/api-2.json Show resolved Hide resolved
type EFSVolumeConfiguration struct {
_ struct{} `type:"structure"`

Filesystem *string `locationName:"filesystem" type:"string"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilesystemID makes more sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

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.

"EFSVolumeConfiguration": {
"type":"structure",
"members":{
"filesystemId":{"shape":"String"},
Copy link
Contributor

@yumex93 yumex93 Oct 11, 2019

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.

Copy link
Contributor Author

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

Copy link
Contributor

@sharanyad sharanyad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sparrc sparrc merged commit 70ef37b into aws:feature/efs-volume-config Oct 11, 2019
@sparrc sparrc deleted the efs-volumes branch October 11, 2019 21:06
sparrc added a commit that referenced this pull request Nov 5, 2019
* 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
sparrc added a commit that referenced this pull request Dec 4, 2019
* 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
sparrc added a commit that referenced this pull request Dec 5, 2019
* 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
sparrc added a commit that referenced this pull request Dec 6, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants