From 4ce69d285cc1167667fb093d6aa7e5475a3a9f5c Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 8 Aug 2024 16:16:35 -0600 Subject: [PATCH 1/3] feat: add python3.9 image --- Dockerfile | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index f605186..b520bef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amazonlinux:2023 AS core_base +FROM public.ecr.aws/lambda/python:3.9 as python3 # This image can be used to do Python 3 & NodeJS development, and # includes the AWS CLI and Terraform. It contains: @@ -9,16 +9,20 @@ FROM amazonlinux:2023 AS core_base # * AWS CLI # * Terraform -ENV NODE_VERSION="20.x" -ENV TERRAFORM_VERSION="1.9.2" -ENV AWS_CLI_VERSION="2.17.13" +# Amazon Linux 2 does not support node 18.x or node 20.x glibc=2.27 and >=2.28 is required +ENV NODE_VERSION "16.x" +ENV TERRAFORM_VERSION "1.9.2" +ENV AWS_CLI_VERSION "2.17.13" -# Install NodeJS -RUN curl -fsSL https://rpm.nodesource.com/setup_${NODE_VERSION} | bash - -RUN dnf install -y nodejs +# Add NodeJS and Yarn repos & update package index +RUN \ + yum install https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \ + yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1 && \ + curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \ + yum update -y # CLI utilities -RUN dnf install -y gcc gcc-c++ git make openssl unzip wget zip jq +RUN yum install -y gcc gcc-c++ git make openssl unzip wget zip jq # AWS & Terraform RUN \ @@ -30,27 +34,27 @@ RUN \ unzip awscliv2.zip && \ ./aws/install +# Node JS +RUN \ + yum install -y nodejs yarn + # SSM SessionManager plugin RUN \ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" &&\ - dnf install -y session-manager-plugin.rpm + yum install -y session-manager-plugin.rpm # Add user for keygen in Makefile ARG USER RUN \ echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd -# Uncommenting breaks: CIRRUS-ASF's CI/CD +RUN python3 -m pip install boto3 setuptools + # Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-core' # Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-DAAC' # COPY .gitconfig /.gitconfig WORKDIR /CIRRUS-core -# Python3 target -FROM core_base AS python3 -# Python 3 -RUN \ - dnf install -y python3-devel && \ - dnf install -y python3-pip && \ - python3 -m pip install boto3 setuptools +# Bypass the bootstrap.sh script that runs in lambda +ENTRYPOINT [] From fb25f2abef73751746cc306ff87302fae3c05cde Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Fri, 9 Aug 2024 10:49:15 -0600 Subject: [PATCH 2/3] chore: add change log entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e5353..e2ebed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe * Update the Makefile so that `make image` can be run without having set any environment variables. +* update core image to build from aws/lambda/python:3.9 as the python3 target ## v18.3.1.0 * Added separate urs_tea_client_id and urs_tea_client_password that can be specified if these are different from the non-tea versions of the variables. @@ -18,7 +19,7 @@ specified log group already exists" error: `make import-thin-egress-log` * Update Dockerfile: * FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) * LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format - * NODE_VERSION="20.x" + * NODE_VERSION="20.x" * TERRAFORM_VERSION="1.9.2" * AWS_CLI_VERSION="2.17.13" * Upgrade to amazonlinux:2023 from amazonlinux:2 From 3113e42ce35a075ee0551f6eddb656798665769e Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Fri, 9 Aug 2024 11:11:16 -0600 Subject: [PATCH 3/3] chore: setup v18.3.1.1 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ebed9..273dfac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased * add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe + +## v18.3.1.1 * Update the Makefile so that `make image` can be run without having set any environment variables. * update core image to build from aws/lambda/python:3.9 as the python3 target