Skip to content

Set default value of ZK_VERSION in docker compose file#11127

Closed
FrankChen021 wants to merge 1 commit intoapache:masterfrom
FrankChen021:zk_version
Closed

Set default value of ZK_VERSION in docker compose file#11127
FrankChen021 wants to merge 1 commit intoapache:masterfrom
FrankChen021:zk_version

Conversation

@FrankChen021
Copy link
Copy Markdown
Member

Description

#10786 Introduced an environment variable ZK_VERSION in docker-compose.base.yml and this env variable is set to 3.5 in pom.xml of integration-test module and the travis file .travis.yml .

In the README of integration-test module, there's a section describing how to manually bring up Druid cluster by docker-compose. And because of lacking of description that ZK_VERSION must be set, following the steps in that section leads to failure of starting up druid-zookeeper-kafka service.

Of course one way to solve that problem is by updating the README to add a step to tell users to set ZK_VERSION before manually bringing up Druid cluster. But I think it's not friendly for users to do this because ZK_VERSION is an interval environment variable mainly for backward compatibility and not a variable exposed to users.

So, I make a slight change to the compose file to set the default value of ZK_VERSION to 3.5, so that users don't care about setting this value.

  • If ZK_VERSION is not set by shell environment variable, it will default to 3.5
  • If ZK_VERSION is set by shell environment variable, it will use the value set by shell

Such behaviors are compatible with current ways.

Since the default value of ZK_VERSION is set in compose file, I also remove zk.version property from pom.xml in integration-test module to simply the management of default version.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • 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
  • 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 is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@FrankChen021 FrankChen021 requested review from xvrl and zachjsh April 18, 2021 07:32
@asdf2014 asdf2014 added the Docker https://hub.docker.com/r/apache/druid label Apr 18, 2021
Comment thread integration-tests/pom.xml
<docker.build.skip>false</docker.build.skip>
<docker.build.hadoop>false</docker.build.hadoop>
<it.indexer>middleManager</it.indexer>
<zk.version>3.5</zk.version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be removed from .travis.yml too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I think it should be, but I'm unable to validate this change on my local so I leave it there. Will Any change to .travis.yml be reflected on the CI in this PR ? If it's, I can push a commit to delete the default version in that file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will Any change to .travis.yml be reflected on the CI in this PR ?

Yes. It will.

@xvrl
Copy link
Copy Markdown
Member

xvrl commented Apr 19, 2021

thanks @FrankChen021 I'm actually planning to remove the need for this environment variable in #11073. Since we want to keep the maven ZK version in sync with what we run integration tests against, we may need to adjust things a little.

@FrankChen021
Copy link
Copy Markdown
Member Author

thanks @FrankChen021 I'm actually planning to remove the need for this environment variable in #11073. Since we want to keep the maven ZK version in sync with what we run integration tests against, we may need to adjust things a little.

Thanks for you information. I checked the PR you mentioned, and found that there's no change made to integration-tests/docker/service-supervisords/zookeeper.conf which references ZK_VERSION environment variable. That means setting of this env variable is still needed before manually executing 'docker-compose' command to bring up Druid cluster. The core change in this PR is setting this environment variable in docker file instead of pom.xml in integration-test module. Do you plan to make an adjust there ?

@xvrl
Copy link
Copy Markdown
Member

xvrl commented Apr 20, 2021

@FrankChen021 I see your point, I updated #11073 to completely remove the need to specify ZK_VERSION at runtime when spinning up docker-compose. The variable is still required at build time to build the docker image, but that's no different than other docker build arguments such as MYSQL_VERSION that we already have to specify. Hope this satisfies your concerns.

@FrankChen021
Copy link
Copy Markdown
Member Author

Thanks @xvrl , I close this PR and wait for your PR to be merged.

@FrankChen021 FrankChen021 deleted the zk_version branch April 21, 2021 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Testing Docker https://hub.docker.com/r/apache/druid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants