-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download python files from remote location (#181)
- Loading branch information
mskim-raf
authored
Jan 13, 2022
1 parent
e5a0cd7
commit f4024dc
Showing
8 changed files
with
122 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ARG FLINK_VERSION | ||
ARG SCALA_VERSION | ||
FROM flink:${FLINK_VERSION}-scala_${SCALA_VERSION} | ||
ARG FLINK_HADOOP_VERSION | ||
ARG GCS_CONNECTOR_VERSION | ||
ARG FLINK_VERSION | ||
ARG PYTHON_VERSION | ||
|
||
RUN test -n "$FLINK_VERSION" | ||
RUN test -n "$FLINK_HADOOP_VERSION" | ||
RUN test -n "$GCS_CONNECTOR_VERSION" | ||
|
||
ARG GCS_CONNECTOR_NAME=gcs-connector-${GCS_CONNECTOR_VERSION}.jar | ||
ARG GCS_CONNECTOR_URI=https://storage.googleapis.com/hadoop-lib/gcs/${GCS_CONNECTOR_NAME} | ||
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. | ||
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} | ||
|
||
# Install Python and pyflink . | ||
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libffi-dev && \ | ||
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ | ||
tar -xvf Python-${PYTHON_VERSION}.tgz && \ | ||
cd Python-${PYTHON_VERSION} && \ | ||
./configure --without-tests --enable-shared && \ | ||
make -j6 && \ | ||
make install && \ | ||
ldconfig /usr/local/lib && \ | ||
cd .. && rm -f Python-${PYTHON_VERSION}.tgz && rm -rf Python-${PYTHON_VERSION} && \ | ||
ln -s /usr/local/bin/python3 /usr/local/bin/python && \ | ||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Properties included by Makefile and then passed to Dockerfile. | ||
|
||
FLINK_VERSION ?= 1.8.2 | ||
FLINK_VERSION ?= 1.14.2 | ||
SCALA_VERSION ?= 2.11 | ||
FLINK_HADOOP_VERSION ?= 2.8.3-7.0 | ||
GCS_CONNECTOR_VERSION ?= hadoop2-2.0.0 | ||
PYTHON_VERSION ?= |