-
Notifications
You must be signed in to change notification settings - Fork 137
Developer Guide
- Development environment setup
- Building and testing Brooklin
- Attaching a debugger to Brooklin
- Publishing a new version of Brooklin
- Contributing to Brooklin
To develop Brooklin, you need to have the following dependencies installed:
- Gradle: https://docs.gradle.org/4.10.3/userguide/installation.html
- JDK 8+: https://openjdk.java.net/install/
- Git: https://git-scm.com/downloads
- Python 2.3+: https://www.python.org/downloads/
If you do not have a Java IDE set up, you can download and install the latest version of IntelliJ IDEA Community Edition for your platform at https://www.jetbrains.com/idea/download/.
- To clone the Brooklin repository, run the following command from termina/command line:
git clone https://github.com/linkedin/brooklin.git
Note: If you are on Windows, please replace gradlew with gradlew.bat
-
To build Brooklin and run all tests:
./gradlew clean build
-
To run unit tests:
./gradlew test
-
To release the Brooklin binaries into local Maven repository:
./gradlew publishToMavenLocal
-
To build the Brooklin tarball:
./gradlew releaseTarGz
You can find the generated tarball at
datastream-tools/build/distributions/brooklin.tgz
You can always debug any of Brooklin's end-to-end tests (those extending BaseKafkaZkTest) in an IDE. However, if you ever need to attach a debugger to a deployed instance of Brooklin, here is how to do so:
-
If you made any code changes to Brooklin, you can run the following command to generate a new Brooklin tarball:
./gradlew releaseTarGz
-
Copy the tarball from
datastream-tools/build/distributions/brooklin*.tgz
to a convenient location then untar it.# You may have a different version of Brooklin tar -xzf brooklin-1.0.0.tgz cd brooklin-1.0.0
-
Modify the script in
bin/brooklin-server-start.sh
to append the following JVM debugging parameters to theEXTRA_ARGS
variable.# You can set suspend=n if you don't want Brooklin to pause on startup until a debugger is attached -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
-
When you are ready to run Brooklin, run
bin/brooklin-server-start.sh
. -
Configure your IDE to attach a debugger to a running Java process. Make sure to specify the hostname Brooklin is running on (
localhost
if running locally) as well as the port you used in step 3.Here is a SO answer explaining how to do this for IntelliJ IDEA: https://stackoverflow.com/a/30793101
Brooklin adheres to Semantic Versioning, i.e.
Given a version number MAJOR.MINOR.PATCH, increment the:
MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.
-
Decide which commit to publish as the new version (in the master branch)
-
On your local machine, open at terminal window at the root directory of your Brooklin clone. Make sure your HEAD points at the commit you chose in the previous step.
-
Edit gradle/maven.gradle by setting
allprojects.version
to the new version. -
Run the following command to produce the new tarball
./gradlew releaseTarGz
-
Go to https://github.com/linkedin/brooklin/releases/ and click "Draft a new release".
-
Type the new version in both the "Tag version" and "Release title" text boxes.
-
Set the "Target" select box to the commit you chose in step 1.
-
Upload the new release tarball located under the
./datastream-tools/build/distributions/
directory, to the new GitHub release. -
Publish the new release.
Send a PR with an update to allprojects.version
in gradle/maven.gradle setting it to a future SNAPSHOT version. For instance, if you just released version 1.0.0
, set allprojects.version
to 1.1.0-SNAPSHOT
.
Add a new entry to CHANGELOG.md documenting the new version, release date, and all noteworthy changes.
-
Sign in to Artifactory at at https://linkedin.jfrog.io/ui/login/, or use Okta application JFrog.
-
After signing in successfully, retrieve an API key that you can use to publish Brooklin artifacts:
- Click your account name on the upper right corner
- Click Edit Profile
- Click API Key on the left navigation menu
-
Run the following commands in Brooklin's root directory to specify your publishing credentials:
export ARTIFACTORY_USER=<your-bintray-username>
export ARTIFACTORY_API_KEY=<your-API-key>
- Publish the new version by running:
./gradlew artifactoryPublish
- Go to Brooklin's page on Artifactory, check out the uploaded files, and publish the new version (look for an inline notification message prompting you to publish or discard the new files).
Update the version shield on the README page. Ideally, we should have been able to use Shields.io's version badge to reflect the new version automatically, but it is flaky.
-
Contributions are accepted in the form of Pull Requests.
-
Before submitting a Pull Request, please, make sure your changes are building and passing all tests with the latest code in the
master
branch of the Brooklin upstream repo. Please, follow the instructions on this page to learn how to sync a fork with an upstream repository. -
Please, take a moment to read our Contribution Guidelines before submitting patches or opening issues.
- Home
- Brooklin Architecture
- Production Use Cases
- Developer Guide
- Documentation
- REST Endpoints
- Connectors
- Transport Providers
- Brooklin Configuration
- Test Driving Brooklin