From 73332c2bffc9d6bb6bc7266a1d00f5773e99b659 Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Tue, 9 Jul 2024 09:23:32 -0800 Subject: [PATCH 1/6] chore: add new line --- .gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index daa3f9f..720cd03 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,3 +1,3 @@ [safe] directory = /CIRRUS-core - directory = /CIRRUS-DAAC \ No newline at end of file + directory = /CIRRUS-DAAC From aadfc499ac75e8479a24fa66147754ee0de62eab Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Wed, 3 Jul 2024 09:42:31 -0800 Subject: [PATCH 2/6] feat: add python 3.10 --- Dockerfile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e852cc..b46b7ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amazonlinux:2 as core_base +FROM amazonlinux:2023 as core_base # This image can be used to do Python 3 & NodeJS development, and # includes the AWS CLI and Terraform. It contains: @@ -51,8 +51,20 @@ COPY .gitconfig /.gitconfig WORKDIR /CIRRUS-core +# Python310 target +FROM core_base AS python310 +RUN \ + dnf groupinstall "Development Tools" -y && \ + dnf install openssl-devel bzip2-devel libffi-devel -y && \ + cd /usr/src && \ + wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz && \ + tar xzf Python-3.10.14.tgz && cd Python-3.10.14 && ./configure --enable-optimizations && \ + make altinstall && \ + update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1 && \ + python3 -m pip install boto3 + # Python38 target -FROM core_base as python38 +FROM core_base AS python38 RUN \ amazon-linux-extras install python3.8 && \ ln -s /usr/bin/python3.8 /usr/bin/python3 && \ @@ -60,8 +72,9 @@ RUN \ python3 -m pip install boto3 # Python3 target -FROM core_base as python3 +FROM core_base AS python3 # Python 3 RUN \ yum install -y python3-devel && \ + yum install -y python3-pip && \ python3 -m pip install boto3 From a3f6f83885f0f763878d0ed440b8bcdb3cb52a26 Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Tue, 9 Jul 2024 14:13:02 -0800 Subject: [PATCH 3/6] chore: update python3.8 installation --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b46b7ec..d3cc5d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,11 +66,16 @@ RUN \ # Python38 target FROM core_base AS python38 RUN \ - amazon-linux-extras install python3.8 && \ - ln -s /usr/bin/python3.8 /usr/bin/python3 && \ - ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \ + dnf groupinstall "Development Tools" -y && \ + dnf install openssl-devel bzip2-devel libffi-devel -y && \ + cd /usr/src && \ + wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz && \ + tar xzf Python-3.8.16.tgz && cd Python-3.8.16 && ./configure --enable-optimizations && \ + make altinstall && \ + update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 1 && \ python3 -m pip install boto3 + # Python3 target FROM core_base AS python3 # Python 3 From 1b7034581afc1212cc99a0f8508d235501875f31 Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Tue, 9 Jul 2024 16:30:49 -0800 Subject: [PATCH 4/6] refactor: create python version vars --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d3cc5d5..43ce610 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,24 +53,26 @@ WORKDIR /CIRRUS-core # Python310 target FROM core_base AS python310 +ENV PYTHON_3_10_VERSION "3.10.14" RUN \ dnf groupinstall "Development Tools" -y && \ dnf install openssl-devel bzip2-devel libffi-devel -y && \ cd /usr/src && \ - wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz && \ - tar xzf Python-3.10.14.tgz && cd Python-3.10.14 && ./configure --enable-optimizations && \ + wget https://www.python.org/ftp/python/${PYTHON_3_10_VERSION}/Python-${PYTHON_3_10_VERSION}.tgz && \ + tar xzf Python-${PYTHON_3_10_VERSION}.tgz && cd Python-${PYTHON_3_10_VERSION} && ./configure --enable-optimizations && \ make altinstall && \ update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1 && \ python3 -m pip install boto3 # Python38 target FROM core_base AS python38 +ENV PYTHON_3_8_VERSION "3.8.16" RUN \ dnf groupinstall "Development Tools" -y && \ dnf install openssl-devel bzip2-devel libffi-devel -y && \ cd /usr/src && \ - wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz && \ - tar xzf Python-3.8.16.tgz && cd Python-3.8.16 && ./configure --enable-optimizations && \ + wget https://www.python.org/ftp/python/${PYTHON_3_8_VERSION}/Python-${PYTHON_3_8_VERSION}.tgz && \ + tar xzf Python-${PYTHON_3_8_VERSION}.tgz && cd Python-${PYTHON_3_8_VERSION} && ./configure --enable-optimizations && \ make altinstall && \ update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 1 && \ python3 -m pip install boto3 From 56c60eaac7336880328b389c66a0c00b13ec59e1 Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Wed, 10 Jul 2024 14:38:45 -0800 Subject: [PATCH 5/6] feat: update python installation --- Dockerfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43ce610..961e897 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,9 +57,14 @@ ENV PYTHON_3_10_VERSION "3.10.14" RUN \ dnf groupinstall "Development Tools" -y && \ dnf install openssl-devel bzip2-devel libffi-devel -y && \ - cd /usr/src && \ + cd /usr/local && \ wget https://www.python.org/ftp/python/${PYTHON_3_10_VERSION}/Python-${PYTHON_3_10_VERSION}.tgz && \ - tar xzf Python-${PYTHON_3_10_VERSION}.tgz && cd Python-${PYTHON_3_10_VERSION} && ./configure --enable-optimizations && \ + tar xzf Python-${PYTHON_3_10_VERSION}.tgz && cd Python-${PYTHON_3_10_VERSION} && \ + ./configure --enable-optimizations \ + --enable-shared \ + --enable-loadable-sqlite-extensions \ + --prefix /usr/local \ + LDFLAGS=-Wl,-rpath=/usr/local/lib && \ make altinstall && \ update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1 && \ python3 -m pip install boto3 @@ -70,9 +75,14 @@ ENV PYTHON_3_8_VERSION "3.8.16" RUN \ dnf groupinstall "Development Tools" -y && \ dnf install openssl-devel bzip2-devel libffi-devel -y && \ - cd /usr/src && \ + cd /usr/local && \ wget https://www.python.org/ftp/python/${PYTHON_3_8_VERSION}/Python-${PYTHON_3_8_VERSION}.tgz && \ - tar xzf Python-${PYTHON_3_8_VERSION}.tgz && cd Python-${PYTHON_3_8_VERSION} && ./configure --enable-optimizations && \ + tar xzf Python-${PYTHON_3_8_VERSION}.tgz && cd Python-${PYTHON_3_8_VERSION} && \ + ./configure --enable-optimizations \ + --enable-shared \ + --enable-loadable-sqlite-extensions \ + --prefix /usr/local \ + LDFLAGS=-Wl,-rpath=/usr/local/lib && \ make altinstall && \ update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 1 && \ python3 -m pip install boto3 From 4b861c86054df556e5eb214868c8abb818826ad6 Mon Sep 17 00:00:00 2001 From: mckadesorensen Date: Mon, 15 Jul 2024 11:59:26 -0800 Subject: [PATCH 6/6] chore: update change log --- CHANGELOG.md | 2 ++ Dockerfile | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 407961f..52b800f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * add a Makefile target to import tea lambda cloudwatch group if getting an "The specified log group already exists" error: `make import-thin-egress-log` * add .gitconfig file to Docker image to mark /CIRRUS-core and /CIRRUS-DAAC as safe +* Update Amazon linux to 2023 +* Update python to 3.10 ## v18.2.0.0 diff --git a/Dockerfile b/Dockerfile index 961e897..2be7095 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ ARG USER RUN \ echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd -COPY .gitconfig /.gitconfig +#COPY .gitconfig /.gitconfig WORKDIR /CIRRUS-core @@ -56,7 +56,7 @@ FROM core_base AS python310 ENV PYTHON_3_10_VERSION "3.10.14" RUN \ dnf groupinstall "Development Tools" -y && \ - dnf install openssl-devel bzip2-devel libffi-devel -y && \ + dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \ cd /usr/local && \ wget https://www.python.org/ftp/python/${PYTHON_3_10_VERSION}/Python-${PYTHON_3_10_VERSION}.tgz && \ tar xzf Python-${PYTHON_3_10_VERSION}.tgz && cd Python-${PYTHON_3_10_VERSION} && \ @@ -74,7 +74,7 @@ FROM core_base AS python38 ENV PYTHON_3_8_VERSION "3.8.16" RUN \ dnf groupinstall "Development Tools" -y && \ - dnf install openssl-devel bzip2-devel libffi-devel -y && \ + dnf install openssl-devel bzip2-devel libffi-devel sqlite-devel -y && \ cd /usr/local && \ wget https://www.python.org/ftp/python/${PYTHON_3_8_VERSION}/Python-${PYTHON_3_8_VERSION}.tgz && \ tar xzf Python-${PYTHON_3_8_VERSION}.tgz && cd Python-${PYTHON_3_8_VERSION} && \