Skip to content

Commit 84aeb60

Browse files
hanwen-clusterlukeseawalker
authored andcommitted
Download/install aws-cfn-bootstrap-py3-latest.tar.gz for all OSes besides Amazon Linux
The latest release (version 0.6.0) of [pystache](https://pypi.org/project/pystache/) removed the support for Python2. This package is a dependency of aws-cfn-bootstrap-latest.tar.gz. The latest (version 1.4-34) [aws-cfn-bootstrap-latest.tar.gz](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/releasehistory-aws-cfn-bootstrap.html#releasehistory-aws-cfn-bootstrap-v1) became incompatible with Python2 after the pystache update, and it is recommended in [CloudFormation helper scripts reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html) to use the latest installation package for Python3. Signed-off-by: Hanwen <hanwenli@amazon.com>
1 parent e60e9a7 commit 84aeb60

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,7 @@ phases:
123123
set -v
124124
BUCKET="s3.amazonaws.com"
125125
[[ ${AWS::Region} =~ ^cn- ]] && BUCKET="s3.cn-north-1.amazonaws.com.cn/cn-north-1-aws-parallelcluster"
126-
127-
OS='{{ build.OperatingSystemName.outputs.stdout }}'
128-
129-
if [[ ${!OS} =~ ^(ubuntu2004)$ ]]; then
130-
echo "https://${!BUCKET}/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz"
131-
else
132-
echo "https://${!BUCKET}/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz"
133-
fi
126+
echo "https://${!BUCKET}/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz"
134127
135128
# Get input base AMI Architecture
136129
- name: OperatingSystemArchitecture
@@ -273,21 +266,8 @@ phases:
273266
OS='{{ build.OperatingSystemName.outputs.stdout }}'
274267
275268
if [[ ${!OS} =~ ^(centos7|ubuntu(18|20)04)$ ]]; then
276-
if [[ ${!OS} == centos7 ]]; then
277-
which pip2
278-
if [ $? -eq 0 ]; then
279-
PIP_COMMAND="pip2"
280-
else
281-
PIP_COMMAND="pip"
282-
fi
283-
elif [[ ${!OS} == ubuntu1804 ]]; then
284-
PIP_COMMAND="pip"
285-
elif [[ ${!OS} == ubuntu2004 ]]; then
286-
PIP_COMMAND="pip3"
287-
fi
288-
289269
curl --retry 3 -L -o /tmp/aws-cfn-bootstrap-latest.tar.gz {{ build.CfnBootstrapUrl.outputs.stdout }}
290-
${!PIP_COMMAND} install /tmp/aws-cfn-bootstrap-latest.tar.gz
270+
pip3 install /tmp/aws-cfn-bootstrap-latest.tar.gz
291271
fi
292272
293273
- name: CreateBootstrapFile

0 commit comments

Comments
 (0)