Skip to content

Commit

Permalink
Docker - Airflow - version updated to 2.10.0 and 2.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianManiek committed Sep 4, 2024
1 parent 39e071b commit c3cbf8b
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ARG AIRFLOW_USER_HOME_DIR=/home/airflow
ARG AIRFLOW_PIP_VERSION="22.3.1"


FROM marketplace.gcr.io/google/c2d-debian11 as ospo
FROM marketplace.gcr.io/google/debian12 as ospo

# Download Licenses and restricted source-code
COPY components.csv /components.csv
COPY source_code.txt /source_code.txt

RUN apt update && apt -y install ca-certificates
RUN apt update && apt -y install ca-certificates curl

RUN curl -o /download-licenses.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-licenses.sh \
&& curl -o /download-ref-repos.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-ref-repos.sh \
Expand All @@ -25,7 +25,7 @@ RUN mkdir -p /usr/src/licenses \
&& /download-ref-repos.sh /source_code.txt /usr/src


FROM marketplace.gcr.io/google/c2d-debian11 as airflow-build-image
FROM marketplace.gcr.io/google/debian12 as airflow-build-image

SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "nounset", "-o", "nolog", "-c"]
ENV DEBIAN_FRONTEND=noninteractive LANGUAGE=C.UTF-8 LANG=C.UTF-8 LC_ALL=C.UTF-8 \
Expand Down Expand Up @@ -59,6 +59,7 @@ ENV DEV_APT_DEPS="\
python3 \
python3-pip \
python3-dev \
python3-venv \
sasl2-bin \
software-properties-common \
sqlite3 \
Expand Down Expand Up @@ -119,6 +120,10 @@ RUN adduser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-passw

USER airflow

RUN python3 -m venv ~/venv

ENV PATH="/home/airflow/venv/bin:$PATH"

COPY --chown=airflow:0 scripts/docker/install_pip_version.sh /scripts/docker/

RUN /scripts/docker/install_pip_version.sh
Expand All @@ -136,7 +141,7 @@ RUN /scripts/docker/install_airflow.sh \
&& find "${AIRFLOW_USER_HOME_DIR}/.local" -executable -print0 | xargs --null chmod g+x \
&& find "${AIRFLOW_USER_HOME_DIR}/.local" -print0 | xargs --null chmod g+rw

FROM marketplace.gcr.io/google/c2d-debian11 as main
FROM marketplace.gcr.io/google/debian12 as main

COPY --from=ospo /usr/src /usr/src

Expand All @@ -162,18 +167,17 @@ ENV RUNTIME_APT_DEPS="\
freetds-bin \
krb5-user \
ldap-utils \
libffi7 \
libldap-2.4-2 \
libffi8 \
libldap-common \
libsasl2-2 \
libsasl2-modules \
libssl1.1 \
libssl3 \
locales \
lsb-release \
netcat \
netcat-traditional \
openssh-client \
pkg-config \
postgresql-client \
python2 \
python3 \
python3-pip \
rsync \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install_mysql_client() {
gpgconf --kill all
rm -rf "${GNUPGHOME}"
unset GNUPGHOME
echo "deb http://repo.mysql.com/apt/debian/ buster mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
echo "deb http://repo.mysql.com/apt/debian/ bookworm mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install --no-install-recommends -y "${packages[@]}"
apt-get autoremove -yqq --purge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function install_pip_version() {
echo
echo "Installing pip version ${AIRFLOW_PIP_VERSION}"
echo
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
mkdir -p ${HOME}/.local/bin
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
mkdir -p ${HOME}/.local/bin
}

install_pip_version
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ARG AIRFLOW_USER_HOME_DIR=/home/airflow
ARG AIRFLOW_PIP_VERSION="22.3.1"


FROM marketplace.gcr.io/google/c2d-debian11 as ospo
FROM marketplace.gcr.io/google/debian12 as ospo

# Download Licenses and restricted source-code
COPY components.csv /components.csv
COPY source_code.txt /source_code.txt

RUN apt update && apt -y install ca-certificates
RUN apt update && apt -y install ca-certificates curl

RUN curl -o /download-licenses.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-licenses.sh \
&& curl -o /download-ref-repos.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-ref-repos.sh \
Expand All @@ -25,7 +25,7 @@ RUN mkdir -p /usr/src/licenses \
&& /download-ref-repos.sh /source_code.txt /usr/src


FROM marketplace.gcr.io/google/c2d-debian11 as airflow-build-image
FROM marketplace.gcr.io/google/debian12 as airflow-build-image

SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "nounset", "-o", "nolog", "-c"]
ENV DEBIAN_FRONTEND=noninteractive LANGUAGE=C.UTF-8 LANG=C.UTF-8 LC_ALL=C.UTF-8 \
Expand Down Expand Up @@ -59,6 +59,7 @@ ENV DEV_APT_DEPS="\
python3 \
python3-pip \
python3-dev \
python3-venv \
sasl2-bin \
software-properties-common \
sqlite3 \
Expand Down Expand Up @@ -119,6 +120,10 @@ RUN adduser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-passw

USER airflow

RUN python3 -m venv ~/venv

ENV PATH="/home/airflow/venv/bin:$PATH"

COPY --chown=airflow:0 scripts/docker/install_pip_version.sh /scripts/docker/

