apache-spark-on-k8s / spark

Apache Spark enhanced with native Kubernetes scheduler back-end: NOTE this repository is being ARCHIVED as all new development for the kubernetes scheduler back-end is now on https://github.com/apache/spark/
https://spark.apache.org/
Apache License 2.0
612 stars 118 forks source link

Issues with openjdk:8-alpine as the base image for JVM #326

Open ash211 opened 7 years ago

ash211 commented 7 years ago

FYI for others, we saw the following issue when running our application with the stock Spark Dockerfiles that are built on openjdk:8-alpine

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fcfc75d9088, pid=1, tid=0x00007fcfa0cb2ab0
#
# JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 3.3.0
# Distribution: Custom build (Thu Feb  9 08:34:09 GMT 2017)
# Problematic frame:
# C  [ld-musl-x86_64.so.1+0x50088]  memcpy+0x24
#
# Core dump written. Default location: /opt/spark/core or core.1
#
# An error report file with more information is saved as:
# /opt/spark/hs_err_pid1.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#

There's some activity online around tracking down issues between the OpenJDK and the version of libc used in the alpine base images -- musl. It seems like musl isn't fully compatible with what the OpenJDK expects

We fixed this by switching the base image of the Spark images to an internally-created image based on alpine plus the glibc package from https://github.com/andyshinn/alpine-pkg-glibc

danielm0hr commented 6 years ago

I'm also having issues with the alpine base image. E.g. I'm building on top of the driver-py image and installing my PySpark application into it. This app has -- amongst others -- pyarrow as a dependency. Pyarrow is not supported on alpine according to https://stackoverflow.com/questions/49059779/installing-pyarrow-in-alpine-docker.

I switched the base image to openjdk:8 (Debian Stretch based) and everything's working fine. Is there some deeper reason in using the alpine base besides it probably being smaller? Or would it be worth it to submit a PR changing it to the Debian one?