aws-samples / aws-serverless-shopping-cart

Serverless Shopping Cart is a sample implementation of a serverless shopping cart for an e-commerce website.
MIT No Attribution
326 stars 417 forks source link

Fix python3.8 not found issue at build env #14

Closed k-hasan-19 closed 3 years ago

k-hasan-19 commented 3 years ago

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

to-mc commented 3 years ago

Thanks for the PR! This shouldn't be necessary if you follow the steps in the README for creating the Amplify application though. Amplify is configured via an env var to use a custom build image which already includes python3.8 (its a bit hidden, see here). This avoids the extra time it would take to build python3.8 from source for each build.

Let me know the steps you're taking if you're running into issues here, maybe I need to improve the docs.

k-hasan-19 commented 3 years ago

Hey @cakepietoast , thanks for getting back on this. I was trying to deploy it directly from github by forking it using Amplify console and faced this python3.8 not found issue. Needed a quick fix and updated the build spec like that. I think others will try to deploy this app using console by few clicks like me and will face the same issue. Thus sent the quick PR.

to-mc commented 3 years ago

Makes sense, but I'm reluctant to merge this as-is due to the impact on build time for those who are using a custom build image that already includes python3.8. With that said, there are definitely improvements we could make here! Would you be willing to alter this PR to perform the steps only on the condition that python3.8 isn't already installed? Perhaps by supplying the installation steps as a shell script and conditionally calling with something like: which python3.8 || ./install_python_3.8.sh

I'd be happy to merge that, then I can update the README to provide a simplified deploy-with-amplify instruction (hopefully as simple as adding a one click deploy button, with an optional extra step to supply a custom image (e.g. one that already has python3.8 installed).

swaminator commented 3 years ago

@k-hasan-19 Amplify PM here. We are currently updating the build container to use Python 3.8 by default.

to-mc commented 3 years ago

@k-hasan-19 Amplify PM here. We are currently updating the build container to use Python 3.8 by default.

Thanks @swaminator, thats great news. @k-hasan-19 I'll close this and make some improvements to simplify deploying with Amplify. Thanks for the inspiration!

k-hasan-19 commented 3 years ago

Awesome!