Skip to content
Draft
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
34 changes: 30 additions & 4 deletions .github/workflows/greengage-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
- target_os: ubuntu
- target_os: ubuntu
target_os_version: "24.04"
- target_os: rockylinux
target_os_version: "8"
- target_os: rockylinux
target_os_version: "9"
permissions:
contents: read # Explicit for default behavior
packages: write # Required for GHCR access
actions: write # Required for artifact upload
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-build.yml@v33
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-build.yml@v42
with:
version: 6
target_os: ${{ matrix.target_os }}
Expand All @@ -48,7 +52,7 @@ jobs:
contents: read # Explicit for default behavior
packages: read # Explicit for GHCR access clarity
actions: write # Required for artifact upload
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-tests-behave.yml@v28
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-tests-behave.yml@v46
with:
version: 6
target_os: ${{ matrix.target_os }}
Expand All @@ -69,14 +73,36 @@ jobs:
contents: read # Explicit for default behavior
packages: read # Explicit for GHCR access clarity
actions: write # Required for artifact upload
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-tests-regression.yml@v28
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-tests-regression.yml@v46
with:
version: 6
target_os: ${{ matrix.target_os }}
target_os_version: ${{ matrix.target_os_version }}
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}

coverage:
needs: [behave-tests, regression-tests]
if: github.event_name == 'pull_request' && needs.behave-tests.result == 'success' && needs.regression-tests.result == 'success'
strategy:
fail-fast: false
matrix:
include:
- target_os: ubuntu
target_os_version: "24.04"
permissions:
contents: read
packages: read
actions: write
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-coverage.yml@v46
with:
version: 6
target_os: ${{ matrix.target_os }}
target_os_version: ${{ matrix.target_os_version }}
coverage_threshold: 75
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}

orca-tests:
needs: build
if: github.event_name == 'pull_request' # Only for PR
Expand Down Expand Up @@ -154,7 +180,7 @@ jobs:
contents: read # Explicit for default behavior
packages: write # Required for GHCR access
actions: write # Required for artifact upload
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-package.yml@v38
uses: greengagedb/greengage-ci/.github/workflows/greengage-reusable-package.yml@v44
with:
version: 6
target_os: ${{ matrix.target_os }}
Expand Down
76 changes: 59 additions & 17 deletions README.Rhel-Rocky.bash
Original file line number Diff line number Diff line change
@@ -1,21 +1,57 @@
#!/bin/bash
# FILE: README.Rhel-Rocky.bash
# CONTEXT: Called from ci/Dockerfile.rockylinux for Greengage build
# PURPOSE: Install build dependencies, compile zstd static library,
# Install Python based on OS version

sudo dnf -y update
sudo dnf -y install epel-release
sudo dnf -y install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled devel
sudo dnf makecache
set -eux

sudo dnf -y install\
dnf -y install epel-release

# Detect OS version if not already set
export OS_VERSION="${OS_VERSION:-$(grep -oP '(?<= release )\d+' /etc/redhat-release)}"

case "$OS_VERSION" in
8)
dnf config-manager --set-enabled powertools
python_packages="python2 python2-devel python2-setuptools \
python3 python3-devel python3-setuptools"
perl_packages="perl-Env perl-ExtUtils-Embed \
perl-IPC-Run perl-JSON perl-Test-Base"
;;
9)
dnf config-manager --set-enabled crb
python_packages="python3.11 python3.11-devel python3.11-setuptools"
perl_packages="perl-Env perl-ExtUtils-Embed \
perl-IPC-Run perl-JSON perl-Test-Base \
perl-Opcode perl-Test-Simple perl-Thread-Queue perl-devel"
;;
*)
echo "Unsupported Rocky Linux version: $OS_VERSION"
exit 1
;;
esac
# shellcheck disable=SC2086 # intentional: word splitting for package lists
dnf -y install \
apr-devel \
apr-util-devel \
autoconf \
bison \
bzip2-devel \
cmake3 \
cmake \
expat-devel \
flex \
gcc \
gcc-c++ \
git \
glibc-langpack-en \
gperf \
indent \
iproute \
java-11-openjdk-devel \
jq \
krb5-devel \
krb5-server \
krb5-workstation \
libcurl-devel \
libevent-devel \
libicu \
Expand All @@ -29,18 +65,24 @@ sudo dnf -y install\
lsof \
net-tools \
openldap-devel \
openssl \
openssh-server \
openssl-devel \
pam-devel \
perl-Env \
perl-ExtUtils-Embed \
perl-IPC-Run \
perl-JSON \
perl-Test-Base \
procps-ng \
python2-devel \
python2-pip \
readline-devel \
rsync \
snappy-devel \
sudo \
time \
unzip \
vim \
wget \
xerces-c-devel \
zlib-devel
zlib-devel \
$python_packages $perl_packages

