2023-05-15 18:20:52 -04:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# -------------------------------------------------------------
|
|
|
|
# This Dockerfile creates a custom Docker image for Jupyter
|
|
|
|
# to use with the Apache Druid Jupyter notebook tutorials.
|
|
|
|
# Build using `docker build -t imply/druid-notebook:latest .`
|
|
|
|
# -------------------------------------------------------------
|
|
|
|
|
|
|
|
# Use the Jupyter base notebook as the base image
|
|
|
|
# Copyright (c) Project Jupyter Contributors.
|
|
|
|
# Distributed under the terms of the 3-Clause BSD License.
|
|
|
|
FROM jupyter/base-notebook
|
|
|
|
|
|
|
|
# Set the container working directory
|
|
|
|
WORKDIR /home/jovyan
|
|
|
|
|
|
|
|
# Install required Python packages
|
2023-06-21 12:11:00 -04:00
|
|
|
RUN pip install requests \
|
|
|
|
pip install pandas \
|
|
|
|
pip install numpy \
|
|
|
|
pip install seaborn \
|
|
|
|
pip install bokeh \
|
|
|
|
pip install kafka-python \
|
|
|
|
pip install sortedcontainers
|
2023-05-15 18:20:52 -04:00
|
|
|
|
|
|
|
# Install druidapi client from apache/druid
|
|
|
|
# Local install requires sudo privileges
|
|
|
|
USER root
|
|
|
|
ADD druidapi /home/jovyan/druidapi
|
|
|
|
WORKDIR /home/jovyan/druidapi
|
|
|
|
RUN pip install .
|
|
|
|
|
2023-06-21 12:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
# WIP -- install DruidDataDriver as a package
|
2023-05-15 18:20:52 -04:00
|
|
|
# Import data generator and configuration file
|
|
|
|
# Change permissions to allow import (requires sudo privileges)
|
2023-06-21 12:11:00 -04:00
|
|
|
|
|
|
|
# The Jupyter notebooks themselves are mounted into the image's /home/jovyan/notebooks
|
|
|
|
# path when running this image.
|
|
|
|
RUN mkdir -p /home/jovyan/notebooks
|
|
|
|
|
|
|
|
WORKDIR /home/jovyan/notebooks
|
2023-05-15 18:20:52 -04:00
|
|
|
USER jovyan
|
|
|
|
|
2023-06-21 12:11:00 -04:00
|
|
|
|
2023-05-15 18:20:52 -04:00
|
|
|
|
|
|
|
# Add location of the data generator to PYTHONPATH
|
2023-06-21 12:11:00 -04:00
|
|
|
ENV PYTHONPATH "${PYTHONPATH}:/home/jovyan/notebooks/02-ingestion"
|
2023-05-15 18:20:52 -04:00
|
|
|
|