Al-assad opened a new pull request, #70821: URL: https://github.com/apache/doris/pull/70821
### Background Standalone Doris runtime images package FE, BE and Meta Service/Recycler for container deployments. Their entrypoints prepare configuration, including files mounted through Kubernetes ConfigMaps, before starting the packaged processes. ### What problem does this PR solve? Issue Number: None Related PR: None PR Type: Enhancement Problem Summary: The runtime images previously started Doris as root, preventing deployments that require a non-root operating-system user. Run FE, BE and MS/Recycler as a dedicated user and prepare writable image directories and configuration at build/startup time. This covers both integrated and disaggregated deployments; existing root-owned volumes require separate permission preparation before upgrading. ### Details - **Change map:** 122 additions / 33 deletions in production Dockerfiles and scripts, 121 added test lines, and 71 added documentation lines; no generated files. Dockerfiles establish identity and ownership, entrypoints prepare writable configuration, and the build helper forwards identity overrides. - **Before and after:** FE, BE and MS/Recycler now default to numeric UID/GID 10001:10001. ConfigMap-backed primary configuration is copied to a writable file before modification. MS preserves its configured FDB endpoint when no environment override is supplied and handles repeated startup without accumulating endpoint settings. - **Configs and defaults:** DORIS_UID and DORIS_GID build arguments default to 10001; docker-build.sh forwards matching environment variables. The image provides the Kerberos configuration symlink at build time. Kubernetes configuration and volume permissions must use matching identities. - **Impact on existing users:** Mounted storage must be writable by the configured identity. This PR does not migrate existing root-owned PVCs. Without delegated writable CPU cgroups, Workload Group CPU weights and hard limits are unavailable. Host kernel tuning must be supplied separately when the Operator system init container is skipped. - **Behavior change:** The default operating-system user changes from root to doris for standalone FE/BE/MS images. No engine, Operator, storage format or protocol changes are included. ### Testing - Bash syntax checks, targeted ShellCheck and git diff --check passed. - docker/runtime/test/non-root-config-test.sh passed under UID 10001 with all capabilities dropped and no-new-privileges enabled. Coverage includes read-only projected ConfigMap files, repeated startup, absent endpoint overrides and absent ConfigMaps. Removing the writable-file chmod reproduced Permission denied. - Built linux/amd64 FE, BE and MS images using the official Apache Doris 4.1.4 binary package, whose checksum was verified. The current branch's engine was not rebuilt. - Validated fresh DorisCluster and DorisDisaggregatedCluster deployments on native x86_64 K3s with unmodified Doris Operator 26.0.1 and fresh local-path PVCs. - All Doris processes ran as UID/GID 10001 with CapEff=0, NoNewPrivs=1 and seccomp enabled. No privileged or init containers were used for Doris; Workload Group cgroup setup was disabled. - Both deployments passed SQL INSERT, Stream Load and exact five-row query checks. CR-driven recreation changed every Doris Pod UID while retaining PVC identities and all five rows. MS and Recycler both started successfully. - Observed transient duplicate BE registration retries and DNS/gRPC recovery delays after recreation; final query checks passed. These observations were not established to be caused by non-root execution, and their code paths are unchanged. - Not covered: existing root-owned PVC migration, other storage drivers, ARM64, current-master engine compatibility, WG CPU isolation, stress/HA testing, or recreation of the external FDB/object-storage services. ### Release note Standalone FE, BE and Meta Service/Recycler Docker images run as UID/GID 10001:10001 by default, with configurable build-time IDs. Prepare permissions on existing mounted storage before upgrading. Deployments without delegated CPU cgroups cannot use Workload Group CPU weights or hard limits; node-level kernel settings must be configured externally. ### Check List (For Author) - Behavior changed: Yes (see Details). - Does this need documentation: Yes; runtime README includes identity, Operator configuration, storage permissions and limitations. - Pre-submission status: Partially verified: fresh linux/amd64 deployments with 4.1.4 binaries passed; limitations are listed in Testing. ### AI Disclosure - Tool: OpenAI Codex. - Generated: Runtime Dockerfile/entrypoint changes, tests, documentation and this PR description were prepared with AI assistance. - Human review: Pending maintainer review. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
