risedev/task/doris_service.rs
1// Copyright 2026 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use super::docker_service::{DockerService, DockerServiceConfig};
16use crate::DorisConfig;
17
18pub const DORIS_CONTAINER_HOST: &str = "127.0.0.1";
19pub const DORIS_CONTAINER_HTTP_PORT: u16 = 8030;
20pub const DORIS_CONTAINER_BE_HTTP_PORT: u16 = 8040;
21pub const DORIS_CONTAINER_QUERY_PORT: u16 = 9030;
22
23impl DockerServiceConfig for DorisConfig {
24 fn id(&self) -> String {
25 self.id.clone()
26 }
27
28 fn is_user_managed(&self) -> bool {
29 self.user_managed
30 }
31
32 fn image(&self) -> String {
33 self.image.clone()
34 }
35
36 fn ports(&self) -> Vec<(String, String)> {
37 vec![
38 (
39 self.http_port.to_string(),
40 DORIS_CONTAINER_HTTP_PORT.to_string(),
41 ),
42 // Doris includes the BE HTTP port in stream-load redirects. The port therefore
43 // cannot be remapped by Docker without making the redirected URL unreachable.
44 (
45 DORIS_CONTAINER_BE_HTTP_PORT.to_string(),
46 DORIS_CONTAINER_BE_HTTP_PORT.to_string(),
47 ),
48 (
49 self.query_port.to_string(),
50 DORIS_CONTAINER_QUERY_PORT.to_string(),
51 ),
52 ]
53 }
54}
55
56/// Docker-backed Doris service.
57pub type DorisService = DockerService<DorisConfig>;