Ozone is an Apache project. The bug tracking system for Ozone is under the Apache Jira project named HDDS.
This document summarize the contribution process:
We welcome contributions of:
- Code. File a bug and submit a patch, or pick up any one of the unassigned Jiras.
- Documentation Improvements: You can submit improvements to the Ozone website at https://github.com/apache/ozone-site
- Testing: We always need help to improve our testing
- Unit Tests (JUnit / Java)
- Acceptance Tests (docker + robot framework)
- Blockade tests (python + blockade)
- Performance: We have multiple type of load generator / benchmark tools (
ozone freon), which can be used to test cluster and report problems.
- Bug reports pointing out broken functionality, docs, or suggestions for improvements are always welcome!
If you have any questions, please don't hesitate to contact
- email: use dev@ozone.apache.org.
- chat: You can find the #ozone channel at the ASF slack. Invite link is here
- GitHub Discussions: You can also interact with the community using GitHub Discussions.
- meeting: We have weekly meetings which is open to anybody. Feel free to join and ask any questions
Requirements to compile the code:
- Unix System
- JDK 17 or later
- Maven 3.9.6 or later
- Internet connection for first build (to fetch all Maven and Ozone dependencies)
(Standard development tools such as make, gcc, etc. are required.)
After installing the requirements (especially Maven) build is as simple as:
mvn clean verify -DskipTests
- Use
-DskipShadeto skip shaded Ozone FS jar file creation. Saves time, but you can't test integration with other software that uses Ozone as a Hadoop-compatible file system. - Use
-DskipReconto skip building Recon Web UI. It saves about 2 minutes. - Use
-Pdistto build the binary tarball, similar to the one that gets released
Additional requirements for running Ozone in pseudo cluster (including acceptance tests):
- docker
- docker-compose
- jq (utility used heavily by acceptance tests)
After building Ozone locally, you can start your first pseudo cluster:
cd hadoop-ozone/dist/target/ozone-*-SNAPSHOT/compose/ozone
OZONE_REPLICATION_FACTOR=3 ./run.sh -d
See more details in the README and in the docs.
If you do not have an ASF Jira account yet, please request one from the official ASF self-service page: Request a Jira account.
When creating a new jira for any kind of new feature, improvement or bug, please follow below guideline:
- Title: Title should be a one-liner stating the problem.
- Description:
- What is the problem? Is it a feature, improvement or bug? Add as many details as possible and related design doc and discussion.
- For new features, add as many details as possible. If it is part of the big feature, attach parent jira.
- For improvement, add the value it will bring. Is it an optimization, code simplification or something else?
- For bugs, add steps to reproduce it. Where the root cause is unknown and needs investigation, it would be great to update the jira description or add the summary once the root cause is identified.
- If it is follow up of another issue, please link the previous jira to it so that context is preserve.
- Jira examples: HDDS-9272, HDDS-9322, HDDS-9291, HDDS-8940, HDDS-9282
For large feature development changes, we use a process called "Ozone Enhancement Proposals" (OEP). This process is designed to ensure that major changes to Ozone are well-designed and have community consensus. If you are planning to propose a significant change, please read the Ozone Enhancement Proposals documentation and create a design document before you start coding. Please note that we only accept design documents in Markdown format; PDF or Google Docs are no longer accepted.
We use GitHub pull requests for contributing changes to the repository. The main workflow is as follows:
- Fork
apache/ozonerepository (first time) and clone it to your local machine - Enable the
build-branchGitHub Actions workflow (defined in.github/workflows/post-commit.yml) in your fork - Ensure a Jira issue corresponding to the change exists in the HDDS project (eg. HDDS-1234)
- Please search Jira before creating a new issue, someone might have already reported the same.
- If this is your first issue, you might not be able to assign it to yourself. If so, please make a comment in the issue, indicating that your are working on it.
- Create a local branch for your contribution (eg.
git checkout -b HDDS-1234) - Make your changes locally.
- For complex changes, committing each logical part is recommended.
- Start commit messages with the Jira ID, e.g.
HDDS-1234. Fix snapshot purge regression. - If you include non-trivial content created using generative AI tooling, disclose it in each commit's message as
Co-authored-by: TOOL (MODEL)(see ASF Generative Tooling Guidance for details). Validate changes proposed by the tools before relying on it.
- Push your changes to your fork of Ozone
- Wait for the
build-branchworkflow to complete successfully for your commit. - Create a pull request for your changes
- Use the Jira ID and summary as the PR title, e.g.
HDDS-1234. Fix snapshot purge regression. - Please include the Jira link, problem description and testing instruction (follow the template)
- Use the Jira ID and summary as the PR title, e.g.
- Set the Jira issue to "Patch Available" state
- Address any review comments if applicable
- Create new, incremental commits in your branch. This makes it easy for reviewers to only review the new changes. The committer will take care to squash all your commits when merging the pull request.
- Push your commits in a batch, when no more changes are expected. This reduces the burden on automated CI checks.
- If you need to bring your PR up-to-date with the base branch (usually
master), e.g. to resolve conflicts, please do so by merge, not rebase:git merge --no-edit origin/master. - In general, please try to avoid force-push when updating the PR. Here are some great articles that explain why:
- Keep distinct issues in separate PRs, and avoid unrelated changes, such as reformatting or renaming adjacent code.
- Submit user-facing documentation changes as a separate PR to apache/ozone-site, not to this repository. Design docs and configuration descriptions in
ozone-default.xmlstay in this repository. - Move build changes, refactoring or cleanup into a follow-up PR when they obscure the functional change.
- For cleanup, consider compatibility and deprecation before removing public interfaces, and notify the original authors when practical.
- For test fixes, inspect the failure evidence and address the cause instead of only increasing a timeout.
- Keep the PR in draft while the implementation is unstable, fork CI is failing, or you are still addressing review comments.
- CI resources are shared. Do not run CI for obsolete revisions, trigger it only when necessary, and do not rerun unrelated flaky tests that are already fixed on
master. - Keep PR descriptions concise.
- If you use generative AI tooling for drafting pull request text, please include
Generated-by: TOOL (MODEL)in the description.
- Allow at least 24 hours for contributors in all time zones to provide feedback before merging non-trivial PRs, except for fixes of CI breakage.
- Before merging another PR to
master, wait until most CI jobs for the previous merge have completed (typically about one hour), leaving CI capacity for other PRs.
Basic code conventions followed by Ozone:
- 2 spaces indentation
- 120-char line length limit
- Apache license header required in most files
- no
@authortags, authorship is indicated by Git history
These are checked by tools like Checkstyle and RAT.
Ozone code style is shared via .editorconfig configuration file and will be automatically imported when the project is opened.
See https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs for detailed instructions.
- Match the surrounding code. Reuse existing helpers, test scaffolding and abstractions (e.g. bucket layout, snapshot, upgrade) instead of adding one-off conditionals or new abstractions for a single call site.
- Keep service responsibilities separated. Do not move OM logic into SCM paths, bypass existing request/response layers, or introduce cross-service shortcuts.
- Changing a wire type usually requires updating the Protobuf definition, translators, server-side logic, and compatibility or integration tests.
- Do not hand-edit generated sources or web artifacts when a source file or generation step exists.
- Keep comments concrete and local to the code.
- New behavior and bug fixes should come with tests.
- Start with the narrowest useful test: unit tests for local logic, integration tests when the behavior depends on service boundaries, cluster lifecycle, storage, RPC or upgrade flows.
- Prefer extending an existing test suite, base class or cluster provider over creating a new
MiniOzoneClusterlifecycle for similar coverage.
The hadoop-ozone/dev-support/checks directory contains scripts to build and check Ozone. Most of these are executed by CI for every commit and pull request. Running them before creating a pull request is strongly recommended. This can be achieved by enabling the build-branch workflow in your fork and letting GitHub run all of the checks, but most of the checks can also be run locally.
build.sh: compiles Ozone- quick checks (less than 2 minutes)
author.sh: checks for@authortagsbats.sh: unit test for shell scriptsrat.sh: checks for Apache license headerdependency.sh: compares list of jars in build output with known listcheckstyle.sh: Checkstylepmd.sh: PMD
- moderate (around 10 minutes)
findbugs.sh: SpotBugskubernetes.sh: very limited set of tests run in Kubernetes environment
- slow (around 1 hour or more)
unit.sh: pure unit testsintegration.sh: Java-based tests using single JVM "mini cluster"acceptance.sh: rather complete set of tests in Docker Compose-based environment
The set of tests run by integration and acceptance may be limited via arguments, please see the scripts for details. This is used by CI to run them in multiple splits to avoid taking too much time.
Some scripts require third-party tools, but most of these are installed during the first run, if needed.
Most scripts (except build.sh) output results in target/<name>, e.g. target/rat.
As Ozone uses Apache Maven it can be developed from any IDE. IntelliJ IDEA is a common choice, here are some suggestions to use it for Ozone development.
Ozone components depend on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime.
As a result, it's straightforward to start all the components from IDE as the right classpath (without provided scope) has already been set.
Ozone project has pre-defined run configurations shared via standard IDE folder for run configurations:
.run
They will be automatically added to the IDE on project import.
You can use the installed Run configurations in the following order:
- StorageContainerManagerInit (to initialize the SCM dir)
- StorageContainerManger (to start SCM)
- OzoneManagerInit (to initialize OM, it requires SCM)
- OzoneManager
- Recon (required by datanode)
- Datanode1, Datanode2, Datanode3
Checkstyle plugin may help to detect violations directly from the IDE.
- Install
Checkstyle+IDEAplugin fromFile->Settings->Plugins - Open
File->Settings->Other settings->Checkstyleand Add (+) a newConfiguration File
- Description:
Ozone - Use a local checkstyle
./hadoop-hdds/dev-support/checkstyle/checkstyle.xml
- Check the
pom.xmlfor the current version of the used checkstyle and use the same version with the plugin (File->Settings->Other settings->Checkstyle) - Open the Checkstyle Tool Window, select the
Ozonerule and execute the check
IntelliJ may not pick up protoc generated classes as they can be very huge. If the protoc files can't be compiled try the following:
- Open Help -> Edit custom properties menu.
- Add
idea.max.intellisense.filesize=10000entry - Restart your IDE
Sometimes during incremental build IDEA encounters the following error:
bad class file: hadoop-hdds/common/target/classes/org/apache/hadoop/ozone/common/ChunkBufferImplWithByteBufferList$1.class
Usually this can be fixed by removing the class file (outside of the IDE), but sometimes only by a full Rebuild.
The Ozone project uses Github Actions for its CI system. The configuration is described in detail here.