Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
03ed1c0
Add scripts for create ubuntu jammy docker file
leborchuk Mar 26, 2025
b09962e
Remove internal yandex dependencies
leborchuk Mar 26, 2025
779dafd
Deb version always should start with a number
leborchuk Mar 26, 2025
f2ab2ed
Install sudo - need for various scripts
leborchuk Mar 26, 2025
212980c
Resolve review notes
leborchuk Mar 27, 2025
044362f
Update images/docker/cbdb/test/ubuntu22.04/Dockerfile
leborchuk Apr 3, 2025
181f398
Update images/docker/cbdb/test/ubuntu22.04/Dockerfile
leborchuk Apr 3, 2025
843e667
Update images/docker/cbdb/test/ubuntu22.04/Dockerfile
leborchuk Apr 3, 2025
4d44425
Merge branch 'apache:main' into AddJammyBuild
leborchuk Apr 3, 2025
0e777df
Combed the Dockerfile based on the comments in PR
leborchuk Apr 4, 2025
9dd4b6f
install into /usr/cloudberry-db
leborchuk Apr 4, 2025
38b9d5b
Move debian package creation changes from https://github.com/apache/c…
leborchuk Apr 7, 2025
60bbbb7
Move some changes to https://github.com/apache/cloudberry-devops-rele…
leborchuk Apr 7, 2025
0e5dd66
Do not touch build_automation/cloudberry/scripts in this PR
leborchuk Apr 7, 2025
b30da1f
Add test_cloudberry_db_env
leborchuk Apr 7, 2025
1114b87
Add gpinitsystem.conf
leborchuk Apr 7, 2025
aa2f271
Use python3 in test container
leborchuk Apr 8, 2025
ff80ee0
Fix test debian build
leborchuk May 9, 2025
484a546
Merge branch 'apache:main' into AddJammyBuild
leborchuk Jun 2, 2025
c133b60
Merge branch 'apache:main' into AddJammyBuild
leborchuk Jun 5, 2025
70a7ef8
Cope edespino files
Jun 6, 2025
55c129d
Add go to path
Jun 6, 2025
19a6754
Change docker key
Jun 6, 2025
bfd7d3c
Push to ghcr.io registry
Jun 6, 2025
08af24e
Merge branch 'AddJammyBuild' into AddDeb
leborchuk Jun 10, 2025
d1673d4
Merge pull request #3 from leborchuk/AddDeb
leborchuk Jun 10, 2025
2db34e1
Remove excessive dependencies
Jun 10, 2025
8549e40
Tru to set correct repository in tag
Jun 10, 2025
a4bf288
Add libxerces to dependencies
Jun 13, 2025
f06fa77
Do not need python-setuptools to build deb
Jun 14, 2025
9d4400b
Move back to incubator-cloudberry docker
Jun 16, 2025
c49b173
Revert registry to apache incubator
Jun 18, 2025
90f06a6
Do not change rights to binary files
Jun 26, 2025
f506a9c
Add jammy build to cloudberry-devops-release
tuhaihe Jun 7, 2025
1475527
Merge branch 'main' into AddJammyBuild
leborchuk Jul 24, 2025
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
5 changes: 4 additions & 1 deletion .github/workflows/docker-cbdb-build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ on:
paths:
- 'images/docker/cbdb/build/rocky8/**'
- 'images/docker/cbdb/build/rocky9/**'
- 'images/docker/cbdb/build/ubuntu22.04/**'
workflow_dispatch: # Manual trigger

# Prevent multiple workflow runs from interfering with each other
Expand All @@ -76,7 +77,7 @@ jobs:
# Matrix strategy to build for both Rocky Linux 8 and 9
strategy:
matrix:
platform: ['rocky8', 'rocky9']
platform: ['rocky8', 'rocky9', 'ubuntu22.04']

steps:
# Checkout repository code with full history
Expand All @@ -103,6 +104,8 @@ jobs:
- 'images/docker/cbdb/build/rocky8/**'
rocky9:
- 'images/docker/cbdb/build/rocky9/**'
ubuntu22.04:
- 'images/docker/cbdb/build/ubuntu22.04/**'

# Set up QEMU for multi-architecture support
# This allows building ARM64 images on AMD64 infrastructure and vice versa
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docker-cbdb-test-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ on:
paths:
- 'images/docker/cbdb/test/rocky8/**'
- 'images/docker/cbdb/test/rocky9/**'
- 'images/docker/cbdb/test/ubuntu22.04/**'
workflow_dispatch: # Manual trigger

# Prevent multiple workflow runs from interfering with each other
Expand All @@ -62,8 +63,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# Build for both Rocky Linux 8 and 9
platform: ['rocky8', 'rocky9']
# Build for both Rocky Linux 8 and 9, ubuntu 22.04
platform: ['rocky8', 'rocky9', 'ubuntu22.04']

