Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-gpdb-build-conatiners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions build_automation/gpdb/scripts/build-gpdb.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
#
Expand Down
Empty file modified build_automation/gpdb/scripts/configure-gpdb.sh
100644 → 100755
Empty file.
29 changes: 16 additions & 13 deletions build_automation/gpdb/scripts/create-gpdb-demo-cluster.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,19 +35,19 @@
# LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs)
#
# Prerequisites:
# - Apache Cloudberry must be installed (/usr/local/cloudberry-db)
# - 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
#
# 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
# - Greenplum version
# - Segment configuration
# - Available extensions
# - Active sessions
Expand All @@ -66,35 +66,38 @@

set -euo pipefail

export BUILD_DESTINATION="/opt/greenplum-db-6"

# 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"
mkdir -p "${LOG_DIR}"
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 /opt/greenplum-db-6/greenplum_path.sh || exit 1
log_section_end "Environment Setup"

# Verify SSH access
# # 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"
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
Expand All @@ -121,5 +124,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
28 changes: 14 additions & 14 deletions build_automation/gpdb/scripts/destroy-gpdb-demo-cluster.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,23 +35,23 @@
# 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
# 1 - Environment setup/sourcing failed
# 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
Expand All @@ -64,38 +64,38 @@ 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}" "/opt/greenplum-db-6"

# 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
}
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
10 changes: 5 additions & 5 deletions build_automation/gpdb/scripts/gpdb-utils.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build_automation/gpdb/scripts/parse-results.pl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion build_automation/gpdb/scripts/parse-test-results.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 15 additions & 9 deletions build_automation/gpdb/scripts/test-gpdb.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,13 +34,17 @@
# 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
# 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
Expand All @@ -51,20 +55,22 @@

set -euo pipefail

export BUILD_DESTINATION="/opt/greenplum-db-6"

# 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}" "/opt/greenplum-db-6"

# 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}"
Expand All @@ -77,5 +83,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
21 changes: 21 additions & 0 deletions images/docker/gpdb/build/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -88,6 +94,9 @@ RUN apt-get update -o Acquire::AllowInsecureRepositories=true && apt-get install
openssh-server \
locales


RUN pip2 install psutil

RUN apt-get install -y locales \
&& locale-gen "en_US.UTF-8" \
&& update-locale LC_ALL="en_US.UTF-8"
Expand Down Expand Up @@ -123,3 +132,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 Greenplum Database DEB package can be installed
# for testing and functional verification.
# --------------------------------------------------------------------
USER gpadmin

CMD ["bash","-c","/tmp/init_system.sh"]
Loading