Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in "spot-instance-termination-notice-handler" due to curl version #54

Open
TheRealGoku opened this issue Aug 6, 2021 · 2 comments

Comments

@TheRealGoku
Copy link

https://github.com/awslabs/ec2-spot-labs/blob/master/ecs-ec2-spot-fleet/ecs-ec2-spot-fleet.yaml#L442

[ec2-user@ip-172-31-7-218 ~]$ curl --version
curl 7.61.1 (x86_64-koji-linux-gnu) libcurl/7.61.1 OpenSSL/1.0.2k zlib/1.2.7 libidn2/2.3.0 libssh2/1.4.3 nghttp2/1.41.0
Release-Date: 2018-09-05
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink 
[ec2-user@ip-172-31-7-218 ~]$ [ -z $(curl -Isf http://169.254.169.254/latest/meta-data/spot/termination-time) ];
[ec2-user@ip-172-31-7-218 ~]$ 
[ec2-user@ip-172-31-7-218 ~]$ curl --version
curl 7.76.1 (x86_64-koji-linux-gnu) libcurl/7.76.1 OpenSSL/1.0.2k-fips zlib/1.2.7 libidn2/2.3.0 libssh2/1.4.3 nghttp2/1.41.0
Release-Date: 2021-04-14
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB SPNEGO SSL UnixSockets
[ec2-user@ip-172-31-7-218 ~]$ [ -z $(curl -Isf http://169.254.169.254/latest/meta-data/spot/termination-time) ];
-bash: [: too many arguments

If customer uses spot-instance-termination-notice-handler.sh script in their environment due the change curl version output format, the code will always execute else statement and thereby will keep all the on boarded registered container instances into draining state for lifetime despite whether the instance is on demand or spot

@ruecarlo
Copy link
Contributor

ruecarlo commented Aug 6, 2021

You are completely right @TheRealGoku, this was a while back the way to add the Spot interruption notification handler. Things have changed. A while back ago (about 2 years ago) we added the right handling mechanism into the ECS-Optimized AMI image. Now just by adding the ECS_ENABLE_SPOT_INSTANCE_DRAINING variable and setting it to true as documented here you should be able to get the right design.

We will update and remove this entry. I'll close the issue once that this old example gets removed.

@TheRealGoku
Copy link
Author

Thats true :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants