vtlim commented on code in PR #13984: URL: https://github.com/apache/druid/pull/13984#discussion_r1181815899
########## docs/tutorials/tutorial-jupyter-docker.md: ########## @@ -0,0 +1,193 @@ +--- +id: tutorial-jupyter-docker +title: "Docker for Jupyter Notebook tutorials" +sidebar_label: "Docker for tutorials" +--- + +<!-- + ~ 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. + --> + + +Apache Druid provides a custom Jupyter container that contains the prerequisites +for all Jupyter-based Druid tutorials, as well as all of the tutorials themselves. +You can run the Jupyter container, as well as containers for Druid and Apache Kafka, +using the Docker Compose file provided in the Druid GitHub repository. + +You can run the following combination of applications: +* [Jupyter only](#start-only-the-jupyter-container) +* [Jupyter and Druid](#start-jupyter-and-druid) +* [Jupyter, Druid, and Kafka](#start-jupyter-druid-and-kafka) + +## Prerequisites + +Jupyter in Docker requires that you have **Docker** and **Docker Compose**. +We recommend installing these through [Docker Desktop](https://docs.docker.com/desktop/). + +## Launch the Docker containers + +You run Docker Compose to launch Jupyter and optionally Druid or Kafka. +Docker Compose references the configuration in `docker-compose.yaml`. +Running Druid in Docker also requires the `environment` file, which +sets the configuration properties for the Druid services. +To get started, download both `docker-compose.yaml` and `environment` from +[`tutorial-jupyter-docker.zip`](https://github.com/apache/druid/blob/master/examples/quickstart/jupyter-notebooks/docker-jupyter/tutorial-jupyter-docker.zip). + +Alternatively, you can clone the [Apache Druid repo](https://github.com/apache/druid) and +access the files in `druid/examples/quickstart/jupyter-notebooks/docker-jupyter`. + +### Start only the Jupyter container + +If you already have Druid running locally, you can run only the Jupyter container to complete the tutorials. +In the same directory as `docker-compose.yaml`, start the application: + +```bash +docker compose --profile jupyter up -d +``` + +The Docker Compose file assigns `8889` for the Jupyter port. +You can override the port number by setting the `JUPYTER_PORT` environment variable before starting the Docker application. + +### Start Jupyter and Druid + +Running Druid in Docker requires the `environment` file as well as the `DRUID_VERSION` environment variable. +`DRUID_VERSION` references the Docker tag for the version of Druid to pull from the +[Apache Druid Docker Hub](https://hub.docker.com/r/apache/druid/tags). + +In the same directory as `docker-compose.yaml` and `environment`, start the application: + +```bash +DRUID_VERSION={{DRUIDVERSION}} docker compose --profile druid-jupyter up -d +``` + +### Start Jupyter, Druid, and Kafka + +Running Druid in Docker requires the `environment` file as well as the `DRUID_VERSION` environment variable. + +In the same directory as `docker-compose.yaml` and `environment`, start the application: + +```bash +DRUID_VERSION={{DRUIDVERSION}} docker compose --profile all-services up -d +``` + +### Update image from Docker Hub + +If you already have a local cache of the Jupyter image, you can update the image before running the application using the following command: Review Comment: From what I can tell, you can set up tooling to automatically update to the latest image, but this doesn't happen by default... https://stackoverflow.com/questions/26423515/how-to-automatically-update-your-docker-containers-if-base-images-are-updated -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
