Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
330 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
# | ||
FROM maven:3.5-jdk-8 as builder | ||
ADD . /workspace/zeppelin | ||
WORKDIR /workspace/zeppelin | ||
# Allow npm and bower to run with root privileges | ||
RUN echo "unsafe-perm=true" > ~/.npmrc && \ | ||
echo '{ "allow_root": true }' > ~/.bowerrc && \ | ||
mvn -B package -DskipTests -Pbuild-distr -Pspark-3.0 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-angular && \ | ||
# Example with doesn't compile all interpreters | ||
# mvn -B package -DskipTests -Pbuild-distr -Pspark-3.0 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-angular -pl '!groovy,!submarine,!livy,!hbase,!pig,!file,!flink,!ignite,!kylin,!lens' && \ | ||
mv /workspace/zeppelin/zeppelin-distribution/target/zeppelin-*/zeppelin-* /opt/zeppelin/ && \ | ||
# Removing stuff saves time, because docker creates a temporary layer | ||
rm -rf ~/.m2 && \ | ||
rm -rf /workspace/zeppelin/* | ||
|
||
FROM ubuntu:18.04 | ||
COPY --from=builder /opt/zeppelin /opt/zeppelin |
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,81 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
|
||
FROM zeppelin-distribution:latest AS zeppelin-distribution | ||
|
||
FROM ubuntu:18.04 | ||
|
||
LABEL maintainer="Apache Software Foundation <dev@zeppelin.apache.org>" | ||
|
||
ARG version="0.9.0-SNAPSHOT" | ||
|
||
ENV VERSION="${version}" \ | ||
Z_HOME="/opt/zeppelin" | ||
|
||
RUN set -ex && \ | ||
apt-get -y update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-8-jre-headless wget && \ | ||
# Cleanup | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-get autoclean && \ | ||
apt-get clean | ||
|
||
COPY --from=zeppelin-distribution /opt/zeppelin/bin ${Z_HOME}/bin | ||
COPY log4j.properties ${Z_HOME}/conf/ | ||
COPY log4j_yarn_cluster.properties ${Z_HOME}/conf/ | ||
# Decide: | ||
## 1) Build a huge image with all interpreters (default) | ||
COPY --from=zeppelin-distribution /opt/zeppelin/interpreter ${Z_HOME}/interpreter | ||
## 2) Build an image with only some interpreters | ||
#### Copy interpreter-shaded JAR, needed for all interpreters | ||
### COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar ${Z_HOME}/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar | ||
#### Copy specific interpreters, replace "${interpreter_name}" with your interpreter. Of course you can repeat the line with defferent interpreter | ||
### COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/${interpreter_name} ${Z_HOME}/interpreter/${interpreter_name} | ||
|
||
|
||
# Decide: Install conda to manage python and R packages | ||
ARG miniconda_version="py37_4.8.2" | ||
ARG miniconda_sha256="957d2f0f0701c3d1335e3b39f235d197837ad69a944fa6f5d8ad2c686b69df3b" | ||
# Install python packages via conda | ||
COPY python_conda_packages.txt /python_conda_packages.txt | ||
# Some python packages are not available via conda, so we are using pip | ||
COPY pip_packages.txt /pip_packages.txt | ||
# Install R packages via condo | ||
COPY r_conda_packages.txt /r_conda_packages.txt | ||
RUN set -ex && \ | ||
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-${miniconda_version}-Linux-x86_64.sh -O miniconda.sh && \ | ||
echo "${miniconda_sha256} miniconda.sh" > anaconda.sha256 && \ | ||
sha256sum --strict -c anaconda.sha256 && \ | ||
bash miniconda.sh -b -p /opt/conda && \ | ||
export PATH=/opt/conda/bin:$PATH && \ | ||
conda config --set always_yes yes --set changeps1 no && \ | ||
conda info -a && \ | ||
conda config --add channels conda-forge && \ | ||
conda install -y --quiet --file /python_conda_packages.txt && \ | ||
pip install -q -r /pip_packages.txt && \ | ||
conda install -y --quiet --file /r_conda_packages.txt && \ | ||
# Cleanup | ||
rm -v miniconda.sh anaconda.sha256 && \ | ||
# Cleanup based on https://github.com/ContinuumIO/docker-images/commit/cac3352bf21a26fa0b97925b578fb24a0fe8c383 | ||
find /opt/conda/ -follow -type f -name '*.a' -delete && \ | ||
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \ | ||
conda clean -ay | ||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
# Allow process to edit /etc/passwd, to create a user entry for zeppelin | ||
RUN chgrp root /etc/passwd && chmod ug+rw /etc/passwd | ||
|
||
USER 1000 | ||
WORKDIR ${Z_HOME} |
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,22 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
# | ||
|
||
log4j.rootLogger = INFO, stdout | ||
|
||
log4j.appender.stdout = org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n |
23 changes: 23 additions & 0 deletions
23
scripts/docker/zeppelin-interpreter/log4j_yarn_cluster.properties
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,23 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
# | ||
|
||
log4j.rootLogger = INFO, stdout | ||
|
||
log4j.appender.stdout = org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n | ||
|
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 @@ | ||
bkzep==0.6.1 |
14 changes: 14 additions & 0 deletions
14
scripts/docker/zeppelin-interpreter/python_conda_packages.txt
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,14 @@ | ||
pycodestyle | ||
numpy | ||
pandas | ||
scipy | ||
grpcio | ||
hvplot | ||
protobuf | ||
pandasql | ||
ipython | ||
matplotlib | ||
ipykernel | ||
jupyter_client | ||
bokeh | ||
apache-beam |
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,6 @@ | ||
r-evaluate | ||
r-base64enc | ||
r-knitr | ||
r-ggplot2 | ||
r-shiny | ||
r-googlevis |
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,100 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
|
||
FROM zeppelin-distribution:latest AS zeppelin-distribution | ||
|
||
FROM alpine:3.11 AS downloader | ||
|
||
ENV TINI_VERSION=v0.19.0 | ||
|
||
RUN set -ex && \ | ||
/sbin/apk add --no-cache wget gnupg | ||
# Install tini | ||
RUN set -ex && \ | ||
/usr/bin/wget -q https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64 -O /sbin/tini && \ | ||
/usr/bin/wget -q https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64.asc -O /tmp/tini.asc && \ | ||
/usr/bin/gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 && \ | ||
/usr/bin/gpg --batch --verify /tmp/tini.asc /sbin/tini && \ | ||
/bin/chmod +x /sbin/tini && \ | ||
/bin/rm -v /tmp/tini.asc | ||
|
||
# Prepare all interpreter settings for Zeppelin server | ||
# This steps are not needed, if you you add only specific interpreters settings to your image | ||
FROM alpine:3.11 AS interpreter-settings | ||
COPY --from=zeppelin-distribution /opt/zeppelin/interpreter /tmp/interpreter | ||
RUN mkdir -p /opt/zeppelin/interpreter && \ | ||
cd /tmp/interpreter && \ | ||
find . -name 'interpreter-setting.json' -exec cp --parents \{\} /opt/zeppelin/interpreter \; | ||
|
||
FROM ubuntu:18.04 | ||
LABEL maintainer="Apache Software Foundation <dev@zeppelin.apache.org>" | ||
|
||
RUN set -ex && \ | ||
apt-get -y update && \ | ||
# Install language and other base packages | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y language-pack-en openjdk-8-jre-headless wget && \ | ||
# Cleanup | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-get autoclean && \ | ||
apt-get clean | ||
|
||
ARG version="0.9.0-SNAPSHOT" | ||
|
||
ENV LANG=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 \ | ||
VERSION="${version}" \ | ||
Z_HOME="/opt/zeppelin" \ | ||
ZEPPELIN_ADDR="0.0.0.0" \ | ||
ZEPPELIN_WAR_TEMPDIR="/tmp/webapps" \ | ||
ZEPPELIN_DEP_LOCALREPO="/tmp/local-repo" | ||
|
||
# Copy Zeppelin related files | ||
COPY --from=zeppelin-distribution /opt/zeppelin/zeppelin-web-${VERSION}.war ${Z_HOME}/ | ||
COPY --from=zeppelin-distribution /opt/zeppelin/zeppelin-web-angular-${VERSION}.war ${Z_HOME}/ | ||
COPY --from=zeppelin-distribution /opt/zeppelin/conf ${Z_HOME}/conf | ||
COPY --from=zeppelin-distribution /opt/zeppelin/bin ${Z_HOME}/bin | ||
COPY --from=zeppelin-distribution /opt/zeppelin/lib ${Z_HOME}/lib | ||
COPY --from=zeppelin-distribution /opt/zeppelin/plugins ${Z_HOME}/plugins | ||
COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar ${Z_HOME}/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar | ||
# copy example notebooks | ||
COPY --from=zeppelin-distribution /opt/zeppelin/notebook ${Z_HOME}/notebook | ||
# copy k8s files | ||
COPY --from=zeppelin-distribution /opt/zeppelin/k8s ${Z_HOME}/k8s | ||
|
||
# Decide | ||
## 1) Copy and activate all interpreters (default) | ||
COPY --from=interpreter-settings /opt/zeppelin/interpreter ${Z_HOME}/interpreter | ||
## 2) Copy and activate only a specific set of interpreter | ||
# COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/spark/interpreter-setting.json ${Z_HOME}/interpreter/spark/interpreter-setting.json | ||
# COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/jdbc/interpreter-setting.json ${Z_HOME}/interpreter/jdbc/interpreter-setting.json | ||
# COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/md/interpreter-setting.json ${Z_HOME}/interpreter/md/interpreter-setting.json | ||
|
||
COPY log4j.properties ${Z_HOME}/conf/ | ||
COPY --from=downloader /sbin/tini /sbin/tini | ||
|
||
RUN mkdir -p "${Z_HOME}/logs" "${Z_HOME}/run" && \ | ||
# Allow process to edit /etc/passwd, to create a user entry for zeppelin | ||
chgrp root /etc/passwd && chmod ug+rw /etc/passwd && \ | ||
# Give access to some specific folders | ||
chmod -R 775 "${Z_HOME}/logs" "${Z_HOME}/run" "${Z_HOME}/notebook" "${Z_HOME}/conf" | ||
|
||
USER 1000 | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT [ "/sbin/tini", "--" ] | ||
WORKDIR ${Z_HOME} | ||
CMD ["bin/zeppelin.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
# | ||
|
||
log4j.rootLogger = INFO, stdout | ||
|
||
log4j.appender.stdout = org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n |