fhussonnois / docker-storm

Docker, An easy way to try Apache Storm
Apache License 2.0
39 stars 36 forks source link

Enable Storm Configuration Settings #10

Closed mikewchicago13 closed 9 years ago

mikewchicago13 commented 9 years ago

Each of the Storm Daemons specify their max heap size. Unfortunately, these are often too large for the Cloud based virtual machines where I would like to run Storm Daemons. To that end, I changed the entrypoint.sh to allow an optional argument --storm.options passed in as a single string.

I know the parameter handling in a loop with boolean flags is not the most graceful and am open to any feedback for improvements.

I pushed the result of the "docker build" command to https://hub.docker.com/r/mweliczko/docker-storm/ and have tested it locally in a Windows environment and in the AWS Elastic Beanstalk Linux environment. I hope to delete mweliczko/docker-storm from Docker Hub when the spirit of this pull request is accepted and pushed to Docker Hub as fhuz/docker-storm.

Thank you very much for all that was done to get me started using Storm inside Docker. Please let me know if you have any questions or concerns.

fhussonnois commented 9 years ago

Hi Mike,

Thank you for your PR. Actually it will be preferable to pass this options as environment variables.

Using "env" is one of the best practices to dynamicaly configure a container.

Then, we can run containers as follows :

docker run --link zookeeper:zk -d fhuz/docker-storm -e STORM_WORKER_CHILDOPTS="-Xmx768" --daemons nimbus

After it will be simple to iterate over all environement variable which starts with "STORM".

In the case you have a complete storm.yaml, it still possible to mount your own storm.ymal as follows :

docker run --link zookeeper:zk -d fhuz/docker-storm -e --volume /host/storm/conf:"/usr/share/apache-storm/conf --daemons nimbus

I will work on your demand.

mikewchicago13 commented 9 years ago

Florian,

Thank you for your feedback. I like your suggestion about environment variables starting with STORM_. Would you like me to incorporate that concept into the entrypoint.sh?

About loading a storm.yaml from a mounted directory, I would prefer not to have to create a file for every type of daemon I would like to run. It would be easier to pass parameters to the Docker container running in different types of environments (locally, on premises, cloud).

Thanks, Mike

fhussonnois commented 9 years ago

Hi,

You can now override storm configuration via environment variables as follows : --env "CONFIG_WORKER_CHILDOPTS=-Xmx512m"

Thank you.

I closed this PR.