volume plugins: add two capability attributes (with and without version)
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Summary
Current ecs agent code only registers a single ECS capability per docker volume plugin (with the exception of a plugin with tag="latest")
https://github.com/aws/amazon-ecs-agent/blob/02ff320cf442df6d92012d5c2c3c5e7570c926c7/agent/app/agent_capability_unix.go#L66
My request is to always register two capabilities for managed docker volume plugins: with and without the tag. This allows ECS task placement constraints to use the plugin or the plugin:tag. This allows for more flexibility without changing the existing functionality.
### Description
I want to create a task that requires a docker managed volume plugin. Lets call it "rexray/ebs". There are multiple versions (aka tags) of that plugin available. I have tested and tag "0.11.4" works on my instance and for my tasks. I therefore `docker plugin install rexray/ebs:0.11.4`. And my task definition has a constraint on `ecs.capability.docker-plugin.rexray/ebs.0.11.4`.
In two months, a new version `0.12.0` of the plugin is available. I tested it and it passes all tests for my instances and my tasks. I want to migrate to it. I update my instance user-data so that when new instances are created, the new plugin `0.12.0` is installed. However, now I can't place tasks on the new instances because the task definition constraint is for the previous `0.11.4` version.
Now I have to update the task definition for the new version `ecs.capability.docker-plugin.rexray/ebs.0.12.0`. However, now the task can not be placed on the existing instances that still have version `0.11.4` due to the updated task constraint.
My only option is to completely destroy and recreate all my instances and tasks that run on them. Yes, tools exist for that, but that is not my preference. And it requires more coordination than needed.
By adding my request for the second capability attribute for managed docker volume plugins, I can now write my task constraint as `ecs.capability.docker-plugin.rexray/ebs exists` and tasks will be placed on both my `0.11.4` and `0.12.0` instances.
Naturally, if a task has a specific version/tag requirement, its task definition can still use the specific `ecs.capability.docker-plugin.rexray/ebs.xxx.yyy.zzz` attribute
### Current Behavior
`docker plugin install rexray/ebs:0.11.4`
results in the single capability attribute
`ecs.capability.docker-plugin.rexray/ebs.0.11.4`
### Requested Behavior
`docker plugin install rexray/ebs:0.11.4`
results in two capability attributes
`ecs.capability.docker-plugin.rexray/ebs.0.11.4`
`ecs.capability.docker-plugin.rexray/ebs`
Contributor guide
Research direction
Start with agent/app/agent_capability_unix.go at the linked registration logic around line 66. Compare the current capability generated for a tagged Docker volume plugin with the requested tagged and untagged attributes. Done means a tagged plugin registers both capabilities while preserving the existing version-specific capability.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100