diff --git a/.github/workflows/image_build_push.yaml b/.github/workflows/image_build_push.yaml index f651cec..6daff7d 100644 --- a/.github/workflows/image_build_push.yaml +++ b/.github/workflows/image_build_push.yaml @@ -10,6 +10,7 @@ jobs: OVERRIDE_REPO_NAME: hadoop-base OVERRIDE_TAG_NAME: 3.3.0 DOCKERFILE_LOCATION: "./hadoop/base/Dockerfile" + DOCKERFILE_BUILD_CONTEXT: "./hadoop/base" USE_QUAY_ONLY: true secrets: ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} @@ -49,7 +50,7 @@ jobs: uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master needs: [build-hadoop-base] with: - OVERRIDE_REPO_NAME: namenode + OVERRIDE_REPO_NAME: datanode OVERRIDE_TAG_NAME: 3.3.0 DOCKERFILE_LOCATION: "./hadoop/datanode/Dockerfile" DOCKERFILE_BUILD_CONTEXT: "./hadoop/datanode" diff --git a/hadoop/base/Dockerfile b/hadoop/base/Dockerfile index adcea1c..19fbd3d 100644 --- a/hadoop/base/Dockerfile +++ b/hadoop/base/Dockerfile @@ -50,12 +50,8 @@ RUN apt-get --only-upgrade install libpq-dev ENV PATH="${PATH}:${SPARK_HOME}/bin:${SPARK_HOME}/sbin:${HADOOP_HOME}/sbin:${HADOOP_HOME}/bin:${JAVA_HOME}/bin:${SCALA_HOME}/bin" -COPY . /gen3spark -WORKDIR /gen3spark +ADD entrypoint.sh /entrypoint.sh -# ENV TINI_VERSION v0.18.0 -# ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini -# RUN chmod +x /tini -# ENTRYPOINT ["/tini", "--"] +RUN chmod a+x /entrypoint.sh -CMD ["/usr/sbin/sshd", "-D"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/hadoop/datanode/Dockerfile b/hadoop/datanode/Dockerfile index cc4db8e..ab51333 100644 --- a/hadoop/datanode/Dockerfile +++ b/hadoop/datanode/Dockerfile @@ -8,8 +8,7 @@ VOLUME /hadoop/dfs/data ADD run.sh /run.sh RUN chmod a+x /run.sh -WORKDIR /gen3spark EXPOSE 9864 -CMD ["/gen3spark/run.sh"] +CMD ["/run.sh"] diff --git a/hadoop/historyserver/Dockerfile b/hadoop/historyserver/Dockerfile index 49d65e3..e5d75f5 100644 --- a/hadoop/historyserver/Dockerfile +++ b/hadoop/historyserver/Dockerfile @@ -6,10 +6,9 @@ ENV HDFS_CONF_dfs_namenode_name_dir=file:///hadoop/dfs/name RUN mkdir -p /hadoop/dfs/name VOLUME /hadoop/dfs/name -ADD run.sh /gen3spark/run.sh -RUN chmod a+x /gen3spark/run.sh -WORKDIR /gen3spark +ADD run.sh /run.sh +RUN chmod a+x /run.sh EXPOSE 9870 -CMD ["/gen3spark/run.sh"] \ No newline at end of file +CMD ["/run.sh"] \ No newline at end of file diff --git a/hadoop/namenode/Dockerfile b/hadoop/namenode/Dockerfile index 49d65e3..e5d75f5 100644 --- a/hadoop/namenode/Dockerfile +++ b/hadoop/namenode/Dockerfile @@ -6,10 +6,9 @@ ENV HDFS_CONF_dfs_namenode_name_dir=file:///hadoop/dfs/name RUN mkdir -p /hadoop/dfs/name VOLUME /hadoop/dfs/name -ADD run.sh /gen3spark/run.sh -RUN chmod a+x /gen3spark/run.sh -WORKDIR /gen3spark +ADD run.sh /run.sh +RUN chmod a+x /run.sh EXPOSE 9870 -CMD ["/gen3spark/run.sh"] \ No newline at end of file +CMD ["/run.sh"] \ No newline at end of file diff --git a/hadoop/nodemanager/Dockerfile b/hadoop/nodemanager/Dockerfile index cc4db8e..ab51333 100644 --- a/hadoop/nodemanager/Dockerfile +++ b/hadoop/nodemanager/Dockerfile @@ -8,8 +8,7 @@ VOLUME /hadoop/dfs/data ADD run.sh /run.sh RUN chmod a+x /run.sh -WORKDIR /gen3spark EXPOSE 9864 -CMD ["/gen3spark/run.sh"] +CMD ["/run.sh"] diff --git a/hadoop/resourcemanager/Dockerfile b/hadoop/resourcemanager/Dockerfile index cc4db8e..ab51333 100644 --- a/hadoop/resourcemanager/Dockerfile +++ b/hadoop/resourcemanager/Dockerfile @@ -8,8 +8,7 @@ VOLUME /hadoop/dfs/data ADD run.sh /run.sh RUN chmod a+x /run.sh -WORKDIR /gen3spark EXPOSE 9864 -CMD ["/gen3spark/run.sh"] +CMD ["/run.sh"] diff --git a/spark/base/Dockerfile b/spark/base/Dockerfile index 86d3710..6483e17 100644 --- a/spark/base/Dockerfile +++ b/spark/base/Dockerfile @@ -46,13 +46,4 @@ ENV PATH="${PATH}:${SPARK_HOME}/bin:${SPARK_HOME}/sbin:${HADOOP_HOME}/sbin:${HAD RUN mkdir -p /var/run/sshd ${HADOOP_HOME}/hdfs ${HADOOP_HOME}/hdfs/data ${HADOOP_HOME}/hdfs/data/dfs ${HADOOP_HOME}/hdfs/data/dfs/namenode ${HADOOP_HOME}/logs -COPY . /gen3spark -WORKDIR /gen3spark - -# ENV TINI_VERSION v0.18.0 -# ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini -# RUN chmod +x /tini -# ENTRYPOINT ["/tini", "--"] - ENV PYTHONHASHSEED 1 -CMD ["/usr/sbin/sshd", "-D"] diff --git a/spark/master/Dockerfile b/spark/master/Dockerfile index 213a716..487123d 100644 --- a/spark/master/Dockerfile +++ b/spark/master/Dockerfile @@ -8,8 +8,7 @@ ENV SPARK_MASTER_LOG /spark/logs EXPOSE 8080 7077 6066 -COPY master.sh /gen3spark/ -WORKDIR /gen3spark +COPY master.sh / CMD ["/bin/bash", "/master.sh"] diff --git a/spark/master/master.sh b/spark/master/master.sh index e69de29..417fef2 100644 --- a/spark/master/master.sh +++ b/spark/master/master.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +export SPARK_MASTER_HOST=${SPARK_MASTER_HOST:-`hostname`} + +export SPARK_HOME=/spark + +. "/spark/sbin/spark-config.sh" + +. "/spark/bin/load-spark-env.sh" + +mkdir -p $SPARK_MASTER_LOG + +ln -sf /dev/stdout $SPARK_MASTER_LOG/spark-master.out + +cd /spark/bin && /spark/sbin/../bin/spark-class org.apache.spark.deploy.master.Master \ + --ip $SPARK_MASTER_HOST --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT >> $SPARK_MASTER_LOG/spark-master.out \ No newline at end of file diff --git a/spark/submit/Dockerfile b/spark/submit/Dockerfile index 68271a9..cf6560a 100644 --- a/spark/submit/Dockerfile +++ b/spark/submit/Dockerfile @@ -5,7 +5,6 @@ LABEL maintainer="Gezim Sejdiu , Giannis Mouchakis > $SPARK_WORKER_LOG/spark-worker.out \ No newline at end of file