Open pditommaso opened 4 years ago
An update on this. It turns out that's with the cloud-boothook
. When putting into a shellscript
it works.
The problem is that I need to create the mount before docker start to is as the container storage.
I've tried another approach, inspired by your script, stopping the daemon, creating the mount, starting again docker and launching the ecs agent with systemctl enable --now ecs
and ... surprise! it hangs again!
root 4806 0.0 0.1 144868 31812 ? Ss 21:41 0:00 /usr/bin/python /usr/bin/cloud-init modules --mode=final
root 4850 0.0 0.0 4236 748 ? S 21:41 0:00 \_ tee -a /var/log/cloud-init-output.log
root 4859 0.0 0.0 11544 2416 ? S 21:41 0:00 \_ /bin/sh /var/lib/cloud/instance/scripts/runcmd
root 4860 0.0 0.0 11544 2552 ? S 21:41 0:00 \_ bash /root/tower-forge.sh
root 4861 0.0 0.0 11544 1580 ? S 21:41 0:00 \_ bash /root/tower-forge.sh
root 4862 0.0 0.0 4236 752 ? S 21:41 0:00 | \_ tee /var/log/user-data.log
root 4864 0.0 0.0 46944 2088 ? S 21:41 0:00 | \_ logger -t nf-tower -s
root 5811 0.0 0.0 31492 3360 ? S 21:42 0:00 \_ systemctl enable --now ecs
give up (for now)
This looks like the following error: https://github.com/aws/amazon-ecs-agent/issues/1707
You need to add the --no-block
flag when starting ecs again.
systemctl enable --now --no-block ecs
Nice. This solves the problem, thanks! I'm leaving the issue open because IMO it would be nice to have it working also in the boothook phase to avoid having to mess with docker and ecs agent stop/start. Feel free to proceed with how you think it's better.
I have also run in to this issue. Im not sure what the consequence of starting the ecs agent before the end of my user data will be for my Batch node.
I've noticed the ebs-autoscale service stops the Ec2 instance bootstrap when using the a GPU enabled instance. Note the last line in the instance log
To replicate the problem I've used to following userdata:
(I'm using a boot hook because I need to create the mount before the docker daemon is started)
Then I've launched as
It works fine with
ami-0501b08c7280e37c5