Skip to content

Commit 8fd4a49

Browse files
author
bingtao.yin
committed
add ide files
1 parent 9243365 commit 8fd4a49

File tree

16 files changed

+940
-0
lines changed

16 files changed

+940
-0
lines changed

.clangd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,22 @@ If:
2323

2424
CompileFlags:
2525
CompilationDatabase: be/ut_build_ASAN/
26+
27+
---
28+
29+
If:
30+
PathMatch: be/.*
31+
32+
CompileFlags:
33+
CompilationDatabase: be/build_Debug
34+
35+
---
36+
37+
If:
38+
PathMatch: cloud/.*
39+
40+
CompileFlags:
41+
CompilationDatabase: cloud/build_Debug
42+
Add:
43+
- -isystem
44+
- /opt/transwarp/doris/gensrc/build

.devcontainer/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
tmp

.devcontainer/Dockerfile

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
FROM ubuntu:22.04
2+
3+
ARG HTTP_PROXY
4+
ARG DEV_USERNAME
5+
ARG USER_UID
6+
ARG USER_GID
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
ENV http_proxy=${HTTP_PROXY}
10+
ENV https_proxy=${HTTP_PROXY}
11+
ENV HTTP_PROXY=${HTTP_PROXY}
12+
ENV HTTPS_PROXY=${HTTP_PROXY}
13+
ENV ALL_PROXY=${HTTP_PROXY}
14+
ENV CLANGD_VERSION=21.1.0
15+
ENV CLANGD_HOME=/usr/local/lib/clangd
16+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
17+
ENV MAVEN_HOME=/usr/local/maven
18+
ENV MAVEN_VERSION=3.9.12
19+
ENV LDB_TOOLCHAIN=/var/local/ldb-toolchain
20+
ENV PATH=${LDB_TOOLCHAIN}/bin:${JAVA_HOME}/bin:${CLANGD_HOME}/bin:${MAVEN_HOME}/bin:${PATH}
21+
ENV TZ=Asia/Shanghai
22+
23+
RUN \
24+
# prepare apt
25+
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
26+
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
27+
echo 'Acquire::ForceIPv4 "true";' >> /etc/apt/apt.conf.d/1000-force-ipv4-transport && \
28+
echo 'Acquire::Retries "100";' >> /etc/apt/apt.conf.d/80-retries && \
29+
echo "Acquire::http::Proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf.d/99-proxy && \
30+
echo "Acquire::https::Proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf.d/99-proxy && \
31+
apt-get update -y && \
32+
# basics
33+
PKGS="software-properties-common" && \
34+
apt-get install -y ${PKGS} && \
35+
apt-get update -y && \
36+
PKGS="vim sudo locales git curl unzip wget zip iputils-ping iproute2 tzdata tree jq" && \
37+
PKGS="${PKGS} net-tools telnet ccache linux-tools-common linux-tools-generic" && \
38+
apt-get install -y ${PKGS} && \
39+
locale-gen en_US.UTF-8 && \
40+
echo ${TZ} > /etc/timezone && \
41+
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
42+
dpkg-reconfigure tzdata && \
43+
# doris build deps
44+
PKGS="openjdk-17-jdk maven pkg-config cmake byacc flex automake libtool-bin bison zip unzip libncurses5-dev curl git ninja-build python3" && \
45+
PKGS="${PKGS} autoconf automake libtool autopoint" && \
46+
# misc
47+
PKGS="${PKGS} mysql-client" && \
48+
apt-get install -y ${PKGS} && \
49+
apt-get autoclean
50+
51+
ADD tmp/ldb_toolchain_gen_025.sh /tmp/
52+
53+
RUN \
54+
bash /tmp/ldb_toolchain_gen_025.sh ${LDB_TOOLCHAIN} \
55+
&& rm /tmp/ldb_toolchain_gen_025.sh
56+
57+
RUN \
58+
# clangd
59+
wget "https://github.com/clangd/clangd/releases/download/${CLANGD_VERSION}/clangd-linux-${CLANGD_VERSION}.zip" -O /tmp/clangd.zip && \
60+
unzip /tmp/clangd.zip -d ${CLANGD_HOME} && \
61+
mv ${CLANGD_HOME}/clangd_${CLANGD_VERSION}/* ${CLANGD_HOME} && \
62+
rm -rf ${CLANGD_HOME}/clangd_${CLANGD_VERSION} && \
63+
rm -rf /tmp/clangd.zip && \
64+
# maven
65+
wget https://mirrors.aliyun.com/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz -O /tmp/maven.tar.gz && \
66+
tar -zxvf /tmp/maven.tar.gz -C /usr/local/ && \
67+
mv /usr/local/apache-maven-${MAVEN_VERSION} ${MAVEN_HOME} && \
68+
rm -rf /tmp/maven.tar.gz
69+
70+
COPY settings.xml ${MAVEN_HOME}/conf
71+
72+
RUN \
73+
# proxy for wget
74+
echo "use_proxy = on" >> /etc/wgetrc && \
75+
echo "http_proxy = ${http_proxy}" >> /etc/wgetrc && \
76+
echo "https_proxy = ${http_proxy}" >> /etc/wgetrc && \
77+
# misc
78+
echo "* soft core unlimited" >>/etc/security/limits.conf && \
79+
mkdir /coredumps && \
80+
chmod o+rwx /coredumps
81+
82+
RUN \
83+
# Create the user
84+
groupadd --gid $USER_GID $DEV_USERNAME \
85+
&& useradd --uid $USER_UID --gid $USER_GID -m $DEV_USERNAME \
86+
#
87+
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
88+
&& echo $DEV_USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$DEV_USERNAME \
89+
&& chmod 0440 /etc/sudoers.d/$DEV_USERNAME
90+
91+
ENV LC_ALL="en_US.UTF-8"
92+
ENV LANG="en_US.UTF-8"
93+
94+
USER $DEV_USERNAME
95+
96+
# unset
97+
ENV http_proxy=
98+
ENV https_proxy=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM ubuntu:22.04
2+
3+
ARG OUTPUT_DIR
4+
ARG HTTP_PROXY
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
8+
ENV PATH=${JAVA_HOME}/bin:${PATH}
9+
ENV TZ=Asia/Shanghai
10+
ENV GO_VERSION=1.25.1
11+
12+
RUN \
13+
# prepare apt
14+
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
15+
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
16+
echo 'Acquire::ForceIPv4 "true";' >> /etc/apt/apt.conf.d/1000-force-ipv4-transport && \
17+
echo 'Acquire::Retries "100";' >> /etc/apt/apt.conf.d/80-retries && \
18+
apt-get update -y && \
19+
# basics
20+
PKGS="software-properties-common" && \
21+
PKGS="${PKGS} openjdk-17-jdk" && \
22+
PKGS="${PKGS} vim sudo locales curl unzip wget iputils-ping iproute2 tzdata tree" && \
23+
# from doris
24+
PKGS="${PKGS} patchelf gdb binutils binutils-common mysql-client" \
25+
PKGS="${PKGS} curl wget less vim htop iproute2 numactl jq iotop sysstat" \
26+
PKGS="${PKGS} tcpdump iputils-ping dnsutils strace lsof blktrace tzdata" \
27+
PKGS="${PKGS} bpfcc-tools linux-headers-realtime linux-tools-realtime silversearcher-ag" \
28+
PKGS="${PKGS} net-tools ca-certificates openssl" && \
29+
apt-get install -y ${PKGS} && \
30+
apt-get autoclean && \
31+
rm -rf /var/lib/apt/lists/* && \
32+
locale-gen en_US.UTF-8 && \
33+
echo ${TZ} > /etc/timezone && \
34+
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
35+
dpkg-reconfigure tzdata
36+
37+
ENV LC_ALL="en_US.UTF-8"
38+
ENV LANG="en_US.UTF-8"
39+
40+
# pprof
41+
RUN \
42+
# proxy for wget
43+
echo "use_proxy = on" >> /root/.wgetrc && \
44+
echo "http_proxy = ${HTTP_PROXY}" >> /root/.wgetrc && \
45+
echo "https_proxy = ${HTTP_PROXY}" >> /root/.wgetrc && \
46+
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
47+
rm -rf /usr/local/go && \
48+
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
49+
rm go${GO_VERSION}.linux-amd64.tar.gz && \
50+
echo "" > /root/.wgetrc
51+
52+
ENV PATH="/usr/local/go/bin:${PATH}"
53+
ENV GOPATH=/go
54+
ENV PATH="${GOPATH}/bin:${PATH}"
55+
56+
RUN GOPROXY=https://goproxy.cn,direct http_proxy=${HTTP_PROXY} http_proxy=${HTTP_PROXY} go install github.com/google/pprof@latest
57+
58+
COPY ${OUTPUT_DIR} /opt/doris
59+
60+
WORKDIR /opt/doris
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
common_build_args="
4+
--network=host
5+
--build-arg HTTP_PROXY=http://192.168.2.1:28080
6+
"
7+
function image_suffix {
8+
commit=$(git rev-parse --short HEAD)
9+
current_date=$(date +%Y%m%d)
10+
11+
echo "${current_date}_${commit}"
12+
13+
unset commit
14+
unset current_date
15+
}
16+
17+
function build_runtime {
18+
tag=$(image_suffix)
19+
20+
build_args="
21+
${common_build_args}
22+
--build-arg OUTPUT_DIR=output
23+
"
24+
25+
docker build \
26+
${build_args} \
27+
-t doris_runtime:${tag} \
28+
-f Dockerfile \
29+
.
30+
31+
unset tag
32+
unset build_args
33+
}

.devcontainer/devcontainer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3+
{
4+
"name": "doris dev",
5+
"dockerComposeFile": "docker-compose.yml",
6+
"service": "doris_dev_service",
7+
"workspaceFolder": "/opt/transwarp/doris",
8+
"customizations": {
9+
"vscode": {
10+
// Set *default* container specific settings.json values on container create.
11+
"settings": {},
12+
// Add the IDs of extensions you want installed when the container is created.
13+
"extensions": [
14+
"ms-vscode.cpptools",
15+
"ms-vscode.cpptools-extension-pack",
16+
"foxundermoon.shell-format",
17+
"redhat.vscode-yaml",
18+
"ms-azuretools.vscode-docker",
19+
"ms-vscode.cmake-tools",
20+
"josetr.cmake-language-support-vscode",
21+
"cheshirekow.cmake-format",
22+
"EditorConfig.EditorConfig",
23+
"cschlosser.doxdocgen",
24+
"codezombiech.gitignore",
25+
"SonarSource.sonarlint-vscode",
26+
"GitHub.copilot",
27+
"DrBlury.protobuf-vsc",
28+
"llvm-vs-code-extensions.vscode-clangd",
29+
"cduruk.thrift",
30+
"eamodio.gitlens"
31+
]
32+
}
33+
},
34+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
35+
// "forwardPorts": [],
36+
// Use 'postCreateCommand' to run commands after the container is created.
37+
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh",
38+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
39+
// "remoteUser": "dev"
40+
// leave the containers running when VS Code closes
41+
"shutdownAction": "none"
42+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"cluster": [
3+
{
4+
"fe": 1,
5+
"be": 1
6+
},
7+
{
8+
"fe": 1,
9+
"be": 3
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)