This document walks you through what's needed to start contributing code to Apache Solr Orbit.
- Prerequisites
- Setup
- Importing the project into an IDE
- Setting Up a Local Solr Instance (Optional)
- Running Tests
- Submitting a Pull Request
- Developing Breaking Changes
- Miscellaneous
-
Python 3.12+: Use pyenv to manage Python versions.
Debian/Ubuntu:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev git
macOS:
xcode-select --install brew install pyenv jq zlib xz
-
Docker (optional): required for the
dockerpipeline. Install Docker and confirmdocker psworks. -
Git 1.9+
Fork and clone the repository, then install in development mode:
cd solr-orbit # (or your fork directory)
make developActivate the virtual environment:
| Platform | Shell | Command |
|---|---|---|
| Posix | bash/zsh | source .venv/bin/activate |
| fish | source .venv/bin/activate.fish |
|
| csh/tcsh | source .venv/bin/activate.csh |
|
| Windows | cmd.exe | .venv\Scripts\activate.bat |
| PowerShell | .venv\Scripts\Activate.ps1 |
The project uses a virtualenv created by make develop. In PyCharm:
- Go to Settings → Python Interpreter.
- Select Existing Environment.
- Point the interpreter to
.venv/bin/python3inside the repository root. - In Python Integrated Tools → Testing, set the default runner to
pytest.
Download the latest Solr release from https://solr.apache.org/downloads.html:
wget https://downloads.apache.org/solr/solr/<version>/solr-<version>.tgz
tar -xf solr-<version>.tgz
cd solr-<version>
bin/solr start -c # SolrCloud mode (recommended)Verify Solr is running:
curl http://localhost:8983/api/node/system | python3 -m json.toolsolr-orbit execute-test \
--pipeline=benchmark-only \
--workload=<your-workload> \
--target-host=localhost:8983Logs are written to ~/.benchmark/logs/benchmark.log.
make test
# or directly:
python -m pytest tests/unit/solr/ -vIntegration tests require a running Solr instance (local or Docker).
make it- Run tests:
make test(andmake itif applicable). - Rebase onto the latest
mainbefore opening a PR. - Open the PR, referencing the related issue (
Closes #123). - Respond to review comments; squash commits if asked.
Develop breaking changes in a dedicated feature branch. Rebase onto main
before the next release and merge at that point.
Install git-secrets to prevent accidentally committing credentials:
git clone https://github.com/awslabs/git-secrets.git
cd git-secrets && make installpython3 -m pip install -e .Changes to source files are reflected immediately on the next run.
Add to your launch.json:
{
"name": "pytest (current file)",
"type": "python",
"request": "launch",
"module": "pytest",
"args": ["-k", "${file}"]
}