Skip to content

Commit 0f1a7ba

Browse files
[improvement](build) Simplify and speed up Hive docker startup workflow (apache#62103)
### What problem does this PR solve? Related Issue: apache#62101 Problem Summary: Hive thirdparty startup in `docker/thirdparties` had three main problems: 1. Startup was slow, especially when `refresh` repeatedly restored a large baseline tarball and re-ran initialization paths that were hard to reason about. 2. The runtime model exposed too many user-facing configuration concepts (`bootstrap groups`, shared-id indirection, baseline version state file), which made the workflow harder to understand and easier to misconfigure. 3. Incremental refresh behavior was not observable enough, so it was hard to tell what was actually re-executed and where startup time was going. This PR restructures the Hive startup flow around a simpler model: - `rebuild`: ignore baseline and build everything from scratch. - `refresh` (default): reset volumes, restore the published baseline, then incrementally refresh only changed modules. - `fast`: reuse existing volumes and skip refresh entirely. At the same time, this PR simplifies the baseline restore path, removes obsolete startup code, and improves logging/documentation so the behavior is easier to maintain. #### Main changes 1. **Clarify startup modes and align implementation with them.** - `rebuild` now means full local bootstrap from scratch, without baseline restore. - `refresh` now means reset volumes, restore the published baseline, then reconcile changed modules. - `fast` now means reuse existing volumes and skip refresh entirely; if volumes are empty and no baseline is available, startup fails instead of silently creating an empty environment. 2. **Simplify the Hive startup code path.** - Remove obsolete monolithic scripts that were no longer on the main startup path. - Keep the startup chain centered on: - `start-hive-metastore.sh` - `init-hive-baseline.sh` - `refresh-hive-modules.sh` - Fix Hive health checks so stack reuse logic matches the actual `CONTAINER_UID`-prefixed container names. 3. **Reduce unnecessary configuration surface.** - Fix `HIVE_SHARED_ID` as an internal constant instead of exposing it as user config. - Remove user-facing `bootstrap groups` from the external interface; Hive2/Hive3 now automatically select the correct shared/version-specific bootstrap files internally. 4. **Simplify baseline packaging and restore semantics.** - Standardize baseline filenames so local cache and OSS naming both use: - `<hive_version>-baseline-<version>.tar.gz` - Remove runtime dependence on `/mnt/state/baseline.version`. - Newly exported baseline tarballs no longer retain `baseline.version`. - Incremental refresh decisions now depend on module SHA state under `/mnt/state/modules/`, not on a separate version marker file. 5. **Speed up repeated baseline restores.** - Keep the downloaded tarball under `HIVE_BASELINE_TARBALL_CACHE`. - Add a second cache layer for the extracted baseline directory under the same cache root. - Subsequent restores reuse the extracted baseline tree directly, avoiding repeated `tar.gz` decompression on every `refresh`. 6. **Improve refresh observability.** - At the end of each refresh, print a summary of what was actually re-executed. - The summary includes refreshed modules and a compact detail preview, for example changed `preinstalled_hql` files. - This makes refresh regressions easier to spot when startup gets slower. 7. **Refresh and simplify documentation.** - Rewrite the Hive docker README in both English and Chinese. - Document the architecture, startup modes, baseline workflow, incremental refresh model, typical developer workflows, and troubleshooting.
1 parent c353518 commit 0f1a7ba

202 files changed

Lines changed: 3430 additions & 1232 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docker/thirdparties/custom_settings.env‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ export s3BucketName="doris-regression-hk"
2727
# Optional Maven repository override for thirdparty jar downloads.
2828
# export MAVEN_REPOSITORY_URL="https://maven.aliyun.com/repository/central"
2929
export MAVEN_REPOSITORY_URL="${MAVEN_REPOSITORY_URL:-https://repo1.maven.org/maven2}"
30+
# Hive shared-volume baseline rollout settings.
31+
# Update HIVE_BASELINE_VERSION when publishing a new baseline tarball.
32+
export HIVE_BASELINE_VERSION="20260415"
33+
export HIVE_BASELINE_TARBALL_CACHE="${ROOT}/docker-compose/hive/scripts/baseline"

‎docker/thirdparties/docker-compose/hive/README.md‎

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)