awsdocs / aws-elastic-beanstalk-developer-guide

The open source version of the AWS Elastic Beanstalk Developer Guide. You can submit feedback and requests for changes by submitting issues in this repo or by making proposed changes and submitting a pull request.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
Other
199 stars 194 forks source link

sample custom platform for NodePlatform_RHEL.zip is broken #134

Closed harshitjain99 closed 1 year ago

harshitjain99 commented 2 years ago

While trying to use the sample custom platform for NodePlatform_RHEL.zip, getting the below error This custom platform is based on RHEL 7.2 and supports Node.js 4.4.4.

I have used the base ami (RHEL7 based) which cx is using - ami-005b7876121b7244d This is the RHEL 7 community ami available in us-east-1 region

I got the error below in packer builder.

I, [2022-02-21T20:06:35.233086+0000#3165] INFO -- Packer: 1645473995,,ui,message, HVM AMI builder: command = f"pandoc -f markdown-smart --write=rst --output={rst_temp_path} {md_path}" I, [2022-02-21T20:06:35.233115+0000#3165] INFO -- Packer: 1645473995,,ui,message, HVM AMI builder: ^ I, [2022-02-21T20:06:35.233130+0000#3165] INFO -- Packer: 1645473995,,ui,message, HVM AMI builder: SyntaxError: invalid syntax I, [2022-02-21T20:06:35.233150+0000#3165] INFO -- Packer: 1645473995,,ui,message, HVM AMI builder: ---------------------------------------- I, [2022-02-21T20:06:35.233164+0000#3165] INFO -- Packer: 1645473995,,ui,message, HVM AMI builder: ERROR: Command errored out with exit status 1: /bin/python /usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpW79J7S Check the logs for full command output.


In this custom platform, the available helper script version is aws-cfn-bootstrap-1.4-34.24.amzn1.noarch which is trying to install the pystache 0.6.0 which has dropped the support for python2.

In order to resolve the issue we have to create the custom ami with the below dependencies preinstalled but that doesn't look a clean solution and requesting for a review.

 I created an instance using the latest RHEL7 AMI and the below user-data shell script; created an AMI from it and used it for my source_ami in custom_platform.json.

# Create [user-data.sh](http://user-data.sh/)
cat << EOF > [user-data.sh](http://user-data.sh/)
#!/bin/bash -x
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
yum update -y
yum install -y python-setuptools wget
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py  -o [get-pip.py](http://get-pip.py/)
python [get-pip.py](http://get-pip.py/)
pip install pystache==0.4.0
mkdir -p /opt/aws/bin
pip install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz
echo "end of user-data section reached"
EOF
joshbean commented 1 year ago

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the 'awsdocs' org), see the announcement on the AWS News Blog.