You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking for a way to specify an image to cache in an instance that is added to a warm pool.
Description
I have noticed that some of the steps mentioned to speed up task instantiation in an ecs service require us to add variables to user_data or pull docker images so they are cached when the container transitions from Warm:Stopped to Running.
I have noticed that my docker pull commands dont seem to cache an image in a warmed ec2 host. I do see that the commands were run. I wonder if it would be possible to include an environment variable that allows us to specify the task image (or images) we would like to cache during ecs-init. Doing this would allow us to speed up tasks that use warm pools.
Expected Behavior
Observed Behavior
Environment Details
Supporting Log Snippets
The text was updated successfully, but these errors were encountered:
Hi @ekawas-vrify, thanks for opening up this github issue.
I have noticed that some of the steps mentioned to speed up task instantiation in an ecs service require us to add variables to user_data
Are you referring to the following public doc? If so, then one of the ideas is to set the ECS_IMAGE_PULL_BEHAVIOR environment variable to be the value of prefer-cached within the userdata. A bit of context for what this will do
If prefer-cached is specified, the image will be pulled remotely if there is no cached image, otherwise the cached image in the instance will be used
In other words, during task setup, agent will try to find whether or not the image is already on the host. If it isn't then it will pull the image and then store it on the host. All future tasks using the same image shouldn't need to pull down the image again as long as the image is still on the host and has not been cleaned up.
I wonder if it would be possible to include an environment variable that allows us to specify the task image (or images) we would like to cache during ecs-init
Regarding specific docker images, I don't think there's an option to do this currently and will most likely be a feature request. By setting ECS_IMAGE_PULL_BEHAVIOR to be prefer-cached, it will mean that all task images will be cached on the host. Also, ecs-Init shouldn't be the one pulling down the task images but ECS Agent as it's the service that's setting up and running the ECS Agent container.
Summary
Looking for a way to specify an image to cache in an instance that is added to a warm pool.
Description
I have noticed that some of the steps mentioned to speed up task instantiation in an ecs service require us to add variables to
user_data
or pull docker images so they are cached when the container transitions fromWarm:Stopped
toRunning
.I have noticed that my docker pull commands dont seem to cache an image in a warmed ec2 host. I do see that the commands were run. I wonder if it would be possible to include an environment variable that allows us to specify the task image (or images) we would like to cache during ecs-init. Doing this would allow us to speed up tasks that use warm pools.
Expected Behavior
Observed Behavior
Environment Details
Supporting Log Snippets
The text was updated successfully, but these errors were encountered: