tuhaihe commented on code in PR #5:
URL: 
https://github.com/apache/cloudberry-devops-release/pull/5#discussion_r1845851072


##########
build_automation/cloudberry/scripts/build-cloudberry.sh:
##########
@@ -0,0 +1,89 @@
+#!/bin/bash
+# --------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership.  The ASF licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License.  You may obtain a copy of the
+# License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.  See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# --------------------------------------------------------------------
+#
+# Script: build-cloudberry.sh
+# Description: Builds CloudBerry DB from source code and installs it.
+#             Performs the following steps:
+#             1. Builds main CloudBerry DB components
+#             2. Builds contrib modules
+#             3. Installs both main and contrib components
+#             Uses parallel compilation based on available CPU cores.
+#
+# Required Environment Variables:
+#   SRC_DIR - Root source directory containing CloudBerry DB source code
+#
+# Optional Environment Variables:
+#   LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs)
+#   NPROC   - Number of parallel jobs (defaults to all available cores)
+#
+# Usage:
+#   Export required variables:
+#     export SRC_DIR=/path/to/cloudberry/source
+#   Then run:
+#     ./build-cloudberry.sh
+#
+# Prerequisites:
+#   - configure-cloudberry.sh must be run first
+#   - Required build dependencies must be installed
+#   - /usr/local/cloudberry-db/lib must exist and be writable
+#
+# Exit Codes:
+#   0 - Build and installation completed successfully
+#   1 - Environment setup failed (missing SRC_DIR, LOG_DIR creation failed)
+#   2 - Main component build failed
+#   3 - Contrib build failed
+#   4 - Installation failed
+#
+# --------------------------------------------------------------------
+
+set -euo pipefail
+
+# Source common utilities
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "${SCRIPT_DIR}/cloudberry-utils.sh"
+
+# Define log directory and files
+export LOG_DIR="${SRC_DIR}/build-logs"
+BUILD_LOG="${LOG_DIR}/build.log"
+
+# Initialize environment
+init_environment "CloudBerry Build Script" "${BUILD_LOG}"

Review Comment:
   `CloudBerry` ~> `Cloudberry`



##########
build_automation/cloudberry/scripts/build-cloudberry.sh:
##########
@@ -0,0 +1,89 @@
+#!/bin/bash
+# --------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership.  The ASF licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License.  You may obtain a copy of the
+# License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.  See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# --------------------------------------------------------------------
+#
+# Script: build-cloudberry.sh
+# Description: Builds CloudBerry DB from source code and installs it.
+#             Performs the following steps:
+#             1. Builds main CloudBerry DB components

Review Comment:
   `CloudBerry` ~> `Cloudberry` ?



