From 6b5f9c4db47b64b3f54e1a9e2e9754a773b9fdbb Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Wed, 9 Sep 2020 04:14:26 +0000 Subject: [PATCH] Include LibYAML in container builds Updates Dockerfiles to build the LibYAML library, which can provide much faster YAML parsing and emitting than the native Python library. https://pyyaml.org/wiki/LibYAML Change-Id: I6ebafa1eb2af8841b86b64fd119dcb581e6c18a7 --- images/airflow/Dockerfile.opensuse_15 | 17 +++++++++++++++++ images/airflow/Dockerfile.ubuntu_bionic | 17 +++++++++++++++++ images/airflow/Dockerfile.ubuntu_xenial | 17 +++++++++++++++++ images/shipyard/Dockerfile.opensuse_15 | 20 ++++++++++++++++++++ images/shipyard/Dockerfile.ubuntu_bionic | 19 +++++++++++++++++++ images/shipyard/Dockerfile.ubuntu_xenial | 19 +++++++++++++++++++ 6 files changed, 109 insertions(+) diff --git a/images/airflow/Dockerfile.opensuse_15 b/images/airflow/Dockerfile.opensuse_15 index e87b67d1..9be4e295 100644 --- a/images/airflow/Dockerfile.opensuse_15 +++ b/images/airflow/Dockerfile.opensuse_15 @@ -52,6 +52,7 @@ ENV AIRFLOW_HOME=${AIRFLOW_HOME} RUN set -ex && \ zypper -q update -y ;\ zypper --non-interactive install --no-recommends \ + automake \ ca-certificates \ curl \ git-core \ @@ -59,6 +60,7 @@ RUN set -ex && \ libffi-devel \ libopenssl-devel \ libpqxx-devel \ + libtool \ gcc-locale \ netcat-openbsd \ netcfg \ @@ -83,6 +85,21 @@ RUN pip3 install -U pip \ # Explicitly need to create usergroup with same name in suse RUN useradd -U -ms /bin/bash -d ${AIRFLOW_HOME} airflow +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Things that change mostly infrequently RUN curl -L -o /usr/local/bin/kubectl \ https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl \ diff --git a/images/airflow/Dockerfile.ubuntu_bionic b/images/airflow/Dockerfile.ubuntu_bionic index 530c1e13..feefb0ce 100644 --- a/images/airflow/Dockerfile.ubuntu_bionic +++ b/images/airflow/Dockerfile.ubuntu_bionic @@ -53,6 +53,7 @@ ENV AIRFLOW_HOME=${AIRFLOW_HOME} RUN set -ex && \ apt-get -qq update && \ apt-get -y install \ + automake \ ca-certificates \ curl \ git \ @@ -60,6 +61,7 @@ RUN set -ex && \ libffi-dev \ libssl-dev \ libpq-dev \ + libtool \ locales \ netcat \ netbase \ @@ -80,6 +82,21 @@ RUN set -ex && \ /usr/share/doc \ /usr/share/doc-base +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Things that change mostly infrequently RUN useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow \ && curl -L -o /usr/local/bin/kubectl \ diff --git a/images/airflow/Dockerfile.ubuntu_xenial b/images/airflow/Dockerfile.ubuntu_xenial index 65fe9b68..a9eace88 100644 --- a/images/airflow/Dockerfile.ubuntu_xenial +++ b/images/airflow/Dockerfile.ubuntu_xenial @@ -53,6 +53,7 @@ ENV AIRFLOW_HOME=${AIRFLOW_HOME} RUN set -ex && \ apt-get -qq update && \ apt-get -y install \ + automake \ ca-certificates \ curl \ git \ @@ -60,6 +61,7 @@ RUN set -ex && \ libffi-dev \ libssl-dev \ libpq-dev \ + libtool \ locales \ netcat \ netbase \ @@ -80,6 +82,21 @@ RUN set -ex && \ /usr/share/doc \ /usr/share/doc-base +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Things that change mostly infrequently RUN useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow \ && curl -L -o /usr/local/bin/kubectl \ diff --git a/images/shipyard/Dockerfile.opensuse_15 b/images/shipyard/Dockerfile.opensuse_15 index b2bfeeb7..4d9e3cae 100644 --- a/images/shipyard/Dockerfile.opensuse_15 +++ b/images/shipyard/Dockerfile.opensuse_15 @@ -38,8 +38,13 @@ RUN set -ex && \ zypper --gpg-auto-import-keys refresh && \ zypper -q update -y && \ zypper --non-interactive install --no-recommends \ + automake \ ca-certificates \ curl \ + gcc-c++ \ + git \ + libtool \ + make \ netcfg \ python3 \ python3-devel \ @@ -52,6 +57,21 @@ RUN set -ex && \ /usr/share/doc \ /usr/share/doc-base +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Create shipyard user RUN useradd -ms /bin/bash shipyard \ && mkdir -p /home/shipyard/shipyard \ diff --git a/images/shipyard/Dockerfile.ubuntu_bionic b/images/shipyard/Dockerfile.ubuntu_bionic index bf5068f6..e6dfd600 100644 --- a/images/shipyard/Dockerfile.ubuntu_bionic +++ b/images/shipyard/Dockerfile.ubuntu_bionic @@ -38,8 +38,12 @@ EXPOSE $PORT RUN set -ex && \ apt-get -qq update && \ apt-get -y install \ + automake \ ca-certificates \ curl \ + git \ + libtool \ + make \ netbase \ python3-dev \ python3-setuptools \ @@ -54,6 +58,21 @@ RUN set -ex && \ /usr/share/doc \ /usr/share/doc-base +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Create shipyard user RUN useradd -ms /bin/bash shipyard \ && mkdir -p /home/shipyard/shipyard \ diff --git a/images/shipyard/Dockerfile.ubuntu_xenial b/images/shipyard/Dockerfile.ubuntu_xenial index 05b1a60e..996f8f18 100644 --- a/images/shipyard/Dockerfile.ubuntu_xenial +++ b/images/shipyard/Dockerfile.ubuntu_xenial @@ -38,8 +38,12 @@ EXPOSE $PORT RUN set -ex && \ apt-get -qq update && \ apt-get -y install \ + automake \ ca-certificates \ curl \ + git \ + libtool \ + make \ netbase \ python3-dev \ python3-setuptools \ @@ -54,6 +58,21 @@ RUN set -ex && \ /usr/share/doc \ /usr/share/doc-base +# Install LibYAML +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + # Create shipyard user RUN useradd -ms /bin/bash shipyard \ && mkdir -p /home/shipyard/shipyard \