# Build zstd with static library (not available as a package on Rocky)
curl -Ls https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz | tar -xzf -
make -j"$(nproc)" -C zstd-1.4.4
make install PREFIX=/usr/local -C zstd-1.4.4
rm -rf zstd-1.4.4
12 changes: 1 addition & 11 deletions README.linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@
```
Note: CentOS 7 is EOL — configure `yum` to use a valid repo (e.g., `vault.centos.org`) before installing dependencies.

## For RHEL/Rocky 8:
## For RHEL/Rocky (versions 8 or 9):

- Install dependencies using README.Rhel-Rocky.bash script:
```bash
./README.Rhel-Rocky.bash
```

- Build and install zstd with static library, e.g.:
```bash
cd /tmp
curl -LO https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz
tar -xf zstd-1.4.4.tar.gz
cd zstd-1.4.4
make -j$(nproc)
sudo make install PREFIX=/usr/local
```

- Create symbolic link to Python 2 in `/usr/bin`:

```bash
Expand Down
82 changes: 82 additions & 0 deletions ci/Dockerfile.rockylinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# FILE: ci/Dockerfile.rockylinux
# CONTEXT: Build Greengage on Rocky Linux <OS_VERSION>
# PURPOSE: Multi-stage Docker build for Greengage database

ARG OS_VERSION=8

FROM rockylinux:${OS_VERSION} AS base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /home/gpadmin

ARG OS_VERSION
ENV OS_VERSION=${OS_VERSION}

