Skip to content

Commit 442ab95

Browse files
author
bingtao.yin
committed
update
1 parent bcd0e2b commit 442ab95

File tree

9 files changed

+87
-348
lines changed

9 files changed

+87
-348
lines changed

.devcontainer/.env

Whitespace-only changes.

.devcontainer/Dockerfile

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,48 @@ ARG http_proxy
44
ARG https_proxy
55

66
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV http_proxy=${http_proxy}
8+
ENV https_proxy=${https_proxy}
79
ENV HTTP_PROXY=${http_proxy}
810
ENV HTTPS_PROXY=${https_proxy}
9-
11+
ENV ALL_PROXY=${http_proxy}
12+
ENV DORIS_BUILD_PYTHON_VERSION=python3
13+
ENV DORIS_TOOLCHAIN=gcc
14+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
15+
ENV PATH=${JAVA_HOME}/bin:${PATH}
16+
17+
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
1018
RUN \
11-
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
1219
echo 'Acquire::ForceIPv4 "true";' >> /etc/apt/apt.conf.d/1000-force-ipv4-transport && \
20+
echo 'Acquire::Retries "100";' >> /etc/apt/apt.conf.d/80-retries && \
1321
apt-get update -y && \
1422
# basics
15-
PKGS="software-properties-common vim sudo locales git curl unzip wget zip locales iputils-ping" && \
23+
PKGS="software-properties-common" && \
24+
apt-get install -y ${PKGS} && \
25+
add-apt-repository -y ppa:ubuntu-toolchain-r/ppa && \
26+
apt-get update -y && \
27+
PKGS="vim sudo locales git curl unzip wget zip iputils-ping iproute2" && \
28+
PKGS="${PKGS} gdb net-tools telnet ccache" && \
1629
apt-get install -y ${PKGS} && \
1730
locale-gen en_US.UTF-8 && \
1831
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/timezone && \
19-
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
32+
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
33+
# doris build deps
34+
PKGS="openjdk-17-jdk build-essential maven pkg-config cmake byacc flex automake libtool-bin bison binutils-dev libiberty-dev zip unzip libncurses5-dev curl git ninja-build python3" && \
35+
PKGS="${PKGS} libsasl2-dev gcc-10 g++-10 autoconf automake libtool autopoint comerr-dev" && \
36+
PKGS="${PKGS} libkrb5-dev" && \
37+
apt-get install -y ${PKGS} && \
38+
apt-get autoclean && apt-get autoremove && \
39+
rm -rf /var/lib/apt/lists/*
2040

2141
ENV LC_ALL="en_US.UTF-8"
2242
ENV LANG="en_US.UTF-8"
2343

2444
RUN \
25-
apt install -y openjdk-17-jdk && \
26-
apt install -y build-essential maven cmake byacc flex automake libtool-bin bison binutils-dev libiberty-dev zip unzip libncurses5-dev curl git ninja-build python3 && \
27-
apt install -y software-properties-common && \
28-
add-apt-repository -y ppa:ubuntu-toolchain-r/ppa && \
29-
apt update -y && \
30-
apt install -y gcc-10 g++-10 && \
31-
apt install -y autoconf automake libtool autopoint && \
32-
apt-get autoclean && apt-get autoremove && \
33-
rm -rf /var/lib/apt/lists/*
45+
# proxy for wget
46+
echo "use_proxy = on" >> /root/.wgetrc && \
47+
echo "http_proxy = ${http_proxy}" >> /root/.wgetrc && \
48+
echo "https_proxy = ${https_proxy}" >> /root/.wgetrc
49+
50+
WORKDIR /opt/transwarp/doris
3451

.devcontainer/build.sh

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22

33
common_build_args="
44
--network=host
5-
--build-arg http_proxy=http://172.16.80.252:3128
6-
--build-arg https_proxy=http://172.16.80.252:3128
5+
--build-arg http_proxy=http://127.0.0.1:18080
6+
--build-arg https_proxy=http://127.0.0.1:18080
7+
"
8+
9+
# common_build_args="
10+
# --network=host
11+
# --build-arg http_proxy=http://172.16.238.185:58591
12+
# --build-arg https_proxy=http://172.16.238.185:58591
13+
# "
14+
15+
common_runtime_args="
16+
--network=host
717
"
818

919
function image_suffix {
1020
commit=$(git rev-parse --short HEAD)
1121
current_date=$(date +%Y%m%d)
1222

13-
# echo "${current_date}_${commit}"
14-
echo "${current_date}"
23+
echo "${current_date}_${commit}"
1524

1625
unset commit
1726
unset current_date
@@ -35,4 +44,20 @@ function build_dev_image {
3544
unset build_args
3645
}
3746

47+
# run this under project root directory
48+
function build_runtime_image {
49+
tag=$(image_suffix)
50+
51+
build_args="
52+
${common_runtime_args}
53+
"
3854

55+
docker build \
56+
${build_args} \
57+
-t doris_runtime:${tag} \
58+
-f .devcontainer/Dockerfile \
59+
.devcontainer/
60+
61+
unset tag
62+
unset build_args
63+
}

.devcontainer/devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
33
{
44
"name": "doris dev",
5-
"image": "doris_build:latest",
5+
"image": "doris_build:20250707_70ee521660",
66
"runArgs": [
7+
"--network=host",
78
"--privileged",
89
"--cap-add=SYS_PTRACE",
910
"--security-opt",
10-
"seccomp=unconfined"
11+
"seccomp=unconfined",
12+
"--env-file",".devcontainer/.env"
1113
],
1214
"mounts": [
1315
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
14-
"source=/home/ybtsdst/.m2,target=/root/.m2,type=bind"
16+
"source=${localEnv:LOCAL_MVN_REPO},target=/root/.m2,type=bind",
17+
"source=${localEnv:LOCAL_CCACHE},target=/opt/ccache,type=bind"
1518
],
1619
"workspaceMount": "source=${localWorkspaceFolder},target=/opt/transwarp/doris,type=bind,consistency=cached",
1720
"workspaceFolder": "/opt/transwarp/doris",

.devcontainer/postCreateCommand.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function create_user {
2727
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
2828

2929
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
30-
dnf install -y sudo
30+
apt install -y sudo
3131
echo $USERNAME ALL=\(root\) NOPASSWD:ALL >/etc/sudoers.d/$USERNAME
3232
chmod 0440 /etc/sudoers.d/$USERNAME
3333
}
@@ -48,21 +48,20 @@ function main {
4848
# need to reload vscode to enable cmake language server
4949

5050
# install_by_script
51-
install_by_dnf
51+
# install_by_dnf
5252

5353
# install other deps
54-
dnf install -y gdb net-tools telnet ccache
55-
dnf clean all
5654

5755
install_clangd
5856

5957
mkdir -p /root/.ccache
6058
echo "max_size = 20.0G" >>/root/.ccache/ccache.conf
59+
echo "cache_dir = /opt/ccache" >> /root/.ccache/ccache.conf
6160

6261
create_user
6362

64-
echo "unset http_proxy" >>/root/.bashrc
65-
echo "unset https_proxy" >>/root/.bashrc
63+
# echo "unset http_proxy" >>/root/.bashrc
64+
# echo "unset https_proxy" >>/root/.bashrc
6665
echo 'export PATH=/usr/local/lib/clangd/bin/:$PATH' >>/root/.bashrc
6766

6867
# enable coredump
@@ -72,7 +71,7 @@ function main {
7271
# replace container settings.json with our project settings.json
7372
pushd /root/.vscode-server/data/Machine
7473
rm -rf settings.json
75-
ln -s /opt/transwarp/shiva/.devcontainer/settings.json settings.json
74+
ln -s /opt/transwarp/doris/.devcontainer/settings.json settings.json
7675
popd
7776
}
7877

.devcontainer/pre-commit

Lines changed: 0 additions & 25 deletions
This file was deleted.

.devcontainer/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable",
3-
"sonarlint.pathToCompileCommands": "/opt/transwarp/shiva/build/compile_commands.json",
4-
"sonarlint.testFilePattern": "{/build/shiva/thirdparty/installed/include/**, /usr/include/**, /opt/transwarp/shiva/include/shiva/**}",
3+
"sonarlint.pathToCompileCommands": "/opt/transwarp/doris/be/build_Release/compile_commands.json",
4+
"sonarlint.testFilePattern": "{/opt/transwarp/doris/thirdparty/installed/include/**, /usr/include/**}",
55
"cmake.generator": "Unix Makefiles",
66
"editor.quickSuggestions": {
77
"other": "on",
@@ -33,12 +33,12 @@
3333
"--query-driver=/usr/bin/gcc",
3434
"--suggest-missing-includes",
3535
"--cross-file-rename",
36-
"--compile-commands-dir=/opt/transwarp/shiva/build",
36+
"--compile-commands-dir=/opt/transwarp/doris/be/build_Debug",
3737
"--completion-style=detailed",
38-
"-j=4",
38+
"-j=40",
3939
"--all-scopes-completion",
4040
// "--limit-references=100",
4141
// "--limit-results=20",
4242
"--malloc-trim"
4343
],
44-
}
44+
}

0 commit comments

Comments
 (0)