aws / aws/containers-roadmap

Support docker with minAPIVerion > 1.21

Open
#1,437 4 comments 4 reactions 0 assignees View on GitHub
ECS Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Summary
ECS agent should support minAPIVerson > 1.21

### Description
I am attempting to set up an ECS anywhere cluster with RHEL and podman. I realize ECS anywhere lists docker as the requirement, but since podman claims to be a mostly drop-in replacement for docker and it's what RHEL supports I thought I'd try it.

What I've found is amazon-ecs-agent fails to start due to the version detection logic / default version. This is because podman included with RHEL 8.3 reports the apiVersion as 1.40 and the minAPIVersion as 1.24. From the agent log:

```
level=critical time=2021-06-29T21:29:49Z msg="Error creating Docker client: docker client factory: client not found for docker version: 1.21" module=agent.go
```

I was able to get by the error by changing this
https://github.com/aws/amazon-ecs-agent/blob/v1.53.1/agent/app/agent.go#L769-L774
to accept versions > 1.21 instead of looking for only 1.21 (since the minimum version is 1.24, the 1.21 check failed).

I also had to change this: https://github.com/aws/amazon-ecs-agent/blob/v1.53.1/agent/dockerclient/sdkclientfactory/versionsupport_unix.go#L56 so it would fall within the range of acceptable versions for my setup (>= 1.24 and < 1.40).

I understand hard-coding a higher default version is likely not feasible - perhaps better logic would be
1. if minAPIVersion <= 1.21, the default version = 1.21
2. if minAPIVersion > 1.21, make the default version = minAPIVersion ?

Contributor guide

Open the contributing guide

Research direction

Start with agent/app/agent.go around the v1.53.1 version-detection logic and agent/dockerclient/sdkclientfactory/versionsupport_unix.go. Trace how the Docker client handles a runtime whose minAPIVersion is above 1.21, then verify the agent can start with the reported API range without the 1.21 lookup failure. The issue does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.