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
질문됨 5년 전299회 조회
1개 답변
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
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