Skip to content

Commit

Permalink
feat: add Ubuntu 22.04 base image
Browse files Browse the repository at this point in the history
Ubuntu 22.04 will be using GCC 11 / LLVM 15, Ubuntu 20.04 are using GCC
9 / LLVM 12. The source code of PostgreSQL is updated to adapt LLVM up
to 15.
  • Loading branch information
mrdrivingduck committed Oct 22, 2023
1 parent accd011 commit c27272b
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
base_image: [ centos7 ]
base_image: [ centos7, ubuntu22.04 ]
steps:
# Checkout source code
-
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile-devel-centos7
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ RUN cd /usr/local && \
# add software repository of Node.js LTS
# @see https://github.com/nodesource/distributions
# use yarn for documentation development
RUN curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
yum install -y yarn && \
yum clean all
# RUN curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \
# curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
# yum install -y yarn && \
# yum clean all

# create default user
ENV USER_NAME=postgres
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile-devel-ubuntu20.04
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ RUN apt update -y && \
apt upgrade -y && \
apt clean -y

# GCC (force to 9) and LLVM (force to 11)
# GCC (force to 9) and LLVM (force to 12)
RUN apt install -y \
gcc-9 \
g++-9 \
llvm-11-dev \
clang-11 \
llvm-12-dev \
clang-12 \
make \
gdb \
pkg-config \
Expand All @@ -25,9 +25,9 @@ RUN apt install -y \
/usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave \
/usr/bin/g++ g++ /usr/bin/g++-9 && \
update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-11 60 --slave \
/usr/bin/clang++ clang++ /usr/bin/clang++-11 --slave \
/usr/bin/clang clang /usr/bin/clang-11 && \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-12 60 --slave \
/usr/bin/clang++ clang++ /usr/bin/clang++-12 --slave \
/usr/bin/clang clang /usr/bin/clang-12 && \
apt clean -y

# Generate locale
Expand Down Expand Up @@ -116,10 +116,10 @@ RUN cd /usr/local && \
# add software repository of Node.js LTS
# @see https://github.com/nodesource/distributions
# use yarn for documentation development
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt install -y nodejs && \
apt clean -y && \
corepack enable && corepack prepare yarn@stable --activate
# RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
# apt install -y nodejs && \
# apt clean -y && \
# corepack enable && corepack prepare yarn@stable --activate

# create default user
ENV USER_NAME=postgres
Expand Down
143 changes: 143 additions & 0 deletions Dockerfile-devel-ubuntu22.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
FROM ubuntu:22.04
LABEL maintainer="[email protected]"
CMD bash

# Timezone problem
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Upgrade softwares
RUN apt update -y && \
apt upgrade -y && \
apt clean -y

# GCC (force to 11) and LLVM (force to 15)
RUN apt install -y \
gcc-11 \
g++-11 \
llvm-15-dev \
clang-15 \
make \
gdb \
pkg-config \
locales && \
update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-11 60 --slave \
/usr/bin/g++ g++ /usr/bin/g++-11 && \
update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-15 60 --slave \
/usr/bin/clang++ clang++ /usr/bin/clang++-15 --slave \
/usr/bin/clang clang /usr/bin/clang-15 && \
apt clean -y
# Generate locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
sed -i '/zh_CN.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen

# Dependencies
RUN apt install -y \
libicu-dev \
bison \
flex \
python3-dev \
libreadline-dev \
libgss-dev \
libssl-dev \
libpam0g-dev \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
uuid-dev \
liblz4-dev \
libkrb5-dev \
gettext \
libxerces-c-dev \
tcl-dev \
libperl-dev \
libipc-run-perl \
libaio-dev \
libfuse-dev && \
apt clean -y

# Tools
RUN apt install -y \
iproute2 \
wget \
ccache \
sudo \
vim \
git \
cmake && \
apt clean -y

# PostGIS
RUN apt install -y \
libgeos-dev \
libproj-dev \
libgdal-dev \
libprotobuf-c-dev \
protobuf-compiler \
protobuf-c-compiler && \
apt clean -y

# set to empty if GitHub is not barriered
# ENV GITHUB_PROXY=https://ghproxy.com/
ENV GITHUB_PROXY=

ENV ZLOG_VERSION=1.2.14
ENV PFSD_VERSION=pfsd4pg-release-1.2.42-20220419

# install dependencies from GitHub mirror
RUN cd /usr/local && \
# zlog for PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/HardySimpson/zlog/archive/refs/tags/${ZLOG_VERSION}.tar.gz" && \
# PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/ApsaraDB/PolarDB-FileSystem/archive/refs/tags/${PFSD_VERSION}.tar.gz" && \
# unzip and install zlog
gzip -d $ZLOG_VERSION.tar.gz && \
tar xpf $ZLOG_VERSION.tar && \
cd zlog-$ZLOG_VERSION && \
make && make install && \
echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig && \
cd .. && \
rm -rf $ZLOG_VERSION* && \
rm -rf zlog-$ZLOG_VERSION && \
# unzip and install PFSD
gzip -d $PFSD_VERSION.tar.gz && \
tar xpf $PFSD_VERSION.tar && \
cd PolarDB-FileSystem-$PFSD_VERSION && \
sed -i 's/-march=native //' CMakeLists.txt && \
./autobuild.sh && ./install.sh && \
cd .. && \
rm -rf $PFSD_VERSION* && \
rm -rf PolarDB-FileSystem-$PFSD_VERSION*

