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

Python 3.9 Support #202

Merged
merged 3 commits into from
Aug 9, 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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## 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

## 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.
Expand All @@ -18,7 +21,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
Expand Down
38 changes: 21 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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 \
Expand All @@ -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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably not needed as IIRC boto3 comes on the amazon images

# 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 []
Loading