COPY README.Rhel-Rocky.bash ./
COPY gpMgmt/bin/gpload_test/pytest_requirement.txt ./
RUN set -eux; \
./README.Rhel-Rocky.bash; \
rm README.Rhel-Rocky.bash; \
# Set Python as default based on OS version
case "$OS_VERSION" in \
8) \
ln -sf /usr/bin/python2 /usr/bin/python; \
PIP_PACKAGES='allure-behave==2.4.0 mock==3.0.5 psi==0.3b3 future==0.16'; \
;; \
9) \
ln -sf /usr/bin/python3.11 /usr/bin/python; \
python -m ensurepip --upgrade; \
PIP_PACKAGES='allure-behave==2.4.0 future==1.0.0'; \
;; \
*) \
echo "Unsupported Rocky Linux version: $OS_VERSION"; \
exit 1; \
;; \
esac; \
# Install pg_bsd_indent used by pgindent utility
wget --progress=dot:giga --no-hsts https://ftp.postgresql.org/pub/dev/pg_bsd_indent-1.3.tar.gz -O - | tar -xzf -; \
make install -C pg_bsd_indent; \
rm -r pg_bsd_indent; \
# To run sshd directly, but not using service
mkdir -p /run/sshd; \
# Alter precedence in favor of IPv4 during resolving
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf; \
# Upgrade pip to support current package versions
python -m pip install --no-cache-dir --upgrade pip; \
# Install allure-behave for behave tests
python -m pip install --no-cache-dir $PIP_PACKAGES; \
# Install pytest for gpload test
python -m pip install --no-cache-dir --requirement pytest_requirement.txt; \
rm pytest_requirement.txt; \
# Cleanup to reduce image size
dnf clean all; \
rm -rf /tmp/* /var/tmp/* /var/cache/man/

ENV LANG=en_US.UTF-8
ENV CONFIGURE_FLAGS="--enable-debug-extensions --with-gssapi --enable-cassert --enable-debug --enable-depend"

FROM base AS build

COPY . gpdb_src

RUN mkdir bin_gpdb

ENV TARGET_OS=rockylinux \
OUTPUT_ARTIFACT_DIR=bin_gpdb

# Use python3 to compile into GPDB's plpython3u
# Set PYTHON3 only on Rocky 8 to avoid compiling plpython3 twice
# On Rocky 9, Python 3 is the default
RUN test "$OS_VERSION" -eq 8 && export PYTHON3=python3; \
gpdb_src/concourse/scripts/compile_gpdb.bash

FROM base AS code
COPY . gpdb_src
RUN rm -rf gpdb_src/.git/

FROM base AS test

COPY --from=code /home/gpadmin/gpdb_src gpdb_src
COPY --from=build /home/gpadmin/bin_gpdb bin_gpdb
COPY --from=build /home/gpadmin/gpdb_src/VERSION gpdb_src

RUN make -C gpdb_src/src/tools/entab install clean
12 changes: 12 additions & 0 deletions ci/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ To build an image based on Ubuntu 24.04, specify the version in build args:
docker build -t gpdb6_regress:latest --build-arg OS_VERSION=24.04 -f ci/Dockerfile.ubuntu .
```

To build a Rocky Linux 8 image:

```bash
docker build -t gpdb6_rockylinux8:latest -f ci/Dockerfile.rockylinux .
```

To build a Rocky Linux 9 image:

```bash
docker build -t gpdb6_rockylinux9:latest --build-arg OS_VERSION=9 -f ci/Dockerfile.rockylinux .
```

There are two additional options in [Dockerfile](./Dockerfile) to passthrough urls for [sigar](https://github.com/hyperic/sigar) packages:

* `--build-arg sigar=https://path_to_sigar.rpm` for package with sigar library
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/run_behave_tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ run_feature() {
-e FEATURE="$feature" -e PROJECT="$project" \
cdw bash -eux <<'EOF'
set -ex
source /usr/local/greengage-db-devel/greengage_path.sh
cd /tmp/coverage-data

if [ "$(ls "$PROJECT"-coverage-data/ | wc -l)" -gt 0 ]; then
Expand Down
12 changes: 5 additions & 7 deletions concourse/scripts/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ function set_env() {
}

function os_id() {
if [[ ! -f "/etc/altlinux-release" ]] && [[ -f "/etc/redhat-release" ]]; then
echo "centos"
else
echo "$(
. /etc/os-release
echo "${ID}"
)"
if [[ -f "/etc/os-release" ]]; then
. /etc/os-release
elif [[ -f "/etc/redhat-release" ]]; then
ID="centos"
fi
echo "${ID}"
}

function os_version() {
Expand Down
12 changes: 12 additions & 0 deletions concourse/scripts/ic_gpdb.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ function gen_env(){
export TEST_PGFDW=1
export COVERAGE_PROCESS_START="\${1}/gpdb_src/gpMgmt/test/coveragerc_unit"
make -s ${MAKE_TEST_COMMAND}

cd /tmp/coverage-data
if [ "\$(ls coverage-data* 2>/dev/null | wc -l)" -gt 0 ]; then
coverage combine --append --keep \
--rcfile=/home/gpadmin/gpdb_src/gpMgmt/test/coveragerc_combine_report \
coverage-data*
coverage html \
--rcfile=/home/gpadmin/gpdb_src/gpMgmt/test/coveragerc_combine_report \
--show-contexts -d ./coverage-html
else
echo "No coverage-data files found, skipping coverage report"
fi
EOF

chmod a+x /opt/run_test.sh
Expand Down
1 change: 1 addition & 0 deletions concourse/scripts/setup_gpadmin_user.bash
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ setup_sshd() {
# Disable password authentication so builds never hang given bad keys
sed -ri 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config

echo "MaxStartups 100:30:200" >> /etc/ssh/sshd_config

case "$TEST_OS" in
centos6 | sles*)
Expand Down
3 changes: 2 additions & 1 deletion gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def checkTableForeignKey(self, cat):
# skip these master-only tables
skipped_masteronly = ['gp_relation_node', 'pg_description',
'pg_shdescription', 'pg_stat_last_operation',
'pg_stat_last_shoperation', 'pg_statistic']
'pg_stat_last_shoperation', 'pg_statistic',
'pg_event_trigger']

if catname in skipped_masteronly:
return
Expand Down
2 changes: 2 additions & 0 deletions gpMgmt/bin/gppylib/commands/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,8 @@ def start_standbymaster(host, datadir, port, era=None,
wrapper=None, wrapper_args=None):
logger.info("Starting standby master")

datadir = os.path.normpath(datadir)

logger.info("Checking if standby master is running on host: %s in directory: %s" % (host,datadir))
cmd = Command("recovery_startup",
("python -c "
Expand Down
1 change: 1 addition & 0 deletions gpMgmt/bin/gppylib/gpcatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class GPCatalogException(Exception):
'pg_stat_last_shoperation',
'pg_statistic',
'pg_partition_encoding',
'pg_event_trigger'
]

# Hard coded tables that have different values on every segment
Expand Down
Loading
Loading