steps:
# Checkout repository code
Expand All @@ -87,6 +88,8 @@ jobs:
- 'images/docker/cbdb/test/rocky8/**'
rocky9:
- 'images/docker/cbdb/test/rocky9/**'
ubuntu22.04:
- 'images/docker/cbdb/test/ubuntu22.04/**'

# Skip if no changes for current platform
- name: Skip if not relevant
Expand Down
11 changes: 11 additions & 0 deletions build_automation/cloudberry/scripts/cloudberry-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,14 @@ log_completion() {
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
echo "${script_name} execution completed successfully at ${timestamp}" | tee -a "${log_file}"
}

detect_os() {
if [ -f /etc/os-release ]; then
. /etc/os-release
OS_ID=$ID
OS_VERSION=$VERSION_ID
else
echo "Unsupported system: cannot detect OS" >&2
exit 99
fi
}
22 changes: 14 additions & 8 deletions build_automation/cloudberry/scripts/configure-cloudberry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# - MapReduce Processing
# - Oracle Compatibility (orafce)
# - ORCA Query Optimizer
# - PAX Access Method
# - PXF External Table Access
# - Test Automation Support (tap-tests)
#
Expand Down Expand Up @@ -92,6 +91,11 @@ set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPT_DIR}/cloudberry-utils.sh"

# Call it before conditional logic
detect_os

echo "Detected OS: $OS_ID $OS_VERSION"

# Define log directory and files
export LOG_DIR="${SRC_DIR}/build-logs"
CONFIGURE_LOG="${LOG_DIR}/configure.log"
Expand All @@ -103,11 +107,14 @@ init_environment "Cloudberry Configure Script" "${CONFIGURE_LOG}"
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
execute_cmd sudo mkdir -p ${BUILD_DESTINATION}/lib || exit 2
if [[ "$OS_ID" == "rocky" && "$OS_VERSION" =~ ^(8|9) ]]; then
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
fi
execute_cmd sudo chown -R gpadmin:gpadmin ${BUILD_DESTINATION} || exit 2

log_section_end "Initial Setup"

# Set environment
Expand All @@ -120,7 +127,6 @@ CONFIGURE_DEBUG_OPTS=""

if [ "${ENABLE_DEBUG:-false}" = "true" ]; then
CONFIGURE_DEBUG_OPTS="--enable-debug \
--enable-profiling \
--enable-cassert \
--enable-debug-extensions"
fi
Expand All @@ -134,7 +140,7 @@ execute_cmd ./configure --prefix=/usr/local/cloudberry-db \
--enable-mapreduce \
--enable-orafce \
--enable-orca \
--enable-pax \
--enable-pax \
--enable-pxf \
--enable-tap-tests \
${CONFIGURE_DEBUG_OPTS} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ init_environment "Cloudberry Demo Cluster Script" "${CLUSTER_LOG}"

# Setup environment
log_section "Environment Setup"
source /usr/local/cloudberry-db/cloudberry-env.sh || exit 1
source ${BUILD_DESTINATION}/cloudberry-env.sh || exit 1
log_section_end "Environment Setup"

# Verify SSH access
Expand Down
196 changes: 196 additions & 0 deletions images/docker/cbdb/build/ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# --------------------------------------------------------------------
#
# 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.
#
# --------------------------------------------------------------------
#
# Apache Cloudberry (incubating) is an effort undergoing incubation at
# the Apache Software Foundation (ASF), sponsored by the Apache
# Incubator PMC.
#
# Incubation is required of all newly accepted projects until a
# further review indicates that the infrastructure, communications,
# and decision making process have stabilized in a manner consistent
# with other successful ASF projects.
#
# While incubation status is not necessarily a reflection of the
# completeness or stability of the code, it does indicate that the
# project has yet to be fully endorsed by the ASF.
#
# --------------------------------------------------------------------
# Dockerfile for Apache Cloudberry Base Environment
# --------------------------------------------------------------------
# This Dockerfile sets up a Ubuntu jammy 22.04 -based container to serve as
# a base environment for evaluating the Apache Cloudberry. It installs
# necessary system utilities, configures the environment for SSH access,
# and sets up a 'gpadmin' user with sudo privileges. The Apache Cloudberry
# DEB can be installed into this container for testing and
# functional verification.
#
# Key Features:
# - Locale setup for en_US.UTF-8
# - SSH daemon setup for remote access
# - Essential system utilities installation
# - Separate user creation and configuration steps
#
# Security Considerations:
# - This Dockerfile prioritizes ease of use for functional testing and
# evaluation. It includes configurations such as passwordless sudo access
# for the 'gpadmin' user and SSH access with password authentication.
# - These configurations are suitable for testing and development but
# should NOT be used in a production environment due to potential security
# risks.
#
# Usage:
# docker build -t cloudberry-db-base-env .
# docker run -h cdw -it cloudberry-db-base-env
# --------------------------------------------------------------------

