<|start_filename|>zeppelin/Dockerfile<|end_filename|>
FROM apache/zeppelin:0.7.3

RUN apt-get update

RUN apt-get --yes install \
                vim       \
                libffi-dev

RUN mkdir /zeppelin/bootstrap/
RUN mkdir -p /zeppelin/webapps/webapp/styles/
RUN mkdir -p /zeppelin/webapps/webapp/scripts/

COPY bin/* /zeppelin/bin/
ADD bootstrap /zeppelin/bootstrap

ENV PATH="/zeppelin/bin:${PATH}"

RUN install-js.sh
RUN install-python.sh

<|start_filename|>build-images.cmd<|end_filename|>
pushd %~dp0zeppelin
docker build . -t sqooba/zeppelin-starter && (
  echo "image sqooba/zeppelin-starter built."
) || (
  echo "Building image failed."
  echo "A common problem is that you checked out the directory"
  echo "with CRLF (i.e. windows) line-ending."
  echo "Ensure that the scripts in zeppelin/bin have LF line-ending."
  echo.
  echo "If the problem persists, open an issue on the github repo."
)
popd



@pause


<|start_filename|>stop-zeppelin.cmd<|end_filename|>
@echo off

pushd %~dp0
call env.cmd
docker-compose stop
popd

echo "Zeppelin stopped"

@pause


<|start_filename|>start-zeppelin.cmd<|end_filename|>
@echo off

pushd %~dp0
call env.cmd
docker-compose up -d
popd

echo.
echo ========== Sqooba Snorkeling Toolset ==========
echo.
echo Zeppelin and Spark are starting ... might take some time ...
echo.
echo Zeppelin: http://localhost:%ZEPPELIN_PORT%
echo Spark:    http://localhost:%SPARK_UI_PORT% -- after you run your first notebook.
echo.
echo Upload your data in %ZEPPELIN_ROOT_DIR%\data
echo Spark logs are stored in %ZEPPELIN_ROOT_DIR%\logs
echo Your notebooks are stored in %ZEPPELIN_ROOT_DIR%\notebooks
echo.
REM echo Run refresh.sh to update js/css/python dependencies
echo.
echo ========== Happy Snorkeling ! ==========

@pause


<|start_filename|>env.cmd<|end_filename|>
@echo off

pushd %~dp0
set SCRIPT_DIR=%CD%
popd

:: find available RAM
set memory=4
for /f "skip=1" %%p in ('wmic os get freephysicalmemory') do (
  set /a memory=%%p/1048576/2
  goto :done
)
:done

set ZEPPELIN_INTP_MEMORY=-Xmx%memory%g
set ZEPPELIN_ROOT_DIR=%SCRIPT_DIR%\zeppelin
set ZEPPELIN_PORT=8080
set SPARK_UI_PORT=4080
