aws/aws-fpga

Notify scripts gives boto3.exception

jahagirdar opened this issue · 6 comments

wait_for_afi.py  --afi afi-<id> --notify --email <me>@<domain>.com
Traceback (most recent call last):
  File "/home/centos/src/project_data/aws-fpga/shared/bin/scripts/wait_for_afi.py", line 20, in <module>
    import boto3
  File "/home/centos/.local/lib/python2.7/site-packages/boto3/__init__.py", line 16, in <module>
    from boto3.compat import _warn_deprecated_python
  File "/home/centos/.local/lib/python2.7/site-packages/boto3/compat.py", line 20, in <module>
    from boto3.exceptions import PythonDeprecationWarning
  File "/home/centos/.local/lib/python2.7/site-packages/boto3/exceptions.py", line 43
    f"The '{service_name}' resource does not an API version of: {bad_api_version}\n"
                                                                                   ^
SyntaxError: invalid syntax

Similar issue was reported at aws-solutions/instance-scheduler-on-aws#305
The solution there was to upgrade to python3.
In aws-fpga scripts python2.7 is hardcoded in shebang.

Dear customer,

Thank you so much for reporting the broken feature to AWS. We are currently looking into this and will update once we have a fix.

Thanks

Dear customer, can you provide the details on which version of developer AMI are you using. Also if you installed boto3 yourself or if the developer AMI itself came with a version of boto3.

boto3 is deprecated with python2 and therefore only some older versions of boto3 work with python2 (which is the default python for aws-fpga developer kit currently). We therefore recommend to use a older version of boto3 on our developer AMI with aws-fpga developer kit which works successfully

You can install an older version of boto3 using
sudo pip install boto3==1.16

which supports python2 and one you have this setup, you should be able to run wait_for_afi successfully.

Please feel free to contact us if you need further help

Thanks

Dear customer

Thank you so much for raising the issue. Also updated the wait_for_afi documentation to guide the customers on boto3 installation as mentioned above. Please feel free to re-open the issue if you need further help with this or still see a blocker issue with using wait_for_afi. Thank you so much for your interest in aws

After downgrading boto3 the script now gives the following error
AWS FPGA: (14:28:13) - Calling notification script to send e-mail to ...@......com
ImportError: No module named site

can you confirm the version of python you are using, with python --version. Thanks

closing this thread due to inactivity. If you still need help with this issue, please comment to re-open the thread. Thanks