Skip to content

Commit

Permalink
Add spark slave and add this to the config map in the template.
Browse files Browse the repository at this point in the history
  • Loading branch information
datitran committed Mar 29, 2018
1 parent 6eb3960 commit 25499a1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
36 changes: 34 additions & 2 deletions jenkins-ephemeral-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ labels:
app: jenkins-ephemeral
template: jenkins-ephemeral-template
objects:
- apiVersion: v1
kind: ImageStream
- kind: ImageStream
apiVersion: v1
metadata:
annotations:
openshift.io/display-name: Jenkins
Expand Down Expand Up @@ -221,6 +221,38 @@ objects:
<imagePullSecrets/>
<nodeProperties/>
</org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
template2: |-
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>spark</name>
<instanceCap>2147483647</instanceCap>
<idleMinutes>0</idleMinutes>
<label>spark</label>
<serviceAccount>jenkins</serviceAccount>
<nodeSelector></nodeSelector>
<volumes/>
<containers>
<org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
<name>jnlp</name>
<image>datitran/jenkins-slave-spark-centos7:2.2.0</image>
<privileged>false</privileged>
<alwaysPullImage>true</alwaysPullImage>
<workingDir>/tmp</workingDir>
<command></command>
<args>${computer.jnlpmac} ${computer.name}</args>
<ttyEnabled>false</ttyEnabled>
<resourceRequestCpu></resourceRequestCpu>
<resourceRequestMemory></resourceRequestMemory>
<resourceLimitCpu></resourceLimitCpu>
<resourceLimitMemory></resourceLimitMemory>
<envVars/>
</org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
</containers>
<envVars/>
<annotations/>
<imagePullSecrets/>
<nodeProperties/>
</org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
parameters:
- name: JENKINS_SERVICE_NAME
displayName: Jenkins Service Name
Expand Down
30 changes: 30 additions & 0 deletions slave-spark/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM openshift/jenkins-slave-base-centos7

LABEL maintainer="dat.tran@idealo.de"

# Install miniconda
USER root
RUN yum install -y bzip2 gcc gcc-c++

RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.3.31-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy

RUN chmod -R 777 /opt/conda

ENV PATH /opt/conda/bin:$PATH

# Install spark
ENV SPARK_HOME /opt/spark
ENV SPARK_URL http://d3kbcqa49mib13.cloudfront.net/spark-2.2.0-bin-hadoop2.7.tgz
ENV SPARK_FILENAME spark-2.2.0-bin-hadoop2.7.tgz
ENV PATH $PATH:$SPARK_HOME/bin

RUN mkdir $SPARK_HOME && \
curl $SPARK_URL > $SPARK_HOME/$SPARK_FILENAME && \
tar -xzf $SPARK_HOME/$SPARK_FILENAME --directory $SPARK_HOME --strip-components 1 && \
rm $SPARK_HOME/$SPARK_FILENAME

USER 1001
5 changes: 5 additions & 0 deletions slave-spark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Spark Slave Image
====================

This repository contains Dockerfiles for a Jenkins Slave Docker image intended for
use with [OpenShift v3](https://github.com/openshift/origin)

0 comments on commit 25499a1

Please sign in to comment.