-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-30087: Create a nightly Jenkins test for the Read-Replica feature #8517
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
Merged
taklwu
merged 8 commits into
apache:HBASE-30087
from
kgeisz:docker-github-action-testing
Sep 17, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
76f3013
HBASE-30087: Create a nightly Jenkins test for the Read-Replica feature
kgeisz c709f55
Use Jenkins to run tests instead of GitHub Actions
kgeisz d8735fd
Address comments part 1
kgeisz 98531d0
Move test_*.py to test dir; Add test_read_replica_feature.py; Use pyt…
kgeisz 9154051
Add publishHTML and junit testResults to Jenkinsfile
kgeisz 9b9a89e
Run mvn spotless; Add ASF license header to test/__init__.py
kgeisz 79f2324
Add --keep-containers and --keep-image to hbase_nightly_read_replica_…
kgeisz 4f8dc1e
Update dev-support/README.md; Add dev-support/read-replica/README.md
kgeisz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| #!/usr/bin/env bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| # Run the read-replica Docker integration test suite. | ||
|
|
||
| set -e | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPLICA_DIR="${SCRIPT_DIR}/read-replica" | ||
| OUTPUT_DIR="${OUTPUT_DIR:-${REPLICA_DIR}/output}" | ||
| export HBASE_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" | ||
|
|
||
| export HBASE_IMAGE="hbase-read-replica:${BUILD_NUMBER:-local}" | ||
|
|
||
| KEEP_IMAGE=false | ||
| KEEP_CONTAINERS=false | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| -i|--keep-image) | ||
| KEEP_IMAGE=true | ||
| shift | ||
| ;; | ||
| -c|--keep-containers) | ||
| KEEP_CONTAINERS=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Unknown option: $1" | ||
| echo "Usage: $0 [-i|--keep-image] [-c|--keep-containers]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "Script dir: ${SCRIPT_DIR}" | ||
| echo "Replica dir: ${REPLICA_DIR}" | ||
| echo "Output dir: ${OUTPUT_DIR}" | ||
| echo "HBase root: ${HBASE_ROOT}" | ||
|
|
||
| echo "Changing to replica dir: REPLICA_DIR" | ||
| cd "${REPLICA_DIR}" | ||
|
|
||
| echo "Sourcing environment file: $(pwd)/.env" | ||
| set -a | ||
| source .env | ||
| set +a | ||
|
|
||
| echo "HBASE_IMAGE=${HBASE_IMAGE}" | ||
| echo "ACTIVE_CLUSTER_CONF_DIR=${ACTIVE_CLUSTER_CONF_DIR}" | ||
| echo "REPLICA_CLUSTER_CONF_DIR=${REPLICA_CLUSTER_CONF_DIR}" | ||
| echo "DOCKER_COMPOSE_FILE=${DOCKER_COMPOSE_FILE}" | ||
| echo "HBASE_DATA_STORE_ROOT=${HBASE_DATA_STORE_ROOT}" | ||
| echo "realpath of HBASE_DATA_STORE_ROOT=$(realpath ${HBASE_DATA_STORE_ROOT})" | ||
|
|
||
| echo "Removing HBase log directories from mounted volumes that may exist from a previous test run:" | ||
| echo "ACTIVE_CLUSTER_LOGS_DIR=${ACTIVE_CLUSTER_LOGS_DIR}" | ||
| echo "REPLICA_CLUSTER_LOGS_DIR=${REPLICA_CLUSTER_LOGS_DIR}" | ||
| rm -rf "${ACTIVE_CLUSTER_LOGS_DIR}" "${REPLICA_CLUSTER_LOGS_DIR}" | ||
| mkdir -p "${ACTIVE_CLUSTER_LOGS_DIR}" "${REPLICA_CLUSTER_LOGS_DIR}" | ||
| chmod 777 "${ACTIVE_CLUSTER_LOGS_DIR}" "${REPLICA_CLUSTER_LOGS_DIR}" | ||
|
|
||
| # Clone HBase source for Docker build context (Docker COPY doesn't follow symlinks) | ||
| echo "Cloning HBase source into ${REPLICA_DIR}/hbase for Docker build context..." | ||
| rm -rf "${REPLICA_DIR}/hbase" | ||
| git clone --local "${HBASE_ROOT}" "${REPLICA_DIR}/hbase" | ||
| rm -rf "${REPLICA_DIR}/hbase/.git" | ||
|
|
||
| cleanup() { | ||
| local exit_code=$? | ||
| if [ ${exit_code} -ne 0 ]; then | ||
| echo "=== FAILURE ===" | ||
| echo "An error occurred during this stage in the Jenkins run." | ||
| fi | ||
| if [ "${KEEP_CONTAINERS}" = "false" ]; then | ||
| echo "=== Cleanup: Stopping Docker containers ===" | ||
| docker compose -f "${DOCKER_COMPOSE_FILE}" down 2>/dev/null || true | ||
| else | ||
| echo "=== Cleanup: Keeping Docker containers (--keep-containers) ===" | ||
| fi | ||
| if [ "${KEEP_IMAGE}" = "false" ]; then | ||
| echo "=== Cleanup: Removing Docker image: ${HBASE_IMAGE} ===" | ||
| docker rmi --force "${HBASE_IMAGE}" 2>/dev/null || true | ||
| else | ||
| echo "=== Cleanup: Keeping Docker image: ${HBASE_IMAGE} (--keep-image) ===" | ||
| fi | ||
| echo "=== Cleanup: Deleting cloned HBase directory: ${REPLICA_DIR}/hbase ===" | ||
| rm -rf "${REPLICA_DIR}/hbase" | ||
| exit "${exit_code}" | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| # Copy latest proto file from source | ||
| echo "Copying latest version of ActiveClusterSuffix.proto to $(pwd)/python/proto/" | ||
| cp "${HBASE_ROOT}/hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto" \ | ||
| python/proto/ | ||
|
|
||
| export PYTHONPATH="$(pwd)" | ||
| echo "Set PYTHONPATH=${PYTHONPATH}" | ||
|
|
||
| # Create Python environment | ||
| echo "Creating Python environment: .venv" | ||
| python3 -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Install Python dependencies | ||
| echo "Installing Python libraries" | ||
| pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| # Compile protobuf | ||
| echo "Compiling Protobuf" | ||
| python3 python/proto/proto_compiler.py | ||
|
|
||
| # Build Docker images | ||
| echo "Building hbase-docker image" | ||
| ./build-images.sh | ||
|
|
||
| # Run read-replica integration test suite | ||
| echo "Starting read-replica integration test scripts" | ||
| echo "Starting read-replica integration test suite via Pytest..." | ||
| pytest --html="${OUTPUT_DIR}/read-replica-nightly-test-report.html" \ | ||
| --self-contained-html \ | ||
| --junitxml="${OUTPUT_DIR}/read-replica-nightly-test-results.xml" \ | ||
| python/test/test_read_replica_feature.py | ||
|
|
||
| echo "=== Success: All read-replica integration tests passed. ===" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # The name of the HBase Docker image | ||
| HBASE_IMAGE=${HBASE_IMAGE:-kgeisz/hbase-docker:read-replica-jenkins} | ||
| # The name of the HBase docker container | ||
| HBASE_CONTAINER_NAME=hbase-docker | ||
| # This is the host running the hbase-docker containers. Use localhost if the containers | ||
| # are running locally. If they are started by another container, such as a Jenkins | ||
| # container in a Docker-out-of-Docker setup, then try setting this to host.docker.internal. | ||
| HBASE_HOST=${HBASE_HOST:-localhost} | ||
| # The directory within the docker container that contains the config files | ||
| HBASE_CONF_DIR=/opt/hbase/conf | ||
| # The directory containing the 'data-store/<hbase.rootdir>' directory. | ||
| # This directory is mounted with the HBase Docker container. | ||
| HBASE_DATA_STORE_ROOT=./tmp-read-replica-data | ||
| # The port for the active cluster's HBase UI (used for cluster readiness) | ||
| ACTIVE_CLUSTER_PORT=16010 | ||
| # The port for the replica cluster's HBase UI (used for cluster readiness) | ||
| REPLICA_CLUSTER_PORT=26010 | ||
| # Local path to the active cluster's HBase config file. | ||
| # This file is part of a mounted volume, so modifying it | ||
| # locally also modifies it within the container (and vise-versa). | ||
| ACTIVE_CLUSTER_CONF_DIR=${HBASE_ROOT}/dev-support/read-replica/cluster1/conf | ||
| # Local path to docker volume where HBase sends active cluster logs | ||
| ACTIVE_CLUSTER_LOGS_DIR=${HBASE_ROOT}/dev-support/read-replica/cluster1/logs | ||
| # Same as above, except for the replica cluster | ||
| REPLICA_CLUSTER_CONF_DIR=${HBASE_ROOT}/dev-support/read-replica/cluster2/conf | ||
| # Local path to docker volume where HBase sends replica cluster logs | ||
| REPLICA_CLUSTER_LOGS_DIR=${HBASE_ROOT}/dev-support/read-replica/cluster2/logs | ||
| # The path to the docker-compose file | ||
| DOCKER_COMPOSE_FILE=${HBASE_ROOT}/dev-support/read-replica/docker-compose.yml | ||
| # The location of the utils directory within the docker container | ||
| CONTAINER_UTILS_DIR=/opt/utils | ||
| # The log level for the Python scripts | ||
| LOG_LEVEL=DEBUG |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.