Closed kichik closed 1 year ago
Switching over to the ECS optimized (as I think it's a bit more minimal than the EKS version) and having the builder instead use https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-custom-ami.html I think makes sense?
Yeah that's the current plan. Just need to test it out first. This is meant for Windows containers, so we need to make sure that image fits. I also want to test using normal image as I believe we are installing Docker ourselves anyway.
I believe we are installing Docker ourselves anyway.
From my reading, the ECS/EKS images should still have docker installed, just a different runtime it sounds like. Moby instead of Mirantis (Docker EE). Worth verifying though, and happy to help!
Would you be able to change that line to use both ECS variant and vanilla variable and then make sure the integration test still works? The image builder installs Docker and the integration test makes sure Docker works. The only question left is which base image we would need. If both work, then we need to figure out if using the ECS optimized image has any benefits.
I originally chose this parent AMI because I thought Windows had to have containers enabled for Docker to work. But I may be thinking of old Docker for Windows requirements. The Docker installer we use may already set everything up.
Would you be able to change that line to use both ECS variant and vanilla variable and then make sure the integration test still works?
I can give it a try!
then we need to figure out if using the ECS optimized image has any benefits.
I think ECS will win just because it's docker + ecs-agent
, while EKS is docker + a bunch of different k8s components and CSI setup.
I originally chose this parent AMI because I thought Windows had to have containers enabled for Docker to work. But I may be thinking of old Docker for Windows requirements. The Docker installer we use may already set everything up.
So, I nerd sniped myself in digging.
Long story short this is the up-to-date image builder component for EKS. For some reason it looks like there isn't one ECS just yet, only the base AMIs.
If you dig into the component, it looks like to setup docker it manually copying over the windows docker binaries (docker, dockerd) then manually registering them as well as installing the containers
windows feature.
So it may be possibly to do this with a normal base image and entirely skip the ECS/EKS amis, but it also might be more work. The EKS image also sets up containerd
but I can't tell if if that's required or an EKS only step.
Edit: It looks like just copying the binaries and enabling containers only gets you windows containers. If that's acceptable, that's an option. ContainerD is required for linux container support and has a much more complicated setup.
Add-DockerRuntime.ps1
Doing it manually will also let us support not installing Docker properly as requested in #215.
I misspoke when I said we support Windows containers. It's actually undefined behavior right now. I think it's Linux containers, but I can't quickly check due to #253. Maybe we want to offer both options as separate components here:
Oh! For some reason I thought docker desktop didn't behave properly on Windows AMIs in AWS. If it does, that's a heck of a lot simpler. All you have to do then (afaik) is just install the containers
and hyper-v
features before running the docker desktop installer. (Might require a reboot)
https://github.com/CloudSnorkel/cdk-github-runners/blob/a18a7d7374bcf319efc8fd6ec78d794170f0b3ed/src/providers/image-builders/ami.ts#L176