Skip to content

Commit f8ae50d

Browse files
authored
Merge pull request #1 from leborchuk/AddJammyBuild
Add jammy build
2 parents e06dd83 + 55c129d commit f8ae50d

File tree

14 files changed

+1148
-9
lines changed

14 files changed

+1148
-9
lines changed

.github/workflows/docker-cbdb-build-containers.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ on:
6060
paths:
6161
- 'images/docker/cbdb/build/rocky8/**'
6262
- 'images/docker/cbdb/build/rocky9/**'
63+
- 'images/docker/cbdb/build/ubuntu22.04/**'
6364
workflow_dispatch: # Manual trigger
6465

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

8182
steps:
8283
# Checkout repository code with full history
@@ -103,6 +104,8 @@ jobs:
103104
- 'images/docker/cbdb/build/rocky8/**'
104105
rocky9:
105106
- 'images/docker/cbdb/build/rocky9/**'
107+
ubuntu22.04:
108+
- 'images/docker/cbdb/build/ubuntu22.04/**'
106109
107110
# Set up QEMU for multi-architecture support
108111
# This allows building ARM64 images on AMD64 infrastructure and vice versa

.github/workflows/docker-cbdb-test-containers.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ on:
4949
paths:
5050
- 'images/docker/cbdb/test/rocky8/**'
5151
- 'images/docker/cbdb/test/rocky9/**'
52+
- 'images/docker/cbdb/test/ubuntu22.04/**'
5253
workflow_dispatch: # Manual trigger
5354

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

6869
steps:
6970
# Checkout repository code
@@ -87,6 +88,8 @@ jobs:
8788
- 'images/docker/cbdb/test/rocky8/**'
8889
rocky9:
8990
- 'images/docker/cbdb/test/rocky9/**'
91+
ubuntu22.04:
92+
- 'images/docker/cbdb/test/ubuntu22.04/**'
9093
9194
# Skip if no changes for current platform
9295
- name: Skip if not relevant

build_automation/cloudberry/scripts/cloudberry-utils.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,14 @@ log_completion() {
146146
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
147147
echo "${script_name} execution completed successfully at ${timestamp}" | tee -a "${log_file}"
148148
}
149+
150+
detect_os() {
151+
if [ -f /etc/os-release ]; then
152+
. /etc/os-release
153+
OS_ID=$ID
154+
OS_VERSION=$VERSION_ID
155+
else
156+
echo "Unsupported system: cannot detect OS" >&2
157+
exit 99
158+
fi
159+
}

build_automation/cloudberry/scripts/configure-cloudberry.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# - MapReduce Processing
3434
# - Oracle Compatibility (orafce)
3535
# - ORCA Query Optimizer
36-
# - PAX Access Method
3736
# - PXF External Table Access
3837
# - Test Automation Support (tap-tests)
3938
#
@@ -92,6 +91,11 @@ set -euo pipefail
9291
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9392
source "${SCRIPT_DIR}/cloudberry-utils.sh"
9493

94+
# Call it before conditional logic
95+
detect_os
96+
97+
echo "Detected OS: $OS_ID $OS_VERSION"
98+
9599
# Define log directory and files
96100
export LOG_DIR="${SRC_DIR}/build-logs"
97101
CONFIGURE_LOG="${LOG_DIR}/configure.log"
@@ -104,9 +108,12 @@ log_section "Initial Setup"
104108
execute_cmd sudo rm -rf /usr/local/cloudberry-db || exit 2
105109
execute_cmd sudo chmod a+w /usr/local || exit 2
106110
execute_cmd mkdir -p /usr/local/cloudberry-db/lib || exit 2
107-
execute_cmd sudo cp /usr/local/xerces-c/lib/libxerces-c.so \
108-
/usr/local/xerces-c/lib/libxerces-c-3.3.so \
109-
/usr/local/cloudberry-db/lib || exit 3
111+
if [[ "$OS_ID" == "rocky" && "$OS_VERSION" =~ ^(8|9) ]]; then
112+
execute_cmd sudo cp /usr/local/xerces-c/lib/libxerces-c.so \
113+
/usr/local/xerces-c/lib/libxerces-c-3.3.so \
114+
/usr/local/cloudberry-db/lib || exit 3
115+
fi
116+
110117
execute_cmd sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db || exit 2
111118
log_section_end "Initial Setup"
112119

@@ -120,7 +127,6 @@ CONFIGURE_DEBUG_OPTS=""
120127

