You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "sergioferragut (via GitHub)" <gi...@apache.org> on 2023/07/16 21:16:01 UTC
[PR] new environment vars for external druid and kafka + jupyter template (druid)
sergioferragut opened a new pull request, #14592:
URL: https://github.com/apache/druid/pull/14592
### Description
The goal of this PR is to parameterize the hostnames for the Kafka and Druid instances such that the jupyter lab environment and its set of notebooks can run on against a variety of deployments. It also standardizes how notebooks are created such that they make use of these environment variables when connecting to Kafka or Druid.
<!-- Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's not necessary to repeat the description here, however, you may choose to keep one summary sentence. -->
<!-- Describe your patch: what did you change in code? How did you fix the problem? -->
Adjusted the docker compose files to use defaults for
DRUID_VERSION -> defaults to 26.0
DRUID_HOST -> defaults to "router" which works with Druid deployed with the docker compose
KAFKA_HOST -> defaults to "kafka" which works with Kafka deployed with docker compose
Also added a jupyter notebook template @`examples/ that shows how to initialize both kafka and druid host variables in order to make the notebooks work with this parameterized hosts approach.
Using these variables users can use the notebooks on other instances of Druid and/or Kafka.
Examples:
- If you run both Kafka and Druid standalone in the local system and only run jupyter through docker compose:
`KAFKA_HOST=host.docker.internal DRUID_HOST=host.docker.internal docker compose --profile jupyter up -d`
- If you run both Druid standalone in the local system and run kafka and jupyter through docker compose:
`KAFKA_HOST=host.docker.internal DRUID_HOST=host.docker.internal docker compose --profile kafka-jupyter up -d`
- Self-contained startup with all services running:
`docker compose --profile all-services up -d`
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [ x ] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ x ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [ x ] been tested in a test Druid cluster.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1267026528
##########
examples/quickstart/jupyter-notebooks/docker-jupyter/docker-compose-local.yaml:
##########
@@ -69,7 +69,7 @@ services:
- KAFKA_ENABLE_KRAFT=false
coordinator:
- image: apache/druid:${DRUID_VERSION}
+ image: apache/druid:${DRUID_VERSION:-26.0.0}
Review Comment:
@abhishekrb19 , The goal is fewer command line arguments, yes. This is only used by the tutorials, and we need to reduce friction as much as possible.
The tutorials do not run against unreleased versions like 28.0.0. Master should change to 27.0.0 at release time -- this can be a docs task.
These artifacts don't go into the distribution, so if someone downloads 27.0.0, won't include files that refer to 26.0.0.
We'll update the [docs](https://druid.apache.org/docs/latest/tutorials/tutorial-jupyter-docker.html) to clarify in another pr.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1265998171
##########
examples/quickstart/jupyter-notebooks/notebooks/99-contributing/notebook-template.ipynb:
##########
@@ -0,0 +1,161 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "0cb3b009-ebde-4d56-9d59-a028d66d8309",
+ "metadata": {},
+ "source": [
+ "# Title\n",
+ "<!--\n",
+ " ~ Licensed to the Apache Software Foundation (ASF) under one\n",
+ " ~ or more contributor license agreements. See the NOTICE file\n",
+ " ~ distributed with this work for additional information\n",
+ " ~ regarding copyright ownership. The ASF licenses this file\n",
+ " ~ to you under the Apache License, Version 2.0 (the\n",
+ " ~ \"License\"); you may not use this file except in compliance\n",
+ " ~ with the License. You may obtain a copy of the License at\n",
+ " ~\n",
+ " ~ http://www.apache.org/licenses/LICENSE-2.0\n",
+ " ~\n",
+ " ~ Unless required by applicable law or agreed to in writing,\n",
+ " ~ software distributed under the License is distributed on an\n",
+ " ~ \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ " ~ KIND, either express or implied. See the License for the\n",
+ " ~ specific language governing permissions and limitations\n",
+ " ~ under the License.\n",
+ " -->\n",
+ "Introduction to Notebook\n",
+ "Lorem Ipsum"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bbdbf6ad-ca7b-40f5-8ca3-1070f4a3ee42",
+ "metadata": {},
+ "source": [
+ "## Prerequisites\n",
+ "\n",
+ "This tutorial works with Druid 25.0.0 or later.\n",
Review Comment:
nit should we make this Druid version a variable. like XX.0.0 ?
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "abhishekrb19 (via GitHub)" <gi...@apache.org>.
abhishekrb19 commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1266215821
##########
examples/quickstart/jupyter-notebooks/docker-jupyter/docker-compose-local.yaml:
##########
@@ -69,7 +69,7 @@ services:
- KAFKA_ENABLE_KRAFT=false
coordinator:
- image: apache/druid:${DRUID_VERSION}
+ image: apache/druid:${DRUID_VERSION:-26.0.0}
Review Comment:
hmm, what's the benefit of having a static default version here besides having to specify fewer command line args with docker-compose? Do we expect a developer to bump up this default version with every release as documented [here](https://github.com/apache/druid/blob/master/distribution/asf-release-process-guide.md#preparing-the-master-branch-for-the-next-version-after-branching)? For example, currently, it should be `28.0.0` to get the latest and greatest features
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1267026528
##########
examples/quickstart/jupyter-notebooks/docker-jupyter/docker-compose-local.yaml:
##########
@@ -69,7 +69,7 @@ services:
- KAFKA_ENABLE_KRAFT=false
coordinator:
- image: apache/druid:${DRUID_VERSION}
+ image: apache/druid:${DRUID_VERSION:-26.0.0}
Review Comment:
@abhishekrb19 , The goal is fewer command line arguments, yes. This is only used by the tutorials, and we need to reduce friction as much as possible.
The tutorials do not run against unreleased versions like 28.0.0. Master should change to 27.0.0 at release time -- this can be a docs task.
These artifacts don't go into the distribution, so if someone downloads 27.0.0, it won't include files that refer to 26.0.0.
We'll update the [docs](https://druid.apache.org/docs/latest/tutorials/tutorial-jupyter-docker.html) to clarify in another pr.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith merged PR #14592:
URL: https://github.com/apache/druid/pull/14592
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "abhishekrb19 (via GitHub)" <gi...@apache.org>.
abhishekrb19 commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1267340184
##########
examples/quickstart/jupyter-notebooks/docker-jupyter/docker-compose-local.yaml:
##########
@@ -69,7 +69,7 @@ services:
- KAFKA_ENABLE_KRAFT=false
coordinator:
- image: apache/druid:${DRUID_VERSION}
+ image: apache/druid:${DRUID_VERSION:-26.0.0}
Review Comment:
Thanks for the clarification, @techdocsmith. That sounds reasonable to me, especially if we have an automated way/process to bump up these versions _after_ a release, so folks playing around with notebooks always get the latest Druid version by default.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] new environment vars for external druid and kafka + jupyter template (druid)
Posted by "abhishekrb19 (via GitHub)" <gi...@apache.org>.
abhishekrb19 commented on code in PR #14592:
URL: https://github.com/apache/druid/pull/14592#discussion_r1267340184
##########
examples/quickstart/jupyter-notebooks/docker-jupyter/docker-compose-local.yaml:
##########
@@ -69,7 +69,7 @@ services:
- KAFKA_ENABLE_KRAFT=false
coordinator:
- image: apache/druid:${DRUID_VERSION}
+ image: apache/druid:${DRUID_VERSION:-26.0.0}
Review Comment:
Thanks for the clarification, @techdocsmith. That sounds reasonable to me, especially if we have an automated way/process to bump up these versions _after_ a release, so folks playing around with notebooks always get the latest released Druid version by default.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org