From 95cc3b061c0b926297283f4f45ff11dc8548fb9a Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Wed, 26 Mar 2025 11:01:04 +0300 Subject: [PATCH 01/23] Fix create-cluster script --- .../gpdb/scripts/create-gpdb-demo-cluster.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index df25cf4..fc4abdf 100644 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -68,18 +68,18 @@ set -euo pipefail # Source common utilities SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "${SCRIPT_DIR}/cloudberry-utils.sh" +source "${SCRIPT_DIR}/gpdb-utils.sh" # Define log directory export LOG_DIR="${SRC_DIR}/build-logs" CLUSTER_LOG="${LOG_DIR}/cluster.log" # Initialize environment -init_environment "Cloudberry Demo Cluster Script" "${CLUSTER_LOG}" +init_environment "Greenplum Demo Cluster Script" "${CLUSTER_LOG}" "/opt/greenplum-db-6" # Setup environment log_section "Environment Setup" -source /usr/local/cloudberry-db/greenplum_path.sh || exit 1 +source /usr/local/greenplum-db/greenplum_path.sh || exit 1 log_section_end "Environment Setup" # Verify SSH access @@ -89,12 +89,12 @@ log_section_end "SSH Verification" # Create demo cluster log_section "Demo Cluster Creation" -execute_cmd make create-demo-cluster --directory ${SRC_DIR}/../cloudberry || exit 3 +execute_cmd make create-demo-cluster --directory ${SRC_DIR}/../gpdb || exit 3 log_section_end "Demo Cluster Creation" # Source demo environment log_section "Source Environment" -source ${SRC_DIR}/../cloudberry/gpAux/gpdemo/gpdemo-env.sh || exit 1 +source ${SRC_DIR}/../gpdb/gpAux/gpdemo/gpdemo-env.sh || exit 1 log_section_end "Source Environment" # Manage cluster state @@ -121,5 +121,5 @@ fi log_section_end "Installation Verification" # Log completion -log_completion "Cloudberry Demo Cluster Script" "${CLUSTER_LOG}" +log_completion "Greenplum Demo Cluster Script" "${CLUSTER_LOG}" exit 0 \ No newline at end of file From 7833da6f723394679630523dbbb3c3d05e111074 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Wed, 26 Mar 2025 17:27:13 +0300 Subject: [PATCH 02/23] Remove unused dependecies --- packaging/deb/jammy/debian/control | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packaging/deb/jammy/debian/control b/packaging/deb/jammy/debian/control index 5215fb7..c87166d 100644 --- a/packaging/deb/jammy/debian/control +++ b/packaging/deb/jammy/debian/control @@ -69,18 +69,8 @@ Depends: curl, openssl, python2.7, python2.7-dev, - python-lockfile, - python-paramiko, - python-psutil, - python-yaml, python-pip, - python-behave, - python-epydoc, - python-ldap, - python-mock, python-six, - python-parse, - python-is-python2, rsync, wget, zlib1g, From a42e5ce0fa4085f9197f928afa8b363751e5b225 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Wed, 26 Mar 2025 17:46:20 +0300 Subject: [PATCH 03/23] Update packages in build docker image --- images/docker/gpdb/build/jammy/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/docker/gpdb/build/jammy/Dockerfile b/images/docker/gpdb/build/jammy/Dockerfile index 4d6d3a1..888a682 100644 --- a/images/docker/gpdb/build/jammy/Dockerfile +++ b/images/docker/gpdb/build/jammy/Dockerfile @@ -48,6 +48,7 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install g++-11 \ g++-11-multilib \ git \ + iputils-ping \ krb5-multidev \ libapr1-dev \ libbz2-dev \ @@ -65,10 +66,12 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install libaprutil1-dev \ libpam0g-dev \ libpam0g \ + libpopt0 \ libcgroup1 \ libyaml-0-2 \ libldap-2.5-0 \ libssl3 \ + net-tools \ ninja-build \ python-setuptools \ quilt \ @@ -80,6 +83,9 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install libgpgme11 \ python2.7 \ python2.7-dev \ + python-pip \ + python-six \ + rsync \ sudo \ iproute2 \ less \ From 08d3aac32082f515b293188574825692fa4eb379 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 10:17:11 +0300 Subject: [PATCH 04/23] Fix test scripts --- .../gpdb/scripts/create-gpdb-demo-cluster.sh | 8 ++++---- .../gpdb/scripts/destroy-gpdb-demo-cluster.sh | 16 ++++++++-------- build_automation/gpdb/scripts/gpdb-utils.sh | 10 +++++----- build_automation/gpdb/scripts/test-gpdb.sh | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index fc4abdf..d70c56b 100644 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -35,16 +35,16 @@ # LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs) # # Prerequisites: -# - Apache Cloudberry must be installed (/usr/local/cloudberry-db) +# - Apache Cloudberry must be installed (/opt/greenplum-db-6) # - SSH must be configured for passwordless access to localhost # - User must have permissions to create cluster directories # - PostgreSQL client tools (psql) must be available # # Usage: # Export required variables: -# export SRC_DIR=/path/to/cloudberry/source +# export SRC_DIR=/path/to/gpdb/source # Then run: -# ./create-cloudberry-demo-cluster.sh +# ./create-gpdb-demo-cluster.sh # # Verification Checks: # - Apache Cloudberry version @@ -79,7 +79,7 @@ init_environment "Greenplum Demo Cluster Script" "${CLUSTER_LOG}" "/opt/greenplu # Setup environment log_section "Environment Setup" -source /usr/local/greenplum-db/greenplum_path.sh || exit 1 +source /opt/greenplum-db-6/greenplum_path.sh || exit 1 log_section_end "Environment Setup" # Verify SSH access diff --git a/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh index a0e1e2f..930bedf 100644 --- a/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh @@ -64,26 +64,26 @@ set -euo pipefail # Source common utilities SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "${SCRIPT_DIR}/cloudberry-utils.sh" +source "${SCRIPT_DIR}/gpdb-utils.sh" # Define log directory export LOG_DIR="${SRC_DIR}/build-logs" CLUSTER_LOG="${LOG_DIR}/destroy-cluster.log" # Initialize environment -init_environment "Destroy Cloudberry Demo Cluster Script" "${CLUSTER_LOG}" +init_environment "Destroy Greenplum Demo Cluster Script" "${CLUSTER_LOG}" -# Source Cloudberry environment +# Source Greenplum environment log_section "Environment Setup" -source_cloudberry_env || { - echo "Failed to source Cloudberry environment" | tee -a "${CLUSTER_LOG}" +source_greenplum_env || { + echo "Failed to source Greenplum environment" | tee -a "${CLUSTER_LOG}" exit 1 } log_section_end "Environment Setup" # Destroy demo cluster log_section "Destroy Demo Cluster" -execute_cmd make destroy-demo-cluster --directory ${SRC_DIR}/../cloudberry || { +execute_cmd make destroy-demo-cluster --directory ${SRC_DIR}/../gpdb || { echo "Failed to destroy demo cluster" | tee -a "${CLUSTER_LOG}" exit 2 } @@ -91,11 +91,11 @@ log_section_end "Destroy Demo Cluster" # Verify cleanup log_section "Cleanup Verification" -if [ -d "${SRC_DIR}/../cloudberry/gpAux/gpdemo/data" ]; then +if [ -d "${SRC_DIR}/../gpdb/gpAux/gpdemo/data" ]; then echo "Warning: Data directory still exists after cleanup" | tee -a "${CLUSTER_LOG}" fi log_section_end "Cleanup Verification" # Log completion -log_completion "Destroy Cloudberry Demo Cluster Script" "${CLUSTER_LOG}" +log_completion "Destroy Greenplum Demo Cluster Script" "${CLUSTER_LOG}" exit 0 \ No newline at end of file diff --git a/build_automation/gpdb/scripts/gpdb-utils.sh b/build_automation/gpdb/scripts/gpdb-utils.sh index 36c405c..6f7858f 100644 --- a/build_automation/gpdb/scripts/gpdb-utils.sh +++ b/build_automation/gpdb/scripts/gpdb-utils.sh @@ -56,11 +56,11 @@ run_psql_cmd() { return ${PIPESTATUS[0]} } -# Function to source Cloudberry environment -source_cloudberry_env() { - echo "=== Sourcing Cloudberry environment ===" | tee -a "${LOG_DIR}/environment.log" - source /usr/local/cloudberry-db/greenplum_path.sh - source ${SRC_DIR}/../cloudberry/gpAux/gpdemo/gpdemo-env.sh +# Function to source Greenplum environment +source_greenplum_env() { + echo "=== Sourcing Greenplum environment ===" | tee -a "${LOG_DIR}/environment.log" + source ${BUILD_DESTINATION}/greenplum_path.sh + source ${SRC_DIR}/../gpdb/gpAux/gpdemo/gpdemo-env.sh } # Function to log section start diff --git a/build_automation/gpdb/scripts/test-gpdb.sh b/build_automation/gpdb/scripts/test-gpdb.sh index 6604f27..c0bcf91 100644 --- a/build_automation/gpdb/scripts/test-gpdb.sh +++ b/build_automation/gpdb/scripts/test-gpdb.sh @@ -40,7 +40,7 @@ # export MAKE_DIRECTORY="/path/to/make/dir" # export MAKE_NAME="Install Check" # Then run: -# ./test-cloudberry.sh +# ./test-gpdb.sh # # Exit Codes: # 0 - All tests passed successfully @@ -53,18 +53,18 @@ set -euo pipefail # Source common utilities SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "${SCRIPT_DIR}/cloudberry-utils.sh" +source "${SCRIPT_DIR}/gpdb-utils.sh" # Define log directory and files export LOG_DIR="build-logs" TEST_LOG="${LOG_DIR}/test.log" # Initialize environment -init_environment "Cloudberry Test Script" "${TEST_LOG}" +init_environment "Greenplum Test Script" "${TEST_LOG}" -# Source Cloudberry environment +# Source Greenplum environment log_section "Environment Setup" -source_cloudberry_env || exit 1 +source_greenplum_env || exit 1 log_section_end "Environment Setup" echo "MAKE_TARGET: ${MAKE_TARGET}" @@ -77,5 +77,5 @@ execute_cmd make ${MAKE_TARGET} ${MAKE_DIRECTORY} || exit 2 log_section_end "Install Check" # Log completion -log_completion "Cloudberry Test Script" "${TEST_LOG}" +log_completion "Greenplum Test Script" "${TEST_LOG}" exit 0 \ No newline at end of file From bf3216159585e075947e619f47f6a44f292071d6 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 10:20:35 +0300 Subject: [PATCH 05/23] tmp --- build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index d70c56b..a06c7d4 100644 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -82,10 +82,10 @@ log_section "Environment Setup" source /opt/greenplum-db-6/greenplum_path.sh || exit 1 log_section_end "Environment Setup" -# Verify SSH access -log_section "SSH Verification" -execute_cmd ssh $(hostname) 'whoami; hostname' || exit 2 -log_section_end "SSH Verification" +# # Verify SSH access +# log_section "SSH Verification" +# execute_cmd ssh $(hostname) 'whoami; hostname' || exit 2 +# log_section_end "SSH Verification" # Create demo cluster log_section "Demo Cluster Creation" From 84c12c7f90e903069713595de7f18859e0d9c178 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 11:23:19 +0300 Subject: [PATCH 06/23] Fix prefix --- packaging/deb/gpdb_bionic/debian/rules | 4 ++-- packaging/deb/jammy/debian/rules | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/deb/gpdb_bionic/debian/rules b/packaging/deb/gpdb_bionic/debian/rules index 0858c61..2056836 100755 --- a/packaging/deb/gpdb_bionic/debian/rules +++ b/packaging/deb/gpdb_bionic/debian/rules @@ -3,7 +3,7 @@ DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 -GPDB_SOURCE_PEFIX := /opt/greenplum-db-6 +GPDB_SOURCE_PREFIX := /opt/greenplum-db-6 DEBIAN_DESTINATION := $(shell pwd)/debian/build # assumes that CWD is root of gpdb source @@ -27,7 +27,7 @@ gpinstall: override_dh_auto_install: gpinstall # the staging directory for creating a debian is NOT the right GPHOME. # change GPHOME to point to the post-install target install directory. - sed -i "s#GPHOME=.*#GPHOME=${GPDB_HOME_PREFIX}-${GPDB_MAJOR_VERSION}#g" ${DEBIAN_DESTINATION}/greenplum_path.sh + sed -i "s#GPHOME=.*#GPHOME=${GPDB_SOURCE_PREFIX}-${GPDB_MAJOR_VERSION}#g" ${DEBIAN_DESTINATION}/greenplum_path.sh override_dh_auto_build: echo "Skipping build" diff --git a/packaging/deb/jammy/debian/rules b/packaging/deb/jammy/debian/rules index ac54ca7..cc6679f 100755 --- a/packaging/deb/jammy/debian/rules +++ b/packaging/deb/jammy/debian/rules @@ -3,7 +3,7 @@ DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 -GPDB_SOURCE_PEFIX := /opt/greenplum-db-6 +GPDB_SOURCE_PREFIX := /opt/greenplum-db DEBIAN_DESTINATION := $(shell pwd)/debian/build # assumes that CWD is root of gpdb source @@ -27,7 +27,7 @@ gpinstall: override_dh_auto_install: gpinstall # the staging directory for creating a debian is NOT the right GPHOME. # change GPHOME to point to the post-install target install directory. - sed -i "s#GPHOME=.*#GPHOME=${GPDB_SOURCE_PEFIX}-${GPDB_MAJOR_VERSION}#g" ${DEBIAN_DESTINATION}/greenplum_path.sh + sed -i "s#GPHOME=.*#GPHOME=${GPDB_SOURCE_PREFIX}-${GPDB_MAJOR_VERSION}#g" ${DEBIAN_DESTINATION}/greenplum_path.sh override_dh_auto_build: echo "Skipping build" From 456007207a20fd5c9145c15139817f242096ea49 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 11:38:21 +0300 Subject: [PATCH 07/23] Return ssh check --- build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index a06c7d4..4e11748 100644 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -83,9 +83,9 @@ source /opt/greenplum-db-6/greenplum_path.sh || exit 1 log_section_end "Environment Setup" # # Verify SSH access -# log_section "SSH Verification" -# execute_cmd ssh $(hostname) 'whoami; hostname' || exit 2 -# log_section_end "SSH Verification" +log_section "SSH Verification" +execute_cmd ssh $(hostname) 'whoami; hostname' || exit 2 +log_section_end "SSH Verification" # Create demo cluster log_section "Demo Cluster Creation" From 55321e81ba53bac8be8ae519d7d861ee4aa823c5 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 14:48:01 +0300 Subject: [PATCH 08/23] Add mkdir LOG_DIR --- build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index 4e11748..34a462f 100644 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -72,6 +72,7 @@ source "${SCRIPT_DIR}/gpdb-utils.sh" # Define log directory export LOG_DIR="${SRC_DIR}/build-logs" +mkdir -p "${LOG_DIR}" CLUSTER_LOG="${LOG_DIR}/cluster.log" # Initialize environment From a98b49d4fcb4937e9b3640e3173efeda049c54d6 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 16:16:35 +0300 Subject: [PATCH 09/23] Add ssh --- images/docker/gpdb/build/jammy/configs/init_system.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 53e70bd..38cce07 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -3,6 +3,15 @@ # -------------------------------------------------------------------- +# -------------------------------------------------------------------- +# Configure SSH access +# -------------------------------------------------------------------- +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/id_rsa +sudo service ssh start +ssh -o StrictHostKeyChecking=no gpadmin@$(hostname) "echo 'Hello world'" + + # -------------------------------------------------------------------- # Display a Welcome Banner # -------------------------------------------------------------------- From 73fec558bdc023753e80ff0f411cd33ac452a861 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 16:30:51 +0300 Subject: [PATCH 10/23] Fix ssh --- images/docker/gpdb/build/jammy/configs/init_system.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 38cce07..6e5cdca 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -6,6 +6,9 @@ # -------------------------------------------------------------------- # Configure SSH access # -------------------------------------------------------------------- +mkdir -p /home/gpadmin/.ssh +chmod 700 /home/gpadmin/.ssh + eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa sudo service ssh start From 4ad6e92dc57ed248b447868e1e9f670d164b5f92 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 17:01:35 +0300 Subject: [PATCH 11/23] Modify init_system.sh --- .../gpdb/build/jammy/configs/init_system.sh | 131 +++++++++++++++++- 1 file changed, 125 insertions(+), 6 deletions(-) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 6e5cdca..89e49e2 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -2,18 +2,63 @@ # Container Initialization Script # -------------------------------------------------------------------- +# -------------------------------------------------------------------- +# Start SSH daemon and setup for SSH access +# -------------------------------------------------------------------- +# The SSH daemon is started to allow remote access to the container via +# SSH. This is useful for development and debugging purposes. If the SSH +# daemon fails to start, the script exits with an error. +# -------------------------------------------------------------------- +if ! sudo /usr/sbin/sshd; then + echo "Failed to start SSH daemon" >&2 + exit 1 +fi + +# -------------------------------------------------------------------- +# Remove /run/nologin to allow logins +# -------------------------------------------------------------------- +# The /run/nologin file, if present, prevents users from logging into +# the system. This file is removed to ensure that users can log in via SSH. +# -------------------------------------------------------------------- +sudo rm -rf /run/nologin # -------------------------------------------------------------------- -# Configure SSH access +# Configure passwordless SSH access for 'gpadmin' user +# -------------------------------------------------------------------- +# The script sets up SSH key-based authentication for the 'gpadmin' user, +# allowing passwordless SSH access. It generates a new SSH key pair if one +# does not already exist, and configures the necessary permissions. # -------------------------------------------------------------------- mkdir -p /home/gpadmin/.ssh chmod 700 /home/gpadmin/.ssh -eval "$(ssh-agent -s)" -ssh-add ~/.ssh/id_rsa -sudo service ssh start -ssh -o StrictHostKeyChecking=no gpadmin@$(hostname) "echo 'Hello world'" +if [ ! -f /home/gpadmin/.ssh/id_rsa ]; then + ssh-keygen -t rsa -b 4096 -C gpadmin -f /home/gpadmin/.ssh/id_rsa -P "" > /dev/null 2>&1 +fi + +cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys +chmod 600 /home/gpadmin/.ssh/authorized_keys + +# -------------------------------------------------------------------- +# Cloudberry Data Directories Setup +# -------------------------------------------------------------------- +# The script sets up the necessary directories for Apache Cloudberry, +# including directories for the coordinator, standby coordinator, primary +# segments, and mirror segments. It also sets up the configuration files +# required for initializing the database. +# -------------------------------------------------------------------- +sudo rm -rf /data1/* +sudo mkdir -p /data1/coordinator /data1/standby_coordinator /data1/primary /data1/mirror +sudo chown -R gpadmin.gpadmin /data1 + +# Copy the gpinitsystem configuration file to the home directory +cp /tmp/gpinitsystem.conf /home/gpadmin + +# Set up the hostfile for cluster initialization +echo $(hostname) > /home/gpadmin/hostfile_gpinitsystem +# Change to the home directory of the current user +cd $HOME # -------------------------------------------------------------------- # Display a Welcome Banner @@ -48,4 +93,78 @@ cat <<-'EOF' |_| |_|\___/|_| \___/|___/_| |_|_|\_\__,_|_____/|____/ ---------------------------------------------------------------------- -EOF \ No newline at end of file +EOF + +# -------------------------------------------------------------------- +# Display System Information +# -------------------------------------------------------------------- +# The script sources the /etc/os-release file to retrieve the operating +# system name and version. It then displays the following information: +# - OS name and version +# - Current user +# - Container hostname +# - IP address +# - CPU model name and number of cores +# - Total memory available +# - Cloudberry version (if installed) +# This information is useful for users to understand the environment they +# are working in. +# -------------------------------------------------------------------- +source /etc/os-release + +# First, create the CPU info detection function +get_cpu_info() { + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + lscpu | grep 'Model name:' | awk '{print substr($0, index($0,$3))}' + elif [ "$ARCH" = "aarch64" ]; then + VENDOR=$(lscpu | grep 'Vendor ID:' | awk '{print $3}') + if [ "$VENDOR" = "Apple" ] || [ "$VENDOR" = "0x61" ]; then + echo "Apple Silicon ($ARCH)" + else + if [ -f /proc/cpuinfo ]; then + IMPL=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk '{print $3}') + PART=$(grep "CPU part" /proc/cpuinfo | head -1 | awk '{print $3}') + if [ ! -z "$IMPL" ] && [ ! -z "$PART" ]; then + echo "ARM $ARCH (Implementer: $IMPL, Part: $PART)" + else + echo "ARM $ARCH" + fi + else + echo "ARM $ARCH" + fi + fi + else + echo "Unknown architecture: $ARCH" + fi +} + +# Check if Apache Cloudberry is installed and display its version +if rpm -q apache-cloudberry-db-incubating > /dev/null 2>&1; then + CBDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version) +else + CBDB_VERSION="Not installed" +fi + +cat <<-EOF +Welcome to the Apache Cloudberry Test Environment! + +Cloudberry version .. : $CBDB_VERSION +Container OS ........ : $NAME $VERSION +User ................ : $(whoami) +Container hostname .. : $(hostname) +IP Address .......... : $(hostname -I | awk '{print $1}') +CPU Info ............ : $(get_cpu_info) +CPU(s) .............. : $(nproc) +Memory .............. : $(free -h | grep Mem: | awk '{print $2}') total +====================================================================== + +EOF + +# -------------------------------------------------------------------- +# Start an interactive bash shell +# -------------------------------------------------------------------- +# Finally, the script starts an interactive bash shell to keep the +# container running and allow the user to interact with the environment. +# -------------------------------------------------------------------- +/bin/bash \ No newline at end of file From 9555d1869e07fe9e80248fafe8e80883d6ad73d2 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 17:10:28 +0300 Subject: [PATCH 12/23] Tmp --- .../gpdb/build/jammy/configs/init_system.sh | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 89e49e2..3eaf17d 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -2,26 +2,6 @@ # Container Initialization Script # -------------------------------------------------------------------- -# -------------------------------------------------------------------- -# Start SSH daemon and setup for SSH access -# -------------------------------------------------------------------- -# The SSH daemon is started to allow remote access to the container via -# SSH. This is useful for development and debugging purposes. If the SSH -# daemon fails to start, the script exits with an error. -# -------------------------------------------------------------------- -if ! sudo /usr/sbin/sshd; then - echo "Failed to start SSH daemon" >&2 - exit 1 -fi - -# -------------------------------------------------------------------- -# Remove /run/nologin to allow logins -# -------------------------------------------------------------------- -# The /run/nologin file, if present, prevents users from logging into -# the system. This file is removed to ensure that users can log in via SSH. -# -------------------------------------------------------------------- -sudo rm -rf /run/nologin - # -------------------------------------------------------------------- # Configure passwordless SSH access for 'gpadmin' user # -------------------------------------------------------------------- From 7bc447226e0f4fa34ad9b78ba49922713185efce Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Thu, 27 Mar 2025 17:24:46 +0300 Subject: [PATCH 13/23] tmptmp --- images/docker/gpdb/build/jammy/configs/init_system.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 3eaf17d..035d49f 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -2,6 +2,14 @@ # Container Initialization Script # -------------------------------------------------------------------- +# -------------------------------------------------------------------- +# Remove /run/nologin to allow logins +# -------------------------------------------------------------------- +# The /run/nologin file, if present, prevents users from logging into +# the system. This file is removed to ensure that users can log in via SSH. +# -------------------------------------------------------------------- +sudo rm -rf /run/nologin + # -------------------------------------------------------------------- # Configure passwordless SSH access for 'gpadmin' user # -------------------------------------------------------------------- From 2fe4803286cfa8a309b3fe3f9e01fff203d06ae0 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 11:05:43 +0300 Subject: [PATCH 14/23] Modify init_system.sh --- .../docker-gpdb-build-conatiners.yml | 2 ++ .../gpdb/build/jammy/configs/init_system.sh | 25 ++++++------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-gpdb-build-conatiners.yml b/.github/workflows/docker-gpdb-build-conatiners.yml index 3b47f7a..da66c21 100644 --- a/.github/workflows/docker-gpdb-build-conatiners.yml +++ b/.github/workflows/docker-gpdb-build-conatiners.yml @@ -95,6 +95,8 @@ jobs: org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.created=${{ steps.version.outputs.BUILD_DATE }} org.opencontainers.image.version=${{ steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }} + org.opencontainers.image.description="Containerized environment for building and testing Greenplum Database. Includes all necessary dependencies, tools, and configurations to streamline the development and build process." + org.opencontainers.image.title="Greenplum Build Environment" # Generate a detailed build summary in GitHub Actions UI # This provides quick access to build information and image usage instructions diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 035d49f..e20e6e1 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -2,14 +2,6 @@ # Container Initialization Script # -------------------------------------------------------------------- -# -------------------------------------------------------------------- -# Remove /run/nologin to allow logins -# -------------------------------------------------------------------- -# The /run/nologin file, if present, prevents users from logging into -# the system. This file is removed to ensure that users can log in via SSH. -# -------------------------------------------------------------------- -sudo rm -rf /run/nologin - # -------------------------------------------------------------------- # Configure passwordless SSH access for 'gpadmin' user # -------------------------------------------------------------------- @@ -20,10 +12,7 @@ sudo rm -rf /run/nologin mkdir -p /home/gpadmin/.ssh chmod 700 /home/gpadmin/.ssh -if [ ! -f /home/gpadmin/.ssh/id_rsa ]; then - ssh-keygen -t rsa -b 4096 -C gpadmin -f /home/gpadmin/.ssh/id_rsa -P "" > /dev/null 2>&1 -fi - +ssh-keygen -f /home/gpadmin/.ssh/id_rsa -N '' cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys chmod 600 /home/gpadmin/.ssh/authorized_keys @@ -127,17 +116,17 @@ get_cpu_info() { fi } -# Check if Apache Cloudberry is installed and display its version -if rpm -q apache-cloudberry-db-incubating > /dev/null 2>&1; then - CBDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version) +# Check if Greenplum is installed and display its version +if dpkg -l greenplum-db-6 > /dev/null 2>&1; then + GPDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version) else - CBDB_VERSION="Not installed" + GPDB_VERSION="Not installed" fi cat <<-EOF -Welcome to the Apache Cloudberry Test Environment! +Welcome to the Greebplum Test Environment! -Cloudberry version .. : $CBDB_VERSION +Greenplum version ... : $GPDB_VERSION Container OS ........ : $NAME $VERSION User ................ : $(whoami) Container hostname .. : $(hostname) From 5e244da5e137e6d7fb08c7ada81cab91112a02e1 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 11:24:32 +0300 Subject: [PATCH 15/23] Modify init_system.sh --- images/docker/gpdb/build/jammy/configs/init_system.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index e20e6e1..971f0fe 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -16,6 +16,11 @@ ssh-keygen -f /home/gpadmin/.ssh/id_rsa -N '' cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys chmod 600 /home/gpadmin/.ssh/authorized_keys +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/id_rsa +sudo service ssh start +ssh -o StrictHostKeyChecking=no gpadmin@$(hostname) "echo 'Hello world'" + # -------------------------------------------------------------------- # Cloudberry Data Directories Setup # -------------------------------------------------------------------- From 9ee0db73397969caadfb14302f14bead925c13c2 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 11:34:31 +0300 Subject: [PATCH 16/23] Update Dockerfile --- images/docker/gpdb/build/jammy/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/images/docker/gpdb/build/jammy/Dockerfile b/images/docker/gpdb/build/jammy/Dockerfile index 888a682..6dc7f76 100644 --- a/images/docker/gpdb/build/jammy/Dockerfile +++ b/images/docker/gpdb/build/jammy/Dockerfile @@ -129,3 +129,15 @@ USER gpadmin WORKDIR /home/gpadmin RUN sudo DEBIAN_FRONTEND=noninteractive apt install -y libhyperic-sigar-java libaprutil1-dev libuv1-dev + +# -------------------------------------------------------------------- +# Set the Default User and Command +# -------------------------------------------------------------------- +# The default user is set to 'gpadmin', and the container starts by +# running the init_system.sh script. This container serves as a base +# environment, and the Cloudberry Database RPM can be installed for +# testing and functional verification. +# -------------------------------------------------------------------- +USER gpadmin + +CMD ["bash","-c","/tmp/init_system.sh"] \ No newline at end of file From b4d8a9e33463cd24e8017658a818cc1fa573cfe5 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 11:49:56 +0300 Subject: [PATCH 17/23] Add pip install --- images/docker/gpdb/build/jammy/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/docker/gpdb/build/jammy/Dockerfile b/images/docker/gpdb/build/jammy/Dockerfile index 6dc7f76..4e752ed 100644 --- a/images/docker/gpdb/build/jammy/Dockerfile +++ b/images/docker/gpdb/build/jammy/Dockerfile @@ -94,6 +94,9 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install openssh-server \ locales + +RUN pip install psutil + RUN apt-get install -y locales \ && locale-gen "en_US.UTF-8" \ && update-locale LC_ALL="en_US.UTF-8" From d9597954ce9ad9414986885c766dff5f64bbac21 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 11:52:37 +0300 Subject: [PATCH 18/23] upd --- images/docker/gpdb/build/jammy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/docker/gpdb/build/jammy/Dockerfile b/images/docker/gpdb/build/jammy/Dockerfile index 4e752ed..17e04a3 100644 --- a/images/docker/gpdb/build/jammy/Dockerfile +++ b/images/docker/gpdb/build/jammy/Dockerfile @@ -95,7 +95,7 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install locales -RUN pip install psutil +RUN pip2 install psutil RUN apt-get install -y locales \ && locale-gen "en_US.UTF-8" \ From cbebdf64d369ef33fcd01f81fa6fe533076e714f Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 12:13:15 +0300 Subject: [PATCH 19/23] Chmod --- build_automation/gpdb/scripts/build-gpdb.sh | 0 build_automation/gpdb/scripts/configure-gpdb.sh | 0 build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh | 0 build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh | 0 build_automation/gpdb/scripts/gpdb-utils.sh | 0 build_automation/gpdb/scripts/parse-results.pl | 0 build_automation/gpdb/scripts/parse-test-results.sh | 0 build_automation/gpdb/scripts/test-gpdb.sh | 0 scripts/build-deb.sh | 0 9 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build_automation/gpdb/scripts/build-gpdb.sh mode change 100644 => 100755 build_automation/gpdb/scripts/configure-gpdb.sh mode change 100644 => 100755 build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh mode change 100644 => 100755 build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh mode change 100644 => 100755 build_automation/gpdb/scripts/gpdb-utils.sh mode change 100644 => 100755 build_automation/gpdb/scripts/parse-results.pl mode change 100644 => 100755 build_automation/gpdb/scripts/parse-test-results.sh mode change 100644 => 100755 build_automation/gpdb/scripts/test-gpdb.sh mode change 100644 => 100755 scripts/build-deb.sh diff --git a/build_automation/gpdb/scripts/build-gpdb.sh b/build_automation/gpdb/scripts/build-gpdb.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/configure-gpdb.sh b/build_automation/gpdb/scripts/configure-gpdb.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/gpdb-utils.sh b/build_automation/gpdb/scripts/gpdb-utils.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/parse-results.pl b/build_automation/gpdb/scripts/parse-results.pl old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/parse-test-results.sh b/build_automation/gpdb/scripts/parse-test-results.sh old mode 100644 new mode 100755 diff --git a/build_automation/gpdb/scripts/test-gpdb.sh b/build_automation/gpdb/scripts/test-gpdb.sh old mode 100644 new mode 100755 diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh old mode 100644 new mode 100755 From 7f8708cfeba33c6946209ebc6f69c4a017b41451 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 12:19:23 +0300 Subject: [PATCH 20/23] Fix test script --- build_automation/gpdb/scripts/test-gpdb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_automation/gpdb/scripts/test-gpdb.sh b/build_automation/gpdb/scripts/test-gpdb.sh index c0bcf91..8882869 100755 --- a/build_automation/gpdb/scripts/test-gpdb.sh +++ b/build_automation/gpdb/scripts/test-gpdb.sh @@ -60,7 +60,7 @@ export LOG_DIR="build-logs" TEST_LOG="${LOG_DIR}/test.log" # Initialize environment -init_environment "Greenplum Test Script" "${TEST_LOG}" +init_environment "Greenplum Test Script" "${TEST_LOG}" "/opt/greenplum-db-6" # Source Greenplum environment log_section "Environment Setup" From 83db0192e3d9a9a0a73e1381108abed602bd67f2 Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 12:45:01 +0300 Subject: [PATCH 21/23] Fix --- build_automation/gpdb/scripts/build-gpdb.sh | 6 +++--- .../gpdb/scripts/create-gpdb-demo-cluster.sh | 8 ++++---- .../gpdb/scripts/destroy-gpdb-demo-cluster.sh | 14 +++++++------- build_automation/gpdb/scripts/parse-results.pl | 2 +- .../gpdb/scripts/parse-test-results.sh | 2 +- build_automation/gpdb/scripts/test-gpdb.sh | 6 +++--- images/docker/gpdb/build/jammy/Dockerfile | 4 ++-- .../docker/gpdb/build/jammy/configs/init_system.sh | 8 ++++---- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build_automation/gpdb/scripts/build-gpdb.sh b/build_automation/gpdb/scripts/build-gpdb.sh index ac5e351..ccd92b8 100755 --- a/build_automation/gpdb/scripts/build-gpdb.sh +++ b/build_automation/gpdb/scripts/build-gpdb.sh @@ -20,7 +20,7 @@ # -------------------------------------------------------------------- # # Script: build-gpdb.sh -# Description: Builds Apache Cloudberry from source code and installs +# Description: Builds Greenplum from source code and installs # it. # Performs the following steps: # 1. Builds main open-gpdb database components @@ -29,7 +29,7 @@ # Uses parallel compilation based on available CPU cores. # # Required Environment Variables: -# SRC_DIR - Root source directory containing Apache Cloudberry +# SRC_DIR - Root source directory containing Greenplum # source code # # Optional Environment Variables: @@ -45,7 +45,7 @@ # ./build-gpdb.sh # # Prerequisites: -# - configure-cloudberry.sh must be run first +# - configure-gpdb.sh must be run first # - Required build dependencies must be installed # - /usr/local/cloudberry-db/lib must exist and be writable # diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index 34a462f..36c469f 100755 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -19,8 +19,8 @@ # # -------------------------------------------------------------------- # -# Script: create-cloudberry-demo-cluster.sh -# Description: Creates and configures a demo Apache Cloudbery cluster. +# Script: create-gpdb-demo-cluster.sh +# Description: Creates and configures a demo Greenplum cluster. # Performs the following steps: # 1. Sets up required environment variables # 2. Verifies SSH connectivity @@ -35,7 +35,7 @@ # LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs) # # Prerequisites: -# - Apache Cloudberry must be installed (/opt/greenplum-db-6) +# - Greenplum must be installed (/opt/greenplum-db-6) # - SSH must be configured for passwordless access to localhost # - User must have permissions to create cluster directories # - PostgreSQL client tools (psql) must be available @@ -47,7 +47,7 @@ # ./create-gpdb-demo-cluster.sh # # Verification Checks: -# - Apache Cloudberry version +# - Greenplum version # - Segment configuration # - Available extensions # - Active sessions diff --git a/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh index 930bedf..64c3d18 100755 --- a/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh @@ -19,8 +19,8 @@ # # -------------------------------------------------------------------- # -# Script: destroy-cloudberry-demo-cluster.sh -# Description: Destroys and cleans up a demo Apache Cloudberry +# Script: destroy-gpdb-demo-cluster.sh +# Description: Destroys and cleans up a demo Greenplum # cluster. # Performs the following steps: # 1. Sources required environment variables @@ -35,15 +35,15 @@ # LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs) # # Prerequisites: -# - Apache Cloudberry environment must be available +# - Greenplum environment must be available # - User must have permissions to remove cluster directories # - No active connections to the cluster # # Usage: # Export required variables: -# export SRC_DIR=/path/to/cloudberry/source +# export SRC_DIR=/path/to/gpdb/source # Then run: -# ./destroy-cloudberry-demo-cluster.sh +# ./destroy-gpdb-demo-cluster.sh # # Exit Codes: # 0 - Cluster destroyed successfully @@ -51,7 +51,7 @@ # 2 - Cluster destruction failed # # Related Scripts: -# - create-cloudberry-demo-cluster.sh: Creates a new demo cluster +# - create-gpdb-demo-cluster.sh: Creates a new demo cluster # # Notes: # - This script will forcefully terminate all cluster processes @@ -71,7 +71,7 @@ export LOG_DIR="${SRC_DIR}/build-logs" CLUSTER_LOG="${LOG_DIR}/destroy-cluster.log" # Initialize environment -init_environment "Destroy Greenplum Demo Cluster Script" "${CLUSTER_LOG}" +init_environment "Destroy Greenplum Demo Cluster Script" "${CLUSTER_LOG}" "/opt/greenplum-db-6" # Source Greenplum environment log_section "Environment Setup" diff --git a/build_automation/gpdb/scripts/parse-results.pl b/build_automation/gpdb/scripts/parse-results.pl index 366f7e1..6963f79 100755 --- a/build_automation/gpdb/scripts/parse-results.pl +++ b/build_automation/gpdb/scripts/parse-results.pl @@ -20,7 +20,7 @@ # -------------------------------------------------------------------- # # Script: parse_results.pl -# Description: Processes Cloudberry test output to extract statistics +# Description: Processes Greenplum test output to extract statistics # and results. # Analyzes test log files to determine: # 1. Overall test status (pass/fail) diff --git a/build_automation/gpdb/scripts/parse-test-results.sh b/build_automation/gpdb/scripts/parse-test-results.sh index ca6bb4f..c1f8e19 100755 --- a/build_automation/gpdb/scripts/parse-test-results.sh +++ b/build_automation/gpdb/scripts/parse-test-results.sh @@ -20,7 +20,7 @@ # -------------------------------------------------------------------- # # Script: parse-test-results.sh -# Description: Parses Apache Cloudberry test results and processes the +# Description: Parses Greenplum test results and processes the # output. # Provides GitHub Actions integration and environment # variable export functionality. This script is a wrapper diff --git a/build_automation/gpdb/scripts/test-gpdb.sh b/build_automation/gpdb/scripts/test-gpdb.sh index 8882869..611684d 100755 --- a/build_automation/gpdb/scripts/test-gpdb.sh +++ b/build_automation/gpdb/scripts/test-gpdb.sh @@ -19,10 +19,10 @@ # # -------------------------------------------------------------------- # -# Script: test-cloudberry.sh -# Description: Executes Apache Cloudberry test suite using specified +# Script: test-gpdb.sh +# Description: Executes Greenplum test suite using specified # make target. Supports different test types through make -# target configuration. Sources Cloudberry environment +# target configuration. Sources Greenplum environment # before running tests. # # Required Environment Variables: diff --git a/images/docker/gpdb/build/jammy/Dockerfile b/images/docker/gpdb/build/jammy/Dockerfile index 17e04a3..f61641b 100644 --- a/images/docker/gpdb/build/jammy/Dockerfile +++ b/images/docker/gpdb/build/jammy/Dockerfile @@ -138,8 +138,8 @@ RUN sudo DEBIAN_FRONTEND=noninteractive apt install -y libhyperic-sigar-java lib # -------------------------------------------------------------------- # The default user is set to 'gpadmin', and the container starts by # running the init_system.sh script. This container serves as a base -# environment, and the Cloudberry Database RPM can be installed for -# testing and functional verification. +# environment, and the Greenplum Database DEB package can be installed +# for testing and functional verification. # -------------------------------------------------------------------- USER gpadmin diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index 971f0fe..c7f8a50 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -22,9 +22,9 @@ sudo service ssh start ssh -o StrictHostKeyChecking=no gpadmin@$(hostname) "echo 'Hello world'" # -------------------------------------------------------------------- -# Cloudberry Data Directories Setup +# Greenplum Data Directories Setup # -------------------------------------------------------------------- -# The script sets up the necessary directories for Apache Cloudberry, +# The script sets up the necessary directories for Greenplum, # including directories for the coordinator, standby coordinator, primary # segments, and mirror segments. It also sets up the configuration files # required for initializing the database. @@ -88,7 +88,7 @@ EOF # - IP address # - CPU model name and number of cores # - Total memory available -# - Cloudberry version (if installed) +# - Greenplum version (if installed) # This information is useful for users to understand the environment they # are working in. # -------------------------------------------------------------------- @@ -123,7 +123,7 @@ get_cpu_info() { # Check if Greenplum is installed and display its version if dpkg -l greenplum-db-6 > /dev/null 2>&1; then - GPDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version) + GPDB_VERSION=$(/opt/greenplum-db-6/bin/postgres --gp-version) else GPDB_VERSION="Not installed" fi From 50b7fe789a93e7f80b1d8e921a3953ed979da48c Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 12:51:53 +0300 Subject: [PATCH 22/23] Fix --- build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh | 2 ++ build_automation/gpdb/scripts/test-gpdb.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh index 36c469f..102ccef 100755 --- a/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh +++ b/build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh @@ -66,6 +66,8 @@ set -euo pipefail +export BUILD_DESTINATION="/opt/greenplum-db-6" + # Source common utilities SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPT_DIR}/gpdb-utils.sh" diff --git a/build_automation/gpdb/scripts/test-gpdb.sh b/build_automation/gpdb/scripts/test-gpdb.sh index 611684d..7839301 100755 --- a/build_automation/gpdb/scripts/test-gpdb.sh +++ b/build_automation/gpdb/scripts/test-gpdb.sh @@ -34,6 +34,10 @@ # LOG_DIR - Directory for logs (defaults to build-logs) # PGOPTIONS - PostgreSQL server options # +# Prerequisites: +# - Greenplum must be installed (/opt/greenplum-db-6) +# - create-gpdb-demo-cluster.sh must be run first +# # Usage: # Export required variables: # export MAKE_TARGET=installcheck-world @@ -51,6 +55,8 @@ set -euo pipefail +export BUILD_DESTINATION="/opt/greenplum-db-6" + # Source common utilities SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPT_DIR}/gpdb-utils.sh" From 543765673b794eb62b911154ac01dd3e7acc8daa Mon Sep 17 00:00:00 2001 From: Vladimir Rachkin Date: Fri, 28 Mar 2025 15:34:42 +0300 Subject: [PATCH 23/23] Fix --- .../gpdb/build/jammy/configs/init_system.sh | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/images/docker/gpdb/build/jammy/configs/init_system.sh b/images/docker/gpdb/build/jammy/configs/init_system.sh index c7f8a50..a50d8b1 100644 --- a/images/docker/gpdb/build/jammy/configs/init_system.sh +++ b/images/docker/gpdb/build/jammy/configs/init_system.sh @@ -21,27 +21,6 @@ ssh-add ~/.ssh/id_rsa sudo service ssh start ssh -o StrictHostKeyChecking=no gpadmin@$(hostname) "echo 'Hello world'" -# -------------------------------------------------------------------- -# Greenplum Data Directories Setup -# -------------------------------------------------------------------- -# The script sets up the necessary directories for Greenplum, -# including directories for the coordinator, standby coordinator, primary -# segments, and mirror segments. It also sets up the configuration files -# required for initializing the database. -# -------------------------------------------------------------------- -sudo rm -rf /data1/* -sudo mkdir -p /data1/coordinator /data1/standby_coordinator /data1/primary /data1/mirror -sudo chown -R gpadmin.gpadmin /data1 - -# Copy the gpinitsystem configuration file to the home directory -cp /tmp/gpinitsystem.conf /home/gpadmin - -# Set up the hostfile for cluster initialization -echo $(hostname) > /home/gpadmin/hostfile_gpinitsystem - -# Change to the home directory of the current user -cd $HOME - # -------------------------------------------------------------------- # Display a Welcome Banner # --------------------------------------------------------------------