121128
if [ "${ENABLE_DEBUG:-false}" = "true" ]; then
122129
CONFIGURE_DEBUG_OPTS="--enable-debug \
123-
--enable-profiling \
124130
--enable-cassert \
125131
--enable-debug-extensions"
126132
fi
@@ -134,7 +140,7 @@ execute_cmd ./configure --prefix=/usr/local/cloudberry-db \
134140
--enable-mapreduce \
135141
--enable-orafce \
136142
--enable-orca \
137-
--enable-pax \
143+
--enable-pax \
138144
--enable-pxf \
139145
--enable-tap-tests \
140146
${CONFIGURE_DEBUG_OPTS} \
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# --------------------------------------------------------------------
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed
5+
# with this work for additional information regarding copyright
6+
# ownership. The ASF licenses this file to You under the Apache
7+
# License, Version 2.0 (the "License"); you may not use this file
8+
# except in compliance with the License. You may obtain a copy of the
9+
# License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16+
# implied. See the License for the specific language governing
17+
# permissions and limitations under the License.
18+
#
19+
# --------------------------------------------------------------------
20+
#
21+
# Apache Cloudberry (incubating) is an effort undergoing incubation at
22+
# the Apache Software Foundation (ASF), sponsored by the Apache
23+
# Incubator PMC.
24+
#
25+
# Incubation is required of all newly accepted projects until a
26+
# further review indicates that the infrastructure, communications,
27+
# and decision making process have stabilized in a manner consistent
28+
# with other successful ASF projects.
29+
#
30+
# While incubation status is not necessarily a reflection of the
31+
# completeness or stability of the code, it does indicate that the
32+
# project has yet to be fully endorsed by the ASF.
33+
#
34+
# --------------------------------------------------------------------
35+
# Dockerfile for Apache Cloudberry Base Environment
36+
# --------------------------------------------------------------------
37+
# This Dockerfile sets up a Ubuntu jammy 22.04 -based container to serve as
38+
# a base environment for evaluating the Apache Cloudberry. It installs
39+
# necessary system utilities, configures the environment for SSH access,
40+
# and sets up a 'gpadmin' user with sudo privileges. The Apache Cloudberry
41+
# DEB can be installed into this container for testing and
42+
# functional verification.
43+
#
44+
# Key Features:
45+
# - Locale setup for en_US.UTF-8
46+
# - SSH daemon setup for remote access
47+
# - Essential system utilities installation
48+
# - Separate user creation and configuration steps
49+
#
50+
# Security Considerations:
51+
# - This Dockerfile prioritizes ease of use for functional testing and
52+
# evaluation. It includes configurations such as passwordless sudo access
53+
# for the 'gpadmin' user and SSH access with password authentication.
54+
# - These configurations are suitable for testing and development but
55+
# should NOT be used in a production environment due to potential security
56+
# risks.
57+
#
58+
# Usage:
59+
# docker build -t cloudberry-db-base-env .
60+
# docker run -h cdw -it cloudberry-db-base-env
61+
# --------------------------------------------------------------------
62+
63+
FROM ubuntu:22.04
64+
65+
# Argument for configuring the timezone
66+
ARG TIMEZONE_VAR="Europe/London"
67+
68+
# Environment variables for locale and user
69+
ENV container=docker
70+
ENV LANG=en_US.UTF-8
71+
ENV USER=gpadmin
72+
ENV TZ=${TIMEZONE_VAR}
73+
ENV DEBIAN_FRONTEND=noninteractive
74+
75+
# --------------------------------------------------------------------
76+
# Install Development Tools and Utilities
77+
# --------------------------------------------------------------------
78+
79+
RUN sed -i "s/archive.ubuntu.com/mirror.yandex.ru/g" /etc/apt/sources.list && \
80+
apt-get update && \
81+
apt-get install -y -qq \
82+
htop \
83+
bat \
84+
silversearcher-ag \
85+
vim \
86+
wget && \
87+
apt-get install -y -qq locales && \
88+
locale-gen "en_US.UTF-8" && \
89+
update-locale LANG="en_US.UTF-8" && \
90+
apt-get install -y -qq \
91+
bison \
92+
build-essential \
93+
cmake \
94+
dpkg-dev \
95+
fakeroot \
96+
flex \
97+
g++-11 \
98+
gcc-11 \
99+
git \
100+
iproute2 \
101+
iputils-ping \
102+
libapr1-dev \
103+
libbz2-dev \
104+
libcurl4-gnutls-dev \
105+
libevent-dev \
106+
libipc-run-perl \
107+
libkrb5-dev \
108+
libldap-dev \
109+
liblz4-dev \
110+
libpam0g-dev \
111+
libperl-dev \
112+
libprotobuf-dev \
113+
libreadline-dev \
114+
libssl-dev \
115+
libuv1-dev \
116+
libxerces-c-dev \
117+
libxml2-dev \
118+
libyaml-dev \
119+
libzstd-dev \
120+
lsof \
121+
make \
122+
openssh-server \
123+
pkg-config \
124+
protobuf-compiler \
125+
python3-distutils \
126+
python3-pip \
127+
python3-setuptools \
128+
python3.10 \
129+
python3.10-dev \
130+
rsync \
131+
sudo \
132+
tzdata \
133+
zlib1g-dev && \
134+
apt-get clean && rm -rf /var/lib/apt/lists/* && \
135+
cd && GO_VERSION="go1.23.4" && \
136+
ARCH=$(uname -m) && \
137+
if [ "${ARCH}" = "aarch64" ]; then \
138+
GO_ARCH="arm64" && \
139+
GO_SHA256="16e5017863a7f6071363782b1b8042eb12c6ca4f4cd71528b2123f0a1275b13e"; \
140+
elif [ "${ARCH}" = "x86_64" ]; then \
141+
GO_ARCH="amd64" && \
142+
GO_SHA256="6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971"; \
143+
else \
144+
echo "Unsupported architecture: ${ARCH}" && exit 1; \
145+
fi && \
146+
GO_URL="https://go.dev/dl/${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
147+
wget -nv "${GO_URL}" && \
148+
echo "${GO_SHA256} ${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | sha256sum -c - && \
149+
tar xf "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
150+
mv go "/usr/local/${GO_VERSION}" && \
151+
ln -s "/usr/local/${GO_VERSION}" /usr/local/go && \
152+
rm -f "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
153+
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/go.sh > /dev/null
154+
155+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \
156+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && \
157+
update-alternatives --install /usr/bin/x86_64-linux-gnu-gcc x86_64-linux-gnu-gcc /usr/bin/gcc-11 100 && \
158+
update-alternatives --set gcc /usr/bin/gcc-11 && \
159+
update-alternatives --set g++ /usr/bin/g++-11
160+
161+
# --------------------------------------------------------------------
162+
# Copy Configuration Files and Setup the Environment
163+
# --------------------------------------------------------------------
164+
165+
COPY ./configs/* /tmp/
166+
167+
RUN cp /tmp/90-cbdb-limits /etc/security/limits.d/90-cbdb-limits && \
168+
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
169+
echo $TZ > /etc/timezone && \
170+
chmod 755 /tmp/init_system.sh && \
171+
/usr/sbin/groupadd gpadmin && \
172+
/usr/sbin/useradd -m -g gpadmin gpadmin && \
173+
echo 'gpadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/90-gpadmin && \
174+
chmod 0440 /etc/sudoers.d/90-gpadmin && \
175+
ssh-keygen -A && \
176+
mkdir /var/run/sshd && chmod 0755 /var/run/sshd
177+
178+
# Install testinfra via pip
179+
RUN pip3 install pytest-testinfra
180+
181+
# Example: Copying test files into the container
182+
COPY tests /tests
183+
184+
USER gpadmin
185+
WORKDIR /home/gpadmin
186+
187+
CMD ["bash","-c","/tmp/init_system.sh"]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# /etc/security/limits.d/90-db-limits
2+
# --------------------------------------------------------------------
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed
6+
# with this work for additional information regarding copyright
7+
# ownership. The ASF licenses this file to You under the Apache
8+
# License, Version 2.0 (the "License"); you may not use this file
9+
# except in compliance with the License. You may obtain a copy of the
10+
# License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17+
# implied. See the License for the specific language governing
18+
# permissions and limitations under the License.
19+
#
20+
# --------------------------------------------------------------------
21+
22+
# Core dump file size limits for gpadmin
23+
gpadmin soft core unlimited
24+
gpadmin hard core unlimited
25+
26+
# Open file limits for gpadmin
27+
gpadmin soft nofile 524288
28+
gpadmin hard nofile 524288
29+
30+
# Process limits for gpadmin
31+
gpadmin soft nproc 131072
32+
gpadmin hard nproc 131072

0 commit comments

Comments
 (0)