# add software repository of Node.js LTS
# @see https://github.com/nodesource/distributions
# use yarn for documentation development
# RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
# apt install -y nodejs && \
# apt clean -y && \
# corepack enable && corepack prepare yarn@stable --activate

# create default user
ENV USER_NAME=postgres
RUN echo "create default user" && \
groupadd -r $USER_NAME && \
useradd -ms /bin/bash -g $USER_NAME $USER_NAME -p '' && \
usermod -aG sudo $USER_NAME

# modify conf
RUN echo "modify conf" && \
mkdir -p /var/log/pfs && chown $USER_NAME /var/log/pfs && \
mkdir -p /var/run/pfs && chown $USER_NAME /var/run/pfs && \
mkdir -p /var/run/pfsd && chown $USER_NAME /var/run/pfsd && \
mkdir -p /dev/shm/pfsd && chown $USER_NAME /dev/shm/pfsd && \
touch /var/run/pfsd/.pfsd && \
echo "ulimit -c unlimited" >> /home/postgres/.bashrc && \
echo "export PGHOST=127.0.0.1" >> /home/postgres/.bashrc && \
echo "alias pg='psql -h /home/postgres/tmp_master_dir_polardb_pg_1100_bld/'" >> /home/postgres/.bashrc

ENV PATH="/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin:$PATH"
WORKDIR /home/$USER_NAME
USER $USER_NAME
2 changes: 1 addition & 1 deletion PolarDB-for-PostgreSQL
Submodule PolarDB-for-PostgreSQL updated 50 files
+300 −0 configure
+29 −0 configure.in
+1 −1 doc/src/sgml/parallel.sgml
+1 −1 doc/src/sgml/ref/alter_table.sgml
+3 −3 doc/src/sgml/sources.sgml
+6 −18 docs/.vuepress/configs/navbar/zh.ts
+27 −4 docs/.vuepress/configs/sidebar/zh.ts
+2 −0 docs/.vuepress/styles/index.scss
+2 −2 docs/zh/README.md
+122 −0 docs/zh/features/README.md
+2 −2 docs/zh/features/v11/README.md
+1 −0 docs/zh/features/v11/availability/README.md
+146 −0 docs/zh/features/v11/availability/avail-parallel-replay.md
+10 −0 docs/zh/features/v11/epq/README.md
+8 −8 docs/zh/features/v11/epq/adaptive-scan.md
+124 −0 docs/zh/features/v11/epq/cluster-info.md
+81 −0 docs/zh/features/v11/epq/epq-create-btree-index.md
+53 −0 docs/zh/features/v11/epq/epq-ctas-mtview-bulk-insert.md
+71 −0 docs/zh/features/v11/epq/epq-explain-analyze.md
+142 −0 docs/zh/features/v11/epq/epq-node-and-dop.md
+227 −0 docs/zh/features/v11/epq/epq-partitioned-table.md
+99 −0 docs/zh/features/v11/epq/parallel-dml.md
+0 −5 docs/zh/features/v11/htap/README.md
+0 −117 docs/zh/features/v11/htap/multi-level-partition.md
+0 −362 docs/zh/features/v11/htap/parallel-dml.md
+ docs/zh/imgs/cluster_info_generate.png
+ docs/zh/imgs/pr_parallel_execute_1.png
+ docs/zh/imgs/pr_parallel_execute_2.png
+ docs/zh/imgs/pr_parallel_execute_dispatcher.png
+ docs/zh/imgs/pr_parallel_execute_procs_1.png
+ docs/zh/imgs/pr_parallel_execute_procs_2.png
+ docs/zh/imgs/pr_parallel_execute_procs_3.png
+ docs/zh/imgs/pr_parallel_execute_task.png
+ docs/zh/imgs/pr_parallel_replay_1.png
+ docs/zh/imgs/pr_parallel_replay_2.png
+1 −1 src/backend/access/common/bufmask.c
+7 −7 src/backend/jit/README
+6 −0 src/backend/jit/llvm/Makefile
+452 −98 src/backend/jit/llvm/llvmjit.c
+40 −5 src/backend/jit/llvm/llvmjit_error.cpp
+1 −3 src/backend/jit/llvm/llvmjit_expr.c
+23 −1 src/backend/jit/llvm/llvmjit_inline.cpp
+32 −0 src/backend/jit/llvm/llvmjit_wrap.cpp
+1 −1 src/backend/optimizer/util/tlist.c
+4 −5 src/bin/pg_upgrade/info.c
+3 −0 src/include/jit/llvmjit.h
+1 −1 src/include/jit/llvmjit_emit.h
+1 −1 src/test/regress/expected/expressions.out
+1 −1 src/test/regress/sql/expressions.sql
+1 −0 src/tools/pgindent/typedefs.list

0 comments on commit c27272b

Please sign in to comment.