FROM ubuntu:22.04

# Argument for configuring the timezone
ARG TIMEZONE_VAR="Europe/London"

# Environment variables for locale and user
ENV container=docker
ENV LANG=en_US.UTF-8
ENV USER=gpadmin
ENV TZ=${TIMEZONE_VAR}
ENV DEBIAN_FRONTEND=noninteractive

# --------------------------------------------------------------------
# Install Development Tools and Utilities
# --------------------------------------------------------------------

RUN apt-get update && \
apt-get install -y -qq \
htop \
bat \
silversearcher-ag \
vim \
wget && \
apt-get install -y -qq locales && \
locale-gen "en_US.UTF-8" && \
update-locale LANG="en_US.UTF-8" && \
apt-get install -y -qq \
bison \
build-essential \
cmake \
dpkg-dev \
fakeroot \
flex \
g++-11 \
gcc-11 \
git \
iproute2 \
iputils-ping \
libapr1-dev \
libbz2-dev \
libcurl4-gnutls-dev \
libevent-dev \
libipc-run-perl \
libkrb5-dev \
libldap-dev \
liblz4-dev \
libpam0g-dev \
libperl-dev \
libprotobuf-dev \
libreadline-dev \
libssl-dev \
libuv1-dev \
libxerces-c-dev \
libxml2-dev \
libyaml-dev \
libzstd-dev \
lsof \
make \
openssh-server \
pkg-config \
protobuf-compiler \
python3-distutils \
python3-pip \
python3-setuptools \
python3.10 \
python3.10-dev \
rsync \
sudo \
tzdata \
zlib1g-dev && \
apt-get install -y -qq \
ca-certificates-java \
cgroup-tools \
curl \
debhelper \
libaprutil1-dev \
libcgroup1 \
ninja-build \
quilt \
unzip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
cd && GO_VERSION="go1.23.4" && \
ARCH=$(uname -m) && \
if [ "${ARCH}" = "aarch64" ]; then \
GO_ARCH="arm64" && \
GO_SHA256="16e5017863a7f6071363782b1b8042eb12c6ca4f4cd71528b2123f0a1275b13e"; \
elif [ "${ARCH}" = "x86_64" ]; then \
GO_ARCH="amd64" && \
GO_SHA256="6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971"; \
else \
echo "Unsupported architecture: ${ARCH}" && exit 1; \
fi && \
GO_URL="https://go.dev/dl/${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
wget -nv "${GO_URL}" && \
echo "${GO_SHA256} ${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | sha256sum -c - && \
tar xf "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
mv go "/usr/local/${GO_VERSION}" && \
ln -s "/usr/local/${GO_VERSION}" /usr/local/go && \
rm -f "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/go.sh > /dev/null

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && \
update-alternatives --install /usr/bin/x86_64-linux-gnu-gcc x86_64-linux-gnu-gcc /usr/bin/gcc-11 100 && \
update-alternatives --set gcc /usr/bin/gcc-11 && \
update-alternatives --set g++ /usr/bin/g++-11

# --------------------------------------------------------------------
# Copy Configuration Files and Setup the Environment
# --------------------------------------------------------------------

COPY ./configs/* /tmp/

RUN cp /tmp/90-cbdb-limits /etc/security/limits.d/90-cbdb-limits && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
chmod 755 /tmp/init_system.sh && \
/usr/sbin/groupadd gpadmin && \
/usr/sbin/useradd -m -g gpadmin gpadmin && \
echo 'gpadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/90-gpadmin && \
chmod 0440 /etc/sudoers.d/90-gpadmin && \
ssh-keygen -A && \
mkdir /var/run/sshd && chmod 0755 /var/run/sshd

# Install testinfra via pip
RUN pip3 install pytest-testinfra

# Example: Copying test files into the container
COPY tests /tests

USER gpadmin
WORKDIR /home/gpadmin

CMD ["bash","-c","/tmp/init_system.sh"]
32 changes: 32 additions & 0 deletions images/docker/cbdb/build/ubuntu22.04/configs/90-cbdb-limits
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# /etc/security/limits.d/90-db-limits
# --------------------------------------------------------------------
#
# 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.
#
# --------------------------------------------------------------------

# Core dump file size limits for gpadmin
gpadmin soft core unlimited
gpadmin hard core unlimited

# Open file limits for gpadmin
gpadmin soft nofile 524288
gpadmin hard nofile 524288

# Process limits for gpadmin
gpadmin soft nproc 131072
gpadmin hard nproc 131072
Loading