From e1a7b85f88a30f9294002ea9d5b37bfaea241f1e Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Mon, 21 Feb 2022 12:50:44 +0000 Subject: [PATCH] Remove entrypoint from our custom Flink docker image --- images/flink/docker/Dockerfile | 13 ------ images/flink/docker/Dockerfile.python | 13 ------ images/flink/docker/entrypoint.sh | 64 --------------------------- 3 files changed, 90 deletions(-) delete mode 100755 images/flink/docker/entrypoint.sh diff --git a/images/flink/docker/Dockerfile b/images/flink/docker/Dockerfile index c12a2f9f..ad099ea5 100644 --- a/images/flink/docker/Dockerfile +++ b/images/flink/docker/Dockerfile @@ -13,14 +13,6 @@ ARG GCS_CONNECTOR_URI=https://storage.googleapis.com/hadoop-lib/gcs/${GCS_CONNEC ARG FLINK_HADOOP_JAR_NAME=flink-shaded-hadoop-2-uber-${FLINK_HADOOP_VERSION}.jar ARG FLINK_HADOOP_JAR_URI=https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/${FLINK_HADOOP_VERSION}/${FLINK_HADOOP_JAR_NAME} -# Install Google Cloud SDK. -RUN apt-get -qq update && \ - apt-get -qqy install apt-transport-https wget && \ - echo "deb https://packages.cloud.google.com/apt cloud-sdk-stretch main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \ - wget -nv https://packages.cloud.google.com/apt/doc/apt-key.gpg -O /etc/apt/trusted.gpg.d/google-cloud-key.gpg && \ - apt-get -qq update && \ - apt-get -qqy install google-cloud-sdk - # Download and configure GCS connector. # When running on GKE, there is no need to enable and include service account # key file, GCS connector can get credential from VM metadata server. @@ -28,8 +20,3 @@ RUN echo "Downloading ${GCS_CONNECTOR_URI}" && \ wget -q -O /opt/flink/lib/${GCS_CONNECTOR_NAME} ${GCS_CONNECTOR_URI} RUN echo "Downloading ${FLINK_HADOOP_JAR_URI}" && \ wget -q -O /opt/flink/lib/${FLINK_HADOOP_JAR_NAME} ${FLINK_HADOOP_JAR_URI} - -# Entry point. -COPY entrypoint.sh / -RUN chmod 775 /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/images/flink/docker/Dockerfile.python b/images/flink/docker/Dockerfile.python index 8968ddcd..80a558ad 100644 --- a/images/flink/docker/Dockerfile.python +++ b/images/flink/docker/Dockerfile.python @@ -15,14 +15,6 @@ ARG GCS_CONNECTOR_URI=https://storage.googleapis.com/hadoop-lib/gcs/${GCS_CONNEC ARG FLINK_HADOOP_JAR_NAME=flink-shaded-hadoop-2-uber-${FLINK_HADOOP_VERSION}.jar ARG FLINK_HADOOP_JAR_URI=https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/${FLINK_HADOOP_VERSION}/${FLINK_HADOOP_JAR_NAME} -# Install Google Cloud SDK. -RUN apt-get -qq update && \ - apt-get -qqy install apt-transport-https wget && \ - echo "deb https://packages.cloud.google.com/apt cloud-sdk-stretch main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \ - wget -nv https://packages.cloud.google.com/apt/doc/apt-key.gpg -O /etc/apt/trusted.gpg.d/google-cloud-key.gpg && \ - apt-get -qq update && \ - apt-get -qqy install google-cloud-sdk - # Download and configure GCS connector. # When running on GKE, there is no need to enable and include service account # key file, GCS connector can get credential from VM metadata server. @@ -45,8 +37,3 @@ RUN apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libffi-d apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ pip3 install apache-flink==${FLINK_VERSION} - -# Entry point. -COPY entrypoint.sh / -RUN chmod 775 /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/images/flink/docker/entrypoint.sh b/images/flink/docker/entrypoint.sh deleted file mode 100755 index 9f37c7a7..00000000 --- a/images/flink/docker/entrypoint.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A wrapper around the Flink base image's entrypoint with additional setups. - -set -x - -echo "Flink entrypoint..." - -FLINK_CONF_FILE="${FLINK_HOME}/conf/flink-conf.yaml" - -download_job_file() -{ - URI=$1 - JOB_PATH=$2 - mkdir -p ${JOB_PATH} - echo "Downloading job file ${URI} to ${JOB_PATH}" - if [[ "${URI}" == gs://* ]]; then - gsutil cp "${URI}" "${JOB_PATH}" - elif [[ "${URI}" == http://* || "${URI}" == https://* ]]; then - wget -nv -P "${JOB_PATH}" "${URI}" - else - echo "Unsupported protocol for ${URI}" - exit 1 - fi -} - -# Add user-provided properties to Flink config. -# FLINK_PROPERTIES is a multi-line string of ": ". -if [[ -n "${FLINK_PROPERTIES}" ]]; then - echo "Appending Flink properties to ${FLINK_CONF_FILE}: ${FLINK_PROPERTIES}" - echo "" >>${FLINK_CONF_FILE} - echo "# Extra properties." >>${FLINK_CONF_FILE} - echo "${FLINK_PROPERTIES}" >>${FLINK_CONF_FILE} -fi - -# Download remote job file. -if [[ -n "${FLINK_JOB_JAR_URI}" ]]; then - download_job_file ${FLINK_JOB_JAR_URI} "${FLINK_HOME}/job/" -fi - -if [[ -n "${FLINK_JOB_PYTHON_URI}" ]]; then - download_job_file ${FLINK_JOB_PYTHON_URI} "${FLINK_HOME}/job/" -fi - -if [[ -n "${FLINK_JOB_PYTHON_FILES_URI}" ]]; then - download_job_file ${FLINK_JOB_PYTHON_FILES_URI} "${FLINK_HOME}/job/" -fi - -# Handover to Flink base image's entrypoint. -exec "/docker-entrypoint.sh" "$@"