diff --git a/.gitignore b/.gitignore
index 32dd9963dc1..a2799fefbe1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,7 +58,7 @@ GRTAGS
GTAGS
lib*dll.def
lib*.pc
-
+.idea
# Local excludes in root directory
/GNUmakefile
/config.cache
diff --git a/deploy/README.md b/deploy/README.md
index 1ac8e42419d..0a7b1dea914 100644
--- a/deploy/README.md
+++ b/deploy/README.md
@@ -1,7 +1,7 @@
### Cloudberry Automation Build and Deployment
#### Download the Cloudberry project source code into your working directory
-git clone git@code.hashdata.xyz:cloudberry/cbdb.git
+git clone git@github.com:cloudberrydb/cloudberrydb.git
#### Enter the directory under workspace/cbdb, developer can deploy the automation build & test environment with vagrant virtual machine or docker container, vagrant and docker tool is required to be installed in your local environment before running the script.
@@ -82,92 +82,3 @@ The build & test environment of cbdb project relies on many systemconfigurations
* Ensure that the login user is gpadmin
-
-
-
-### Cloudberry自动编译部署流程
-
-#### 在工作目录下载cloudberry的代码
-
-git clone git@code.hashdata.xyz:cloudberry/cbdb.git
-
-#### 进入workspace/cbdb目录下的deploy目录, 可以通过vagrant虚拟机或者docker容器方式部署编译测试环境。
-
-##### 1.通过vagrant虚拟机方式部署编译测试环境
-
-##### 启动vagrant虚拟机
-cd ~/workspace/cbdb/deploy/vagrant
-vagrant up
-
-##### 待虚拟机启动并自动编译部署完成后,进入虚机
-vagrant ssh
-psql postgres
-
-##### regression测试
-cd ~/workspace/cbdb_dev
-make installcheck-good
-
-
-##### 2.通过docker容器方式部署编译测试环境
-
-##### docker仓库配置
-在docker工具中配置公司二进制代码库地址, 通过Docker工具中Preferences->Docker Engine中增加下列JSON格式的配置项目。
-"insecure-registries": [
- "docker.artifactory.hashdata.xyz"
-]
-
-##### 启动docker容器
-cd ~/workspace/cbdb/deploy/docker
-bash docker_start.sh
-
-##### 待虚拟机启动并自动编译部署完成后,进入Container, 其中ContainerId可以通过docker ps -a命令查看。
-docker exec -it [ContainerId] /bin/bash
-psql postgres
-
-##### regression测试
-cd ~/workspace/cbdb_dev
-make installcheck-good
-
-
-
-
-### 脚本介绍
-
-cbdb项目的构建和测试环境依赖于很多系统配置和第三方依赖,因此手动部署过程非常繁琐且容易出错。为此,利用vagrant或docker等虚拟化技术引入了cbdb自动化部署编译测试环境,可用于简化用户部署cbdb编译测试环境的工作量和时间成本,让cbdb 开发人员可以更加专注于他们的业务代码开发工作。 cbdb项目支持两种自动化部署方式:第一种是用vagrant部署vbox虚拟机,另一种是用docker部署容器镜像。开发者可以根据自己的需求选择自动化部署的方式。整个自动化部署构建和测试流程都运行在由vagrant或docker管理的虚拟化环境中。通过共享文件机制,宿主机的cbdb代码库被映射到虚拟化环境中的指定路径中,并进行cbdb自动化构建测试。
-
-#### 整个脚本分为三个组成部分:
-
-#### 1.在虚拟化环境中运行的自动化部署脚本
-##### 通过vagrant Vagrantfile中provision或者docker Dockerfile中的ENTRYPOINT提供的机制
- * 提供操作编译环境的子命令务
- * 向虚拟机内部脚本提供必要的配置变量并执行具体操作
-##### 通过/code/depoly/cbdb_deploy.sh 文件,传递以下编译选项:
- * 编译选项
- * 部署选项
- * 测试选项
-##### 通过/code/depoly/cbdb_env.sh 文件,传递自动化编译测试所需的环境变量参数。
-
-#### 2.vagrant部署脚本
-##### Vagrantfile
- * vagrant虚拟机box远程下载并创建
- * 宿主机cbdb代码路径挂载到虚拟机中的指定路径并配置为只读权限,例如:源代码到/home/gpadmin/workspace/cbdb目录
- * 拷贝源文件目录至/home/gpadmin/workspace/cbdb_dev为实际工作目录
- * 保证登陆用户为gpadmin
-##### vagrant_release.sh
- * 脚本用于支持自动打包vagrant box镜像文件。
-
-
-#### 3.docker部署脚本
-##### Dockerfile
- * docker镜像文件打包
- * 镜像容器服务启动,例如ssh服务
-##### docker_deploy,sh
- * 生成ssh公共密钥并配置自动登录
- * 启动docker自动部署
-##### docker_start.sh
- * 远程下载docker镜像版本
- * 宿主机cbdb代码路径挂载到虚拟机中的指定路径并配置为只读权限,例如:源代码到/home/gpadmin/workspace/cbdb目录
- * 拷贝源文件目录至/home/gpadmin/workspace/cbdb_dev为实际工作目录、
- * 保证登陆用户为gpadmin
-
-
diff --git a/hd-ci/dev/clean_env.bash b/hd-ci/dev/clean_env.bash
index 4a0a259dbf4..7b1f88b2576 100755
--- a/hd-ci/dev/clean_env.bash
+++ b/hd-ci/dev/clean_env.bash
@@ -2,7 +2,7 @@
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source "${BASE_DIR}/../common.bash"
-# internal usage: 目前只是用于本地环境的快速清理, 没有用在pipeline中
+# internal usage: Currently, it is only used for rapid cleaning of the local environment and is not used in the pipeline
# Usage: /code/gpdb_src/hd-ci/dev/clean-env.bash
main() {
killall postgres
diff --git a/hd-ci/dev/env.bash b/hd-ci/dev/env.bash
index fefe74ed191..e5acccfdbe9 100755
--- a/hd-ci/dev/env.bash
+++ b/hd-ci/dev/env.bash
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# internal usage: 目前只是用于本地环境快速设置cbdb环境变量, 没有用在pipeline中
+# internal usage: Currently, it is only used for rapid cleaning of the local environment and is not used in the pipeline
# Usage: source /code/gpdb_src/hd-ci/dev/env.bash
source /usr/local/cloudberry-db-devel/greenplum_path.sh
source /code/gpdb_src/gpAux/gpdemo/gpdemo-env.sh
diff --git a/hd-ci/dev/prepare_env.bash b/hd-ci/dev/prepare_env.bash
index 6cd40fecd52..3f2deb07e8c 100755
--- a/hd-ci/dev/prepare_env.bash
+++ b/hd-ci/dev/prepare_env.bash
@@ -4,7 +4,7 @@ set -exo pipefail
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source "${BASE_DIR}/../common.bash"
-# internal usage: 目前只是用于本地环境的快速搭建, 没有用在pipeline中
+# internal usage: Currently, it is only used for rapid cleaning of the local environment and is not used in the pipeline
# Usage: /code/gpdb_src/hd-ci/dev/prepare-env.bash
download_demo_cbdb_tar_gz() {
if [[ ! -f "${ROOT_PATH}/bin_gpdb/bin_gpdb.tar.gz" ]]; then
diff --git a/readmes/README.Linux.md b/readmes/README.Linux.md
index 32dbddeedd5..c49dbc62ef6 100644
--- a/readmes/README.Linux.md
+++ b/readmes/README.Linux.md
@@ -1,108 +1,173 @@
-## For CentOS:
+# Set up development environment for Cloudberry Database on Linux
-- Install Dependencies
+This document shares how to set up the development environments on different Linux systems (CentOS 7, RHEL, and Ubuntu). Before you start to [explore the Cloudberry Database](https://github.com/cloudberrydb/cloudberrydb/tree/main/readmes), follow this document to download and install the required tools and dependencies, and create demo user.
- ```bash
- ./README.CentOS.bash
- ```
+Take the following steps to set up the development environments:
-- If you want to link cmake3 to cmake, run:
+1. [Clone GitHub repo](#step-1-clone-github-repo).
+2. [Install dependencies](#step-2-install-dependencies).
+3. [Perform prerequisite platform tasks](#step-3-prerequisite-platform-tasks).
- ```bash
- sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
- ```
+## Step 1. Clone GitHub repo
-- Make sure that you add `/usr/local/lib` and `/usr/local/lib64` to
-`/etc/ld.so.conf`, then run command `ldconfig`.
+Clone the GitHub repository `cloudberrydb/cloudberrydb` to the target machine using `git clone git@github.com:cloudberrydb/cloudberrydb.git`.
-- If you want to install and use gcc-7 by default, run:
+## Step 2. Install dependencies
- ```bash
- sudo yum install -y centos-release-scl
- sudo yum install -y devtoolset-7-toolchain
- echo 'source scl_source enable devtoolset-7' >> ~/.bashrc
- ```
+Install dependencies according to your operating systems:
-## For RHEL:
+- [For CentOS 7](#for-centos-7)
+- [For RHEL 7 and 8](#for-rhel-7-and-8)
+- [For Ubuntu 18.04 or later](#for-ubuntu-1804-or-later)
-- Install Development Tools.
- - For RHEL 8: Install `Development Tools`:
+### For CentOS 7
+
+The following dependencies work on CentOS 7. For other CentOS versions, these steps might work but are not guaranteed to work.
+
+1. Run the Bash script `README.CentOS.bash` in the `readmes` directory of the `cloudberrydb/cloudberrydb` repository. To run this script, password is required. Then, some required dependencies will be automatically downloaded.
```bash
- sudo yum group install -y "Development Tools"
+ ./README.CentOS.bash
```
- - For RHEL versions (< 8.0): Install `devtoolset-7`:
+2. Update the GNU Compiler Collection (GCC) to version `devtoolset-10` to support C++ 14.
```bash
- sudo yum-config-manager --enable rhui-REGION-rhel-server-rhscl
- sudo yum install -y devtoolset-7-toolchain
+ yum install centos-release-scl
+ yum -y install devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-binutils
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
```
-
-- Install dependencies using README.CentOS.bash script.
- - For RHEL 8: Execute additional step before running README.CentOS.bash script.
-
- Note: Make sure installation of `Development Tools` includes `git` and `make` else install these tools manually.
+
+3. Install additional packages required for some configurations.
```bash
- sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
+ yum -y install R apr apr-devel apr-util automake autoconf bash bison bison-devel bzip2 bzip2-devel centos-release-scl curl flex flex-devel gcc gcc-c++ git gdb ibxml2 iproute krb5 krb5-devel less libcurl libcurl-devel libevent libevent-devel libxml2 libxml2-devel libyaml libzstd-devel libzstd.x86_64 make openldap openssh-client openssl openssl-devel openssl-libs perl python3-devel readline readline-devel rsync sed sudo tar vim wget which xerces-c-devel zip zip-devel zlib && \
+ yum -y install epel-release.noarch && \
+ yum -y install libzstd
```
- - Install dependencies using README.CentOS.bash script.
+4. Link cmake3 to cmake:
```bash
- ./README.CentOS.bash
+ sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
+ ```
+
+### For RHEL 7 and 8
+
+1. Install Development Tools.
+
+ - For RHEL 8: Install:
+
+ ```bash
+ sudo yum group install -y "Development Tools"
+ ```
+
+ - For RHEL versions (< 8.0):
+
+ ```bash
+ sudo yum-config-manager --enable rhui-REGION-rhel-server-rhscl
+ sudo yum install -y devtoolset-7-toolchain
+ ```
+
+2. Install dependencies by running the `README.CentOS.bash` script.
+
+ - For RHEL 8:
+
+ ```bash
+ # First install the epel extension for RHEL 8.
+ # This makes sure that git and make is installed.
+ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
+
+ # Then run the README.CentOS.bash script in the `readmes` directory.
+ ./README.CentOS.bash
+ ```
+
+ - For RHEL 7:
+
+ ```bash
+ # First install the epel extension for RHEL 7.
+ # This makes sure that git and make is installed.
+ sudo yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
+
+ # Then run the README.CentOS.bash script in the `readmes` directory.
+ ./README.CentOS.bash
+ ```
+
+### For Ubuntu 18.04 or later
+
+1. Install dependencies by running the `README.Ubuntu.bash` script in the `readmes` directory.
+
+ ```shell
+ ## You need to enter your password to run
+ sudo ./README.Ubuntu.bash
```
-## For Ubuntu:
+ > **Note:**
+ >
+ > - When you run the `README.Ubuntu.bash` script for dependencies, you will be asked to configure `realm` for kerberos. You can enter any realm, because this is just for testing, and during testing, it will reconfigure a local server/client. If you want to skip this manual configuration, run `export DEBIAN_FRONTEND=noninteractive`.
+ > - If you fail to download packages, we recommend that you can try another one software source for Ubuntu.
-- Install Dependencies
- When you run the README.Ubuntu.bash script for dependencies, you will be asked to configure realm for kerberos.
- You can enter any realm, since this is just for testing, and during testing, it will reconfigure a local server/client.
- If you want to skip this manual configuration, use:
- `export DEBIAN_FRONTEND=noninteractive`
+2. Install GCC 10. Ubuntu 18.04 and later versions should use GCC 10 or newer:
- ```bash
- sudo ./README.Ubuntu.bash
- ```
+ ```bash
+ ## Install gcc-10
+ sudo apt install software-properties-common
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
+ sudo apt install gcc-10 g++-10
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
+ ```
-- Ubuntu 18.04 and newer should have use gcc 7 or newer, but you can also enable gcc-7 on older versions of Ubuntu:
+## Step 3. Perform prerequisite platform tasks
- ```bash
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update
- sudo apt-get install -y gcc-7 g++-7
- ```
+After you have installed all the dependencies for your operating system, it is time to do some prerequisite platform tasks before you go on building Cloudberry Database. These operation include manually running `ldconfig` on all platforms, creating the `gpadmin` user, and setting up a password to start the Cloudberry Database and test.
-## Common Platform Tasks:
+1. Make sure that you add `/usr/local/lib` and `/usr/local/lib64` to the `/etc/ld.so.conf` file.
-Make sure that you add `/usr/local/lib` to `/etc/ld.so.conf`,
-then run command `ldconfig`.
-1. Create gpadmin and setup ssh keys
- Either use:
+ ```bash
+ $ vi /etc/ld.so.conf
+
+ ## Add the following two lines to /etc/ld.so.conf
+ /usr/local/lib
+ /usr/local/lib64
+ ```
- ```bash
- # Requires cbdb clone to be named cbdb_src
- cbdb_src/concourse/scripts/setup_gpadmin_user.bash
- ```
- to create the gpadmin user and set up keys,
+ Then run the `ldconfig` command.
- OR
+2. Create the `gpadmin` user and set up the SSH key.
- manually create ssh keys so you can do ssh localhost without a password, e.g.,
-
- ```
- ssh-keygen
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- ```
+ Manually create SSH keys based on different operating systems, so that you can run `ssh localhost` without a password.
-1. Verify that you can ssh to your machine name without a password.
+ ```bash
+ ### For CentOS 7
+ useradd gpadmin # Creates gpadmin user.
+ chown -R gpadmin:gpadmin /cloudberrydb/
+ su - gpadmin # Uses the gpadmin user.
+ ssh-keygen # Creates SSH key.
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ ```
- ```bash
- ssh # e.g., ssh briarwood (You can use `hostname` to get the hostname of your machine.)
- ```
+ ```bash
+ ### For Ubuntu
+ useradd -r -m -s /bin/bash gpadmin # Creates gpadmin user.
+ chown -R gpadmin:gpadmin /cloudberrydb/
+ su - gpadmin # Uses the gpadmin user.
+ ssh-keygen # Creates SSH key.
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ ```
+
+3. Verify that you can use SSH to connect to your machine without a password.
+
+ ```bash
+ ssh gpadmin@localhost
+ ```
-1. Set up your system configuration by following the installation guide on [docs.cloudberrydb.org](https://cloudberrydb.org/docs/cbdb-overview)
+ or
+ ```bash
+ ssh # e.g., ssh briarwood (You can use `hostname` to get the hostname of your machine.)
+ ```
+4. Set up your system configuration by following the installation guide on [README.md](https://github.com/cloudberrydb/cloudberrydb/tree/main/readmes).
diff --git a/readmes/README.md b/readmes/README.md
index a59af759b2c..a0ea25ef296 100644
--- a/readmes/README.md
+++ b/readmes/README.md
@@ -3,7 +3,7 @@ Greenplum Database READE.md here. Thanks all the original writers.-->
This guide shows how to build Cloudberry Database with GPORCA.
-## Building Cloudberry Database with GPORCA
+# Building Cloudberry Database with GPORCA
GPORCA is a cost-based optimizer which is used by Greenplum
Database/Cloudberry Database in conjunction with the PostgreSQL
@@ -11,7 +11,7 @@ planner. It is also known as just ORCA, and Pivotal Optimizer. The
code for GPORCA resides src/backend/gporca. It is built automatically
by default.
-### Installing dependencies
+## Installing dependencies
Please follow these steps for your OS to get your system ready.
@@ -19,7 +19,7 @@ Please follow these steps for your OS to get your system ready.
- for Linux developers: Follow [appropriate Linux
steps](README.Linux.md) including CentOS, RHEL, Ubuntu
-### Build the database
+## Build the database
```
# Configure build environment to install at /usr/local/cloudberrydb
@@ -38,25 +38,25 @@ make create-demo-cluster
source gpAux/gpdemo/gpdemo-env.sh
```
-The directory and the TCP ports for the demo cluster can be changed on the fly.
+- The directory and the TCP ports for the demo cluster can be changed on the fly.
Instead of `make cluster`, consider:
```
DATADIRS=/tmp/cbdb-cluster PORT_BASE=5555 make cluster
```
-The TCP port for the regression test can be changed on the fly:
+- The TCP port for the regression test can be changed on the fly:
```
PGPORT=5555 make installcheck-world
```
-To turn GPORCA off and use Postgres planner for query optimization:
+- To turn GPORCA off and use Postgres planner for query optimization:
```
set optimizer=off;
```
-If you want to clean all generated files
+- If you want to clean all generated files
```
make distclean
```
@@ -90,9 +90,9 @@ make installcheck-world
upstream. We try to keep the upstream tests identical to the upstream
versions, to make merging with newer PostgreSQL releases easier.
-## Alternative Configurations
+# Alternative Configurations
-### Building Cloudberry Database without GPORCA
+## Building Cloudberry Database without GPORCA
Currently, CBDB is built with GPORCA by default. If you want to build CBDB
without GPORCA, configure requires `--disable-orca` flag to be set.
@@ -105,7 +105,7 @@ make distclean
./configure --disable-orca --with-perl --with-python --with-libxml --prefix=/usr/local/cloudberrydb
```
-### Building Cloudberry Database with PXF
+## Building Cloudberry Database with PXF
PXF is an extension framework for Greenplum Database/Cloudberry
Database to enable fast access to external Hadoop datasets. Refer to
@@ -115,16 +115,16 @@ Currently, CBDB is built with PXF by default (--enable-pxf is on).
In order to build CBDB without pxf, simply invoke `./configure` with additional option `--disable-pxf`.
PXF requires curl, so `--enable-pxf` is not compatible with the `--without-libcurl` option.
-### Building Cloudberry Database with Python3 enabled
+## Building Cloudberry Database with Python3 enabled
Cloudberry Database supports Python3 with plpython3u UDF
See [how to enable Python3](../src/pl/plpython/README.md) for details.
-### Building Cloudberry Database client tools on Windows
+## Building Cloudberry Database client tools on Windows
See [Building CBDB client tools on Windows](README.Windows.md) for details.
-## Development with Vagrant
+# Development with Vagrant
There is a Vagrant-based [quickstart guide for developers](../src/tools/vagrant/README.md).
diff --git a/python-dependencies.txt b/readmes/python-dependencies.txt
similarity index 100%
rename from python-dependencies.txt
rename to readmes/python-dependencies.txt