RUN /scripts/docker/install_pip_version.sh
Expand All @@ -136,7 +141,7 @@ RUN /scripts/docker/install_airflow.sh \
&& find "${AIRFLOW_USER_HOME_DIR}/.local" -executable -print0 | xargs --null chmod g+x \
&& find "${AIRFLOW_USER_HOME_DIR}/.local" -print0 | xargs --null chmod g+rw

FROM marketplace.gcr.io/google/c2d-debian11 as main
FROM marketplace.gcr.io/google/debian12 as main

COPY --from=ospo /usr/src /usr/src

Expand All @@ -162,18 +167,17 @@ ENV RUNTIME_APT_DEPS="\
freetds-bin \
krb5-user \
ldap-utils \
libffi7 \
libldap-2.4-2 \
libffi8 \
libldap-common \
libsasl2-2 \
libsasl2-modules \
libssl1.1 \
libssl3 \
locales \
lsb-release \
netcat \
netcat-traditional \
openssh-client \
pkg-config \
postgresql-client \
python2 \
python3 \
python3-pip \
rsync \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install_mysql_client() {
gpgconf --kill all
rm -rf "${GNUPGHOME}"
unset GNUPGHOME
echo "deb http://repo.mysql.com/apt/debian/ buster mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
echo "deb http://repo.mysql.com/apt/debian/ bookworm mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install --no-install-recommends -y "${packages[@]}"
apt-get autoremove -yqq --purge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function install_pip_version() {
echo
echo "Installing pip version ${AIRFLOW_PIP_VERSION}"
echo
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
mkdir -p ${HOME}/.local/bin
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
mkdir -p ${HOME}/.local/bin
}

install_pip_version
16 changes: 10 additions & 6 deletions docker/airflow/templates/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM {{ .From }} as ospo
COPY components.csv /components.csv
COPY source_code.txt /source_code.txt

RUN apt update && apt -y install ca-certificates
RUN apt update && apt -y install ca-certificates curl

RUN curl -o /download-licenses.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-licenses.sh \
&& curl -o /download-ref-repos.sh -L https://raw.githubusercontent.com/GoogleCloudPlatform/click-to-deploy/master/scripts/download-ref-repos.sh \
Expand Down Expand Up @@ -63,6 +63,7 @@ ENV DEV_APT_DEPS="\
python3 \
python3-pip \
python3-dev \
python3-venv \
sasl2-bin \
software-properties-common \
sqlite3 \
Expand Down Expand Up @@ -123,6 +124,10 @@ RUN adduser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-passw

USER airflow

RUN python3 -m venv ~/venv

ENV PATH="/home/airflow/venv/bin:$PATH"

COPY --chown=airflow:0 scripts/docker/install_pip_version.sh /scripts/docker/

RUN /scripts/docker/install_pip_version.sh
Expand Down Expand Up @@ -166,18 +171,17 @@ ENV RUNTIME_APT_DEPS="\
freetds-bin \
krb5-user \
ldap-utils \
libffi7 \
libldap-2.4-2 \
libffi8 \
libldap-common \
libsasl2-2 \
libsasl2-modules \
libssl1.1 \
libssl3 \
locales \
lsb-release \
netcat \
netcat-traditional \
openssh-client \
pkg-config \
postgresql-client \
python2 \
python3 \
python3-pip \
rsync \
Expand Down
2 changes: 1 addition & 1 deletion docker/airflow/templates/scripts/docker/install_mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install_mysql_client() {
gpgconf --kill all
rm -rf "${GNUPGHOME}"
unset GNUPGHOME
echo "deb http://repo.mysql.com/apt/debian/ buster mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
echo "deb http://repo.mysql.com/apt/debian/ bookworm mysql-${MYSQL_VERSION}" | tee -a /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install --no-install-recommends -y "${packages[@]}"
apt-get autoremove -yqq --purge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function install_pip_version() {
echo
echo "Installing pip version ${AIRFLOW_PIP_VERSION}"
echo
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
mkdir -p ${HOME}/.local/bin
pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
mkdir -p ${HOME}/.local/bin
}

install_pip_version
18 changes: 9 additions & 9 deletions docker/airflow/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
cloudbuild:
enable_parallel: false
versions:
- dir: 2/debian11/2.10
from: marketplace.gcr.io/google/c2d-debian11
- dir: 2/debian12/2.10
from: marketplace.gcr.io/google/debian12
packages:
airflow:
version: 2.10.0
Expand All @@ -28,15 +28,15 @@ versions:
version: '1.17'
repo: airflow2
tags:
- 2.10.0-debian11
- 2.10-debian11
- 2-debian11
- 2.10.0-debian12
- 2.10-debian12
- 2-debian12
- 2.10.0
- '2.10'
- '2'
- latest
- dir: 2/debian11/2.9
from: marketplace.gcr.io/google/c2d-debian11
- dir: 2/debian12/2.9
from: marketplace.gcr.io/google/debian12
packages:
airflow:
version: 2.9.3
Expand All @@ -47,7 +47,7 @@ versions:
version: 22.3.1
repo: airflow2
tags:
- 2.9.3-debian11
- 2.9-debian11
- 2.9.3-debian12
- 2.9-debian12
- 2.9.3
- '2.9'

0 comments on commit c3cbf8b

Please sign in to comment.