Custom ecs-optimized Amazon Linux 2 for Batch

0
  1. Following https://docs.aws.amazon.com/batch/latest/userguide/create-batch-ami.html, it says to stop the Amazon ECS container agent w/ "sudo stop ecs". That throws an error, i assume you meant "sudo systemctl stop ecs"?

  2. I need the image to do some setup before it starts accepting containers. I understand that User Data is suggested for this (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/example_user_data_scripts.html). However i found creating a custom systemd service and installing/enabling it before creating the custom AMI is a much cleaner solution. I haven't found much documentation on creating custom systemd on ecs-optimized Amazon Linux 2. The created image does correctly run the custom systemd service. Is there any potential problems with this approach instead of using User Data?

parker9
asked 5 years ago290 views
1 Answer
0
  1. The documentation was updated to show how to stop the ECS service sudo stop ecs was for SysV init systems while sudo systemctl stop ecs was for systemd systems.

  2. Custom systemd service continues to work well and is portable, so i stuck with that. It basically sets up some tmpfs/ramfs file systems to avoid EBS charges (traffic, storage and IO charges) during compute and sharing large input files across containers on the same instance.

parker9
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions