Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

bitbucket pipeline AWS docker image atlassian/pipelines-awscli - python version outdated

Antonio Santos July 19, 2021

Hi,

I'm having an issue since July 15h using the image atlassian/pipelines-awscli. With the end of support to Python 2.7 this image no longer works for me.

Image:
https://hub.docker.com/r/atlassian/pipelines-awscli

AWS announcement:
https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/

Error:
./awscli-bundle/install -b ~/bin/aws
Unsupported Python version detected: Python 2.7
To continue using this installer you must use Python 3.6 or later.
For more information see the following blog post:
https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/



Is anyone else having the same issue? Any quick workaround?

1 answer

0 votes
Tushar Ughade July 21, 2021

Hi,

I had same issue, I replaced the docker image and it got fixed.
- image: circleci/python:rc-node-browsers-legacy

Antonio Santos July 21, 2021

Hi,

I end up finding another way. Actually, the issue was not on the docker image I mention, this is the image with problems:

atlassian/default-image:2

So I end up adding this to the bitbucket-pipelines.yml

- add-apt-repository ppa:deadsnakes/ppa
- apt update
- apt install -y python3.9 python3.9-dev python3.9-venv
- update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10

 Full step:

name: Deploy to ECS
image: atlassian/default-image:2
deployment: Development
script:
- add-apt-repository ppa:deadsnakes/ppa
- apt update
- apt install -y python3.9 python3.9-dev python3.9-venv
- update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10
- apt-get install -y jq
- curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
- unzip awscli-bundle.zip
- ./awscli-bundle/install -b ~/bin/aws
- export PATH=~/bin:$PATH
- export IMAGE_NAME=${AWS_REGISTRY_URL}/${BITBUCKET_BUILD_NUMBER}
- envsubst < $FILENAME > $FILENAME
- pipe: atlassian/aws-ecs-deploy:1.0.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
CLUSTER_NAME: $AWS_ECS_CLUSTER
SERVICE_NAME: $AWS_ECS_SERVICE
TASK_DEFINITION: $FILENAME
Like Tushar Ughade likes this
Dejun Xiang October 12, 2021

This is a good solution, thank you. Just wonder how did you resolve those <none> images. They are generated every time restart the task, some image could be large, so if people pushed too often, your server could run out of disk spaces.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events