Skip to content

Commit

Permalink
Merge pull request #511 from noqdev/fix/upgrade-base-container
Browse files Browse the repository at this point in the history
Update iambic_base_container to 2.0.0
  • Loading branch information
smoy committed Jul 25, 2023
2 parents fe65c34 + 05bfac9 commit 3f636c7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-base-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build base container
# This builds the base container upon a push event in noqdev/iambic repository
on:
# Testing this is burdensome
# One way to test is to enable event type pull_request; however, our setup
# is restrictive on who can assume the container building role. You can consider
# temporarily opening the role to allow the pull_request or via specific branch to
# do the image building in the aws assume role side.
# pull_request:
workflow_dispatch

jobs:
build_base_container:
if: ${{ github.repository == 'noqdev/iambic' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
name: Build Base Container
permissions:
id-token: write
contents: write
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
# - linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::242345320040:role/iambic_image_builder
aws-region: us-east-1
- name: build container
id: build-container
run: |
docker logout ghcr.io
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/iambic
make build_docker_base_image upload_docker_base_image
docker logout public.ecr.aws/iambic
docker buildx prune --filter=until=96h -f
9 changes: 4 additions & 5 deletions Dockerfile.base_image
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG FUNCTION_DIR="/app"
ARG AWS_LINUX_VERSION="2022"
ARG PYTHON_VERSION="3.10.8"
ARG NPROC=8
ARG AWS_LINUX_VERSION="2023"
ARG PYTHON_VERSION="3.10.12"

ARG ARCH=
FROM ${ARCH}amazonlinux:${AWS_LINUX_VERSION} as python-layer
Expand All @@ -11,14 +10,14 @@ ARG PYTHON_VERSION
# install python
RUN yum update -y \
&& yum groupinstall "Development Tools" -y \
&& yum install libffi-devel bzip2-devel wget openssl openssl-devel sqlite-devel coreutils -y
&& yum install libffi-devel bzip2-devel wget openssl openssl-devel sqlite-devel coreutils -y --allowerasing

# breaking up this line to test building python using all the cores
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar -xf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION}/ \
&& ./configure --enable-optimizations --enable-loadable-sqlite-extensions \
&& make install && ln -s /Python-${PYTHON_VERSION}/python /usr/bin/python \
&& make -j install && ln -s /Python-${PYTHON_VERSION}/python /usr/bin/python \
&& python -m ensurepip --upgrade \
&& python -m pip install --upgrade pip

Expand Down

0 comments on commit 3f636c7

Please sign in to comment.