Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated docker maven build #766

Merged
merged 3 commits into from Dec 15, 2016

Conversation

SlevinBE
Copy link
Contributor

The current Docker build has several problems:

  • it depends on a blueflood release jar hosted on github to make a docker image. This makes it impossible to checkout any blueflood branch/tag and create a docker image out of it.
  • it downloads the latest version of the Blueflood code from github. Because of this you can't have a reliable reproducible build.
  • version numbers/urls need to be updated for every release in the Dockerfile and docker-entrypoint.sh, which is prone to mistakes.

This PR solves these issues by integrating the docker build into the Maven build. Basically it allows you to build a docker image of any branch/tag by executing the following command:

mvn clean package  docker:build -Pall-modules

This results in a docker image with two tags: 'latest' and the version of the maven project

The Dockerfile copies the jar which is the result of the package command into the Docker image, together with the other required files (such as ES-Setup, load.cdl). These changes make it independent from any outside resources such as github.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.077% when pulling aa3f8ef on Klarrio:integrated_docker_maven_build into 156dbb1 on rackerlabs:master.

@shintasmith
Copy link
Contributor

@SlevinBE thank you for your contribution. I'll look through your PR shortly.

Copy link
Contributor

@shintasmith shintasmith left a comment

Choose a reason for hiding this comment

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

a minor request

RUN curl -s -L https://github.com/rackerlabs/blueflood/releases/latest | egrep -o 'rackerlabs/blueflood/releases/download/rax-release-.*/blueflood-all-.*-jar-with-dependencies.jar' | xargs -I % curl -C - -L https://github.com/% --create-dirs -o ./blueflood-all-2.0.0-SNAPSHOT-jar-with-dependencies.jar
COPY artifacts /
RUN (ls blueflood-all-*.jar | sed "s|blueflood-all-\(.*\)-jar-with-dependencies.jar|\1|") >> BLUEFLOOD_VERSION
RUN mv blueflood-all-*-jar-with-dependencies.jar blueflood-all-jar-with-dependencies.jar
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of mv, can you create a soft link? I.e: RUN ln -s blueflood-all-$BLUEFLOOD_VERSION-jar-with-dependencies.jar blueflood-all-jar-with-dependencies.jar ?

It's just a nice to have. I know you already tag the image with a version. With a soft link, when you're inside the container, you know which version of blueflood you are running.

Copy link
Contributor Author

@SlevinBE SlevinBE Dec 15, 2016

Choose a reason for hiding this comment

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

oh, but that's why I'm extracting the version from the file and putting it into a BLUEFLOOD_VERSION file at line 16 ;)
but a soft link might indeed be simpler

@SlevinBE
Copy link
Contributor Author

I've implemented the suggestion to use a soft link to the jar file instead of writing the version to a separate file.

Copy link
Contributor

@shintasmith shintasmith left a comment

Choose a reason for hiding this comment

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

lgtm! thanks again!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 75.098% when pulling 899c36d on Klarrio:integrated_docker_maven_build into 156dbb1 on rackerlabs:master.

@shintasmith shintasmith merged commit 23ede04 into rax-maas:master Dec 15, 2016
@shintasmith
Copy link
Contributor

@SlevinBE , we are always delightfully surprised when we get PRs like yours. Would you mind sharing with us what you are using/planning to use blueflood for?

Thanks!
-shinta

@SlevinBE SlevinBE deleted the integrated_docker_maven_build branch December 15, 2016 18:23
@SlevinBE
Copy link
Contributor Author

Klarrio is specialised in building highly scalable IoT platforms for customers by either integrating open source components or by building custom components where the open source solutions don't exist or are not sufficient.
We are evaluating Blueflood for storing IoT timeseries data, backed by Scylladb (an API-compatible Cassandra alternative) and running in a DC/OS clustered cloud environment with Docker containers being our primary deployment artifacts.

@usnavi
Copy link
Contributor

usnavi commented Dec 19, 2016

Thanks for the info, @SlevinBE! We recently learned about Scylladb and am curious how it compares. They boast quite an performance boost.

@SlevinBE
Copy link
Contributor Author

We're still in the evaluation phase with Scylladb, so can't share much yet about the performance boosts (but that's also the reason why we're trying it out).
However, we did find this series of blog posts interesting about a company called "Outbrain" which did an evaluation over multiple months and kept a logbook. http://techblog.outbrain.com/2016/03/we-are-testing-scylladb-live-blogging-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants