This is an automated email from the ASF dual-hosted git repository.
dacort pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-livy.git
The following commit(s) were added to refs/heads/master by this push:
new e5599757 Add a Dockerfile for the build (#367)
e5599757 is described below
commit e5599757798c3ef59076ad4b2d56e722f39488ed
Author: Damon P. Cortesi <[email protected]>
AuthorDate: Sat Dec 10 10:26:44 2022 -0800
Add a Dockerfile for the build (#367)
* Add a Dockerfile for the build
* Add UTF-8 locale so python2 unicode test passes and add volume mapping
for .m2 directory
* Squish python3 deps per comments and reformat
---
.rat-excludes | 2 +-
README.md | 11 ++++++++
dev/docker/Dockerfile | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/.rat-excludes b/.rat-excludes
index 1df6e9eb..cf49653f 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -28,4 +28,4 @@ logs/*
**/jquery-2.1.1.min.js
docs/**/*.html
docs/**/JB/**
-venv/*
+venv/*
\ No newline at end of file
diff --git a/README.md b/README.md
index d454cbc1..9dfec123 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,17 @@ cd incubator-livy
mvn package
```
+You can also use the provided [Dockerfile](./Dockerfile):
+
+```
+git clone https://github.com/apache/incubator-livy.git
+cd incubator-livy/dev/docker
+docker build -t livy .
+docker run --rm -it -v $(pwd)/../../:/workspace -v $HOME/.m2:/root/.m2 livy
mvn package
+```
+
+> **Note**: The `docker run` command maps the maven repository to your host
machine's maven cache so subsequent runs will not need to download dependencies.
+
By default Livy is built against Apache Spark 2.4.5, but the version of Spark
used when running
Livy does not need to match the version used to build Livy. Livy internally
handles the differences
between different Spark versions.
diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile
new file mode 100644
index 00000000..3f8fd844
--- /dev/null
+++ b/dev/docker/Dockerfile
@@ -0,0 +1,73 @@
+#
+# 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 ubuntu:xenial
+
+# configure locale
+RUN apt-get update -qq > /dev/null && apt-get install -qq --yes
--no-install-recommends \
+ locales && \
+ locale-gen en_US.UTF-8
+ENV LANG="en_US.UTF-8" \
+ LANGUAGE="en_US.UTF-8" \
+ LC_ALL="en_US.UTF-8"
+
+# Install necessary dependencies for build/test
+RUN apt-get install -qq \
+ apt-transport-https \
+ curl \
+ git \
+ libkrb5-dev \
+ maven \
+ openjdk-8-jdk \
+ python-dev \
+ python-pip \
+ python3-pip \
+ software-properties-common \
+ vim \
+ wget
+
+# R 3.x install - ensure to add the signing key per
https://cran.r-project.org/bin/linux/ubuntu/olderreleasesREADME.html
+RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu
xenial-cran35/' && \
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
+ apt-get update && \
+ apt-get -qq install r-base
+
+# Add build dependencies for python2
+# - First we upgrade pip because that makes a lot of things better
+# - Then we remove the provided version of setuptools and install a different
version
+# - Then we install additional dependencies
+RUN python -m pip install -U "pip < 21.0" && \
+ apt-get remove -y python-setuptools && \
+ python -m pip install "setuptools < 36" && \
+ python -m pip install \
+ cloudpickle \
+ codecov \
+ flake8 \
+ flaky \
+ "future>=0.15.2" \
+ "futures>=3.0.5" \
+ pytest \
+ pytest-runner \
+ requests-kerberos \
+ "requests >= 2.10.0" \
+ "responses >= 0.5.1"
+
+# Now do the same for python3
+RUN python3 -m pip install -U pip
+
+WORKDIR /workspace
+#
https://archive.apache.org/dist/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz
\ No newline at end of file