File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Common IDE configuration directories and files that should be ignored
2+ * .vscode
3+ * .idea
4+
5+ # Previous build output that should not be included
6+ build
7+ directories
8+
9+ # Ignore the Dockerfile itself
10+ Dockerfile
11+
12+ # Ignore CI related files are we don't need those in the container
13+ .codecov.yml
14+ .coveragerc
15+ .gitignore
16+ .travis.yml
Original file line number Diff line number Diff line change 1+ FROM python:3.7.5-slim
2+ USER root
3+ SHELL ["/bin/bash" , "--login" , "-c" ]
4+
5+ ENV DEBIAN_FRONTEND noninteractive
6+ ENV SCALA_VERSION 2.11
7+ ENV KAFKA_VERSION 2.3.0
8+ ENV KAFKA_HOME /opt/kafka_"$SCALA_VERSION" -"$KAFKA_VERSION"
9+
10+ # Install conda
11+ ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh /miniconda.sh
12+ RUN sh /miniconda.sh -b -p /conda && /conda/bin/conda update -n base conda
13+ RUN echo "PATH=${PATH}:/conda/bin" >> ~/.bashrc
14+
15+ # Add Streamz source code to the build context
16+ ADD . /streamz/.
17+
18+ # Create the conda environment
19+ RUN conda env create --name streamz-dev -f /streamz/conda/environments/streamz_dev.yml
20+ RUN conda init bash
21+
22+ # Ensures subsequent RUN commands do not need the "conda activate streamz_dev" command
23+ RUN echo "conda activate streamz_dev" >> ~/.bashrc
24+
25+ # Build streamz from source
26+ RUN cd /streamz && \
27+ python setup.py install
28+
29+ # Install optional dependencies in the conda environment
30+ RUN conda install -c conda-forge jupyterlab \
31+ numpy \
32+ pandas \
33+ wget \
34+ vim
35+
36+ # Install Kafka
37+ RUN wget -q http://www.gtlib.gatech.edu/pub/apache/kafka/2.3.0/kafka_2.11-2.3.0.tgz -O /tmp/kafka_"$SCALA_VERSION" -"$KAFKA_VERSION" .tgz && \
38+ tar xfz /tmp/kafka_"$SCALA_VERSION" -"$KAFKA_VERSION" .tgz -C /opt && \
39+ rm /tmp/kafka_"$SCALA_VERSION" -"$KAFKA_VERSION" .tgz
40+
41+ # Zookeeper & Kafa ports
42+ EXPOSE 2181
43+ EXPOSE 9092
44+
45+ CMD ["/streamz/docker/scripts/entry.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ docker build -t streamz:0.5.2 .
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ docker run -p 8888:8888 streamz:0.5.2
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Activate the streamz-dev anaconda environment by default
4+ source activate streamz-dev
5+
6+ # Start Zookeeper
7+ $KAFKA_HOME /bin/zookeeper-server-start.sh -daemon $KAFKA_HOME /config/zookeeper.properties
8+
9+ # Configure Kafka
10+ sed -i ' /#listeners=PLAINTEXT:\/\/:9092/c\listeners=PLAINTEXT:\/\/localhost:9092' $KAFKA_HOME /config/server.properties
11+ sed -i ' /#advertised.listeners=PLAINTEXT:\/\/your.host.name:9092/c\advertised.listeners=PLAINTEXT:\/\/localhost:9092' $KAFKA_HOME /config/server.properties
12+
13+ # Start Kafka
14+ $KAFKA_HOME /bin/kafka-server-start.sh -daemon $KAFKA_HOME /config/server.properties
15+
16+ # Start up a jupyter notebook
17+ cd /streamz/examples && jupyter-lab --allow-root --ip=0.0.0.0 --no-browser --NotebookApp.token=' '
Original file line number Diff line number Diff line change @@ -74,6 +74,26 @@ To install either use:
7474- pip: ``pip install streamz ``
7575- dev: ``git clone https://github.com/python-streamz/streamz `` followed by ``pip install -e streamz/ ``
7676
77+ Quickstart
78+ ----------
79+
80+ The streamz project offers a Docker image for the convenience of quickly trying out streamz and its features.
81+ The purpose of the Dockerfile at this time is not to be used in a production
82+ environment but rather for experimentation, learning, or new feature development.
83+
84+ Its most common use would be to interact with the streamz example jupyter notebooks. Lets walk through the steps needed for this.
85+
86+ - Build the Docker container
87+ .. code-block :: bash
88+ $ docker/build.sh
89+ - Run the Docker container
90+ .. code-block :: bash
91+ $ docker/run.sh
92+ - Interact with Jupyter Lab on the container in your browser at `JUPYTER_LAB `_.
93+ .. JUPYTER_LAB: http://localhost:8888/
94+
95+
96+
7797 Related Work
7898------------
7999
You can’t perform that action at this time.
0 commit comments