Skip to content
rodrigo-rackspace edited this page Oct 24, 2023 · 13 revisions

Blueflood Development

Glad that you're interested in Blueflood development. If it isn't obvious, the Blueflood devs welcome bug reports and pull requests from outside contributors!

To get you set up with the necessary requirements, please check this link:

Once you're done installing, you can get to the fun of testing, coding and compiling.

Testing

Run the unit tests and integration tests before you check in code:

mvn verify -Pcassandra-1.2

Just the unit tests:

mvn test

Integration tests: (Spins up an embedded Cassandra cluster)

mvn verify -P skip-unit-tests # Runs integration tests only and skips unit tests

Packaging

If you need to build a package to deploy blueflood, it's as simple as

mvn package

You can skip all the tests and just build it with

mvn package -P skip-unit-tests,skip-integration-tests

This will generate the uber jar file in blueflood-all/target. Look for a file named blueflood-all-${VERSION}-jar-with-dependencies.jar.

Docker

The blueflood-all module has a docker build configured that uses the contrib/docker directory as its build context. After you've built the Blueflood package, you can build a Docker image with

mvn docker:build

This is the image that's pushed to https://hub.docker.com/r/rackerlabs/blueflood, but I don't know how to push new images there.

Running

To run Blueflood after packaging it, there are instructions elsewhere, like in the 10 Minute Guide. Just run the uber-jar with a good configuration.

To run from source, you can set up an IntelliJ Run Configuration as follows:

  • Use the classpath of the blueflood-all module.
  • Use com.rackspacecloud.blueflood.service.BluefloodServiceStarter as the main class.
  • Give the necessary configuration files as "VM Options", NOT as "Program Arguments": -Dblueflood.config=file:contrib/getting-started/blueflood.properties -Dlog4j.configuration=file:contrib/getting-started/log4j.properties
  • Be sure to pick a supported JVM version.

Debugging

Maven supports debugging tests during a normal build by passing it a flag. To debug Blueflood itself, you can pass the environment variable DEBUG=true to the startup script:

DEBUG=true bin/blueflood-start.sh

The JVM will wait for you to attach a debugger to port 5005 before starting up Blueflood.

To debug without building the Blueflood jar, just set up an IntelliJ Run Configuration as mentioned previously, and you can also use it as a Debug Configuration.

Code Coverage Report

The code coverage report will be generated at blueflood-core/target/site/cobertura as part of the verify phase.

Please note that the code coverage report will run all the tests a second time with instrumented code. For details see here: http://maven.40175.n5.nabble.com/Cobertura-and-Surefire-td3338334.html

Conventions

Now that you know how to build, run, and test things, you can start writing code. You'll want to check out the Code Conventions to see how Blueflood code is typically expected to look.

Monitoring - SPLUNK

As part of the monitoring tool we use SPLUNK to track logs, a guide to how to send logs to SPLUNK its here SPLUNK