Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker images: fix raspbian-bullseye, install python3-venv #286

Merged
merged 6 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 4 additions & 86 deletions .github/docker-images/raspbian-bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
FROM raspbian/stretch as raspbian-bullseye

###############################################################################
# Upgrade to bullseye from stretch
###############################################################################

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get full-upgrade -y \
&& apt-get autoremove --purge -y \
&& apt-get clean -y \
# Switch to bullseye repository.
&& sed -i 's/stretch/bullseye/g' /etc/apt/sources.list \
# Update all packages.
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get full-upgrade -y \
&& apt-get autoremove --purge -y \
&& apt-get clean -y

FROM --platform=linux/arm/v7 dtcooper/raspberrypi-os:bullseye

###############################################################################
# Install prereqs
###############################################################################
# Setup nodejs policy for npm
RUN apt-cache policy nodejs
RUN apt-get update -qq \
&& apt-get -y install \
git \
Expand All @@ -36,85 +15,24 @@ RUN apt-get update -qq \
python3.9 \
python3-dev \
python3-pip \
python3-venv \
build-essential \
# For PPAs
software-properties-common \
apt-transport-https \
ca-certificates \
&& apt-get clean


# Override python with python3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Install libs for pythons
RUN sudo apt-get install build-essential checkinstall -y
RUN sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y

###############################################################################
# Python/AWS CLI
###############################################################################
RUN python -m pip install --upgrade setuptools virtualenv \
&& python -m pip install --upgrade awscli \
RUN python3 -m pip install --upgrade setuptools virtualenv \
&& python3 -m pip install --upgrade awscli \
&& ln -s `find /opt -name aws` /usr/local/bin/aws \
&& which aws \
&& aws --version



###############################################################################
# Install Python3.6 for Deployment
###############################################################################
WORKDIR /tmp
RUN wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz \
&& tar zxf Python-3.6.0.tgz \
&& cd Python-3.6.0 \
&& ./configure \
&& make -j 4 \
&& make altinstall \
&& python3.6 -m pip install --no-input wheel \
&& cd ..


###############################################################################
# Install Python3.7 for Deployment
###############################################################################
RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \
&& tar zxf Python-3.7.0.tgz \
&& cd Python-3.7.0 \
&& ./configure \
&& make -j 4 \
&& make altinstall \
&& python3.7 -m pip install --no-input wheel \
&& cd ..

###############################################################################
# Install Python3.8 for Deployment
###############################################################################
RUN wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz \
&& tar zxf Python-3.8.0.tgz \
&& cd Python-3.8.0 \
&& ./configure \
&& make -j 4 \
&& make altinstall \
&& python3.8 -m pip install --no-input wheel \
&& cd ..


###############################################################################
# Install Python3.10 for Deployment
###############################################################################
RUN wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz \
&& tar zxf Python-3.10.0.tgz \
&& cd Python-3.10.0 \
&& ./configure \
&& make -j 4 \
&& make altinstall \
&& python3.10 -m pip install --no-input wheel \
&& cd ..



###############################################################################
# Install entrypoint
###############################################################################
Expand Down
1 change: 1 addition & 0 deletions .github/docker-images/ubuntu-18-x64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN apt-get update -qq \
# Ubuntu18's default python3 is python3.6, which is EOL.
# So install python3.8 (latest version on this distro, circa Oct 2022)
python3.8-dev \
python3.8-venv \
# This installs pip for all python versions on the system
# (there is no "python3.8-pip")
python3-pip \
Expand Down
33 changes: 1 addition & 32 deletions .github/workflows/create-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- rhel8-x64
- opensuse-leap
- fedora-34-x64
- raspbian-bullseye
- alpine-3.16-x64
- alpine-3.16-x86
- alpine-3.16-arm64
Expand Down Expand Up @@ -124,35 +125,3 @@ jobs:
run: |
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG

# The job will directly pull the image from the latest, and push to the new tag.
# This job is only for a temporary fix. The cheated image would not get updated.
passthrough-images:
name: ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
- raspbian-bullseye

steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Get release tag
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Pull latest image and push
run: |
if ! aws --region us-east-1 ecr describe-repositories --repository-names aws-crt-${{ matrix.variant }} > /dev/null 2>&1; then \
exit 1
fi
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker pull ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest
docker tag ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
33 changes: 1 addition & 32 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
- rhel8-x64
- opensuse-leap
- fedora-34-x64
- raspbian-bullseye
- alpine-3.16-x64
- alpine-3.16-x86
- alpine-3.16-arm64
Expand Down Expand Up @@ -129,38 +130,6 @@ jobs:
| aws s3 cp - s3://${{env.AWS_S3_BUCKET}}/releases/$IMAGE_TAG/aws-crt-${{ matrix.variant }}.tar.gz
aws s3 cp s3://${{env.AWS_S3_BUCKET}}/releases/$IMAGE_TAG/aws-crt-${{ matrix.variant }}.tar.gz s3://${{env.AWS_S3_BUCKET}}/LATEST/aws-crt-${{ matrix.variant }}.tar.gz

# The job will directly pull the image from the latest, and push to the new tag.
# This job is only for a temporary fix. The image would not get updated.
passthrough-images:
name: ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
- raspbian-bullseye

steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Get release tag
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Pull latest image and push
run: |
if ! aws --region us-east-1 ecr describe-repositories --repository-names aws-crt-${{ matrix.variant }} > /dev/null 2>&1; then \
exit 1
fi
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker pull ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest
docker tag ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG

upload-ci-script:
name: Upload container ci script
runs-on: ubuntu-latest
Expand Down
Loading