##########
build_automation/cloudberry/scripts/configure-cloudberry.sh:
##########
@@ -0,0 +1,143 @@
+#!/bin/bash
+# --------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership.  The ASF licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License.  You may obtain a copy of the
+# License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.  See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# --------------------------------------------------------------------
+#
+# Script: configure-cloudberry.sh
+# Description: Configures CloudBerry DB build environment and runs ./configure
+#             with optimized settings. Performs the following:
+#             1. Prepares /usr/local/cloudberry-db directory
+#             2. Sets up library dependencies
+#             3. Configures build with required features enabled
+#
+# Configuration Features:
+#   - Cloud Storage Integration (gpcloud)
+#   - IC Proxy Support
+#   - MapReduce Processing
+#   - Oracle Compatibility (orafce)
+#   - ORCA Query Optimizer
+#   - PXF External Table Access
+#   - Test Automation Support (tap-tests)
+#
+# System Integration:
+#   - GSSAPI Authentication
+#   - LDAP Authentication
+#   - XML Processing
+#   - LZ4 Compression
+#   - OpenSSL Support
+#   - PAM Authentication
+#   - Perl Support
+#   - Python Support
+#
+# Required Environment Variables:
+#   SRC_DIR - Root source directory
+#
+# Optional Environment Variables:
+#   LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs)
+#
+# Prerequisites:
+#   - System dependencies must be installed:
+#     * xerces-c development files
+#     * OpenSSL development files
+#     * Python development files
+#     * Perl development files
+#     * LDAP development files
+#   - /usr/local must be writable
+#   - User must have sudo privileges
+#
+# Usage:
+#   Export required variables:
+#     export SRC_DIR=/path/to/cloudberry/source
+#   Then run:
+#     ./configure-cloudberry.sh
+#
+# Exit Codes:
+#   0 - Configuration completed successfully
+#   1 - Environment setup failed
+#   2 - Directory preparation failed
+#   3 - Library setup failed
+#   4 - Configure command failed
+#
+# --------------------------------------------------------------------
+
+set -euo pipefail
+
+# Source common utilities
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "${SCRIPT_DIR}/cloudberry-utils.sh"
+
+# Define log directory and files
+export LOG_DIR="${SRC_DIR}/build-logs"
+CONFIGURE_LOG="${LOG_DIR}/configure.log"
+
+# Initialize environment
+init_environment "CloudBerry Configure Script" "${CONFIGURE_LOG}"
+
+# Initial setup
+log_section "Initial Setup"
+execute_cmd sudo rm -rf /usr/local/cloudberry-db || exit 2
+execute_cmd sudo chmod a+w /usr/local || exit 2
+execute_cmd mkdir -p /usr/local/cloudberry-db/lib || exit 2
+execute_cmd sudo cp /usr/local/xerces-c/lib/libxerces-c.so \
+        /usr/local/xerces-c/lib/libxerces-c-3.3.so \
+        /usr/local/cloudberry-db/lib || exit 3
+execute_cmd sudo chown -R gpadmin.gpadmin /usr/local/cloudberry-db || exit 2

Review Comment:
   `gpadmin.gpadmin` ~> `gpadmin:gpadmin`? Not sure about this, FYI.



##########
build_automation/cloudberry/scripts/configure-cloudberry.sh:
##########
@@ -0,0 +1,143 @@
+#!/bin/bash
+# --------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership.  The ASF licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License.  You may obtain a copy of the
+# License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.  See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# --------------------------------------------------------------------
+#
+# Script: configure-cloudberry.sh
+# Description: Configures CloudBerry DB build environment and runs ./configure
+#             with optimized settings. Performs the following:
+#             1. Prepares /usr/local/cloudberry-db directory
+#             2. Sets up library dependencies
+#             3. Configures build with required features enabled
+#
+# Configuration Features:
+#   - Cloud Storage Integration (gpcloud)
+#   - IC Proxy Support
+#   - MapReduce Processing
+#   - Oracle Compatibility (orafce)
+#   - ORCA Query Optimizer
+#   - PXF External Table Access
+#   - Test Automation Support (tap-tests)
+#
+# System Integration:
+#   - GSSAPI Authentication
+#   - LDAP Authentication
+#   - XML Processing
+#   - LZ4 Compression
+#   - OpenSSL Support
+#   - PAM Authentication
+#   - Perl Support
+#   - Python Support
+#
+# Required Environment Variables:
+#   SRC_DIR - Root source directory
+#
+# Optional Environment Variables:
+#   LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs)
+#
+# Prerequisites:
+#   - System dependencies must be installed:
+#     * xerces-c development files
+#     * OpenSSL development files
+#     * Python development files
+#     * Perl development files
+#     * LDAP development files
+#   - /usr/local must be writable
+#   - User must have sudo privileges
+#
+# Usage:
+#   Export required variables:
+#     export SRC_DIR=/path/to/cloudberry/source
+#   Then run:
+#     ./configure-cloudberry.sh
+#
+# Exit Codes:
+#   0 - Configuration completed successfully
+#   1 - Environment setup failed
+#   2 - Directory preparation failed
+#   3 - Library setup failed
+#   4 - Configure command failed
+#
+# --------------------------------------------------------------------
+
+set -euo pipefail
+
+# Source common utilities
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "${SCRIPT_DIR}/cloudberry-utils.sh"
+
+# Define log directory and files
+export LOG_DIR="${SRC_DIR}/build-logs"
+CONFIGURE_LOG="${LOG_DIR}/configure.log"
+
+# Initialize environment
+init_environment "CloudBerry Configure Script" "${CONFIGURE_LOG}"

Review Comment:
   `CloudBerry` ~> `Cloudberry`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to