Skip to content

Commit 6a0682e

Browse files
committed
Package: update rpm and deb package files
Main changes are included: * Rename package from pxf-gpX to cloudberry-pxf * Update installation paths to /usr/local/cloudberry-pxf-[VERSION] * Remove legacy pxf-gp7.spec and pxf-cbdb1.spec files * Update DEBIAN package control files with new naming * Standardize package configuration based on cloudberry-pxf.spec
1 parent da1253e commit 6a0682e

12 files changed

Lines changed: 50 additions & 210 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ endif
9898
set -e ;\
9999
GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version) ;\
100100
GP_BUILD_ARCH=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/build_arch) ;\
101-
PXF_PACKAGE_NAME=pxf-cbdb$${GP_MAJOR_VERSION}-$${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
101+
PXF_PACKAGE_NAME=pxf-cloudberry$${GP_MAJOR_VERSION}-$${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
102102
mkdir -p build/stage/$${PXF_PACKAGE_NAME} ;\
103103
cp -a $(SOURCE_EXTENSION_DIR)/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
104104
cp -a cli/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
@@ -118,14 +118,14 @@ gppkg-rpm: rpm
118118
mkdir -p gppkg/deps
119119
GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version)
120120
cat package/gppkg_spec.yml.in | sed "s,#arch,`arch`," | sed "s,#os,$(TEST_OS)," | sed "s,#gppkgver,1.0," | sed "s,#gpver,1," > gppkg/gppkg_spec.yml
121-
find build/rpmbuild/RPMS -name pxf-cbdb$(GP_MAJOR_VERSION)-*.rpm -exec cp {} gppkg/ \;
121+
find build/rpmbuild/RPMS -name pxf-cloudberry$(GP_MAJOR_VERSION)-*.rpm -exec cp {} gppkg/ \;
122122
source $(GPHOME)/greenplum_path.sh || source $(GPHOME)/cloudberry-env.sh && gppkg --build gppkg
123123

124124
rpm: stage
125125
set -e ;\
126126
GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version) ;\
127127
GP_BUILD_ARCH=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/build_arch) ;\
128-
PXF_PACKAGE_NAME=pxf-cbdb$${GP_MAJOR_VERSION}-${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
128+
PXF_PACKAGE_NAME=pxf-cloudberry$${GP_MAJOR_VERSION}-${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
129129
PXF_FULL_VERSION=${PXF_VERSION} ;\
130130
PXF_MAIN_VERSION=$$(echo $${PXF_FULL_VERSION} | sed -E 's/(-SNAPSHOT|-rc[0-9]+)$$//') ;\
131131
if [[ $${PXF_FULL_VERSION} == *"-SNAPSHOT" ]]; then \

package/DEBIAN/conffiles

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/usr/local/pxf-gp6/conf/pxf-application.properties
2-
/usr/local/pxf-gp6/conf/pxf-env.sh
3-
/usr/local/pxf-gp6/conf/pxf-log4j2.xml
4-
/usr/local/pxf-gp6/conf/pxf-profiles.xml
1+
/usr/local/cloudberry-pxf/conf/pxf-application.properties
2+
/usr/local/cloudberry-pxf/conf/pxf-env.sh
3+
/usr/local/cloudberry-pxf/conf/pxf-log4j2.xml
4+
/usr/local/cloudberry-pxf/conf/pxf-profiles.xml

package/DEBIAN/control

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Package: pxf-gp6
1+
Package: cloudberry-pxf
22
Version: %VERSION%
3-
Architecture: amd64
3+
Architecture: %ARCH%
44
Maintainer: %MAINTAINER%
5-
Description: Greenplum PXF framework for external data access
5+
Description: Apache Cloudberry PXF (Platform Extension Framework) for advanced data access

package/DEBIAN/postinst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

3-
sed -i "s|directory =.*|directory = '/usr/local/pxf-gp6/gpextable/'|g" /usr/local/pxf-gp6/gpextable/pxf.control
4-
sed -i "s|module_pathname =.*|module_pathname = '/usr/local/pxf-gp6/gpextable/pxf'|g" /usr/local/pxf-gp6/gpextable/pxf.control
3+
sed -i "s|directory =.*|directory = '/usr/local/cloudberry-pxf/gpextable/'|g" "/usr/local/cloudberry-pxf/gpextable/pxf.control"
4+
sed -i "s|module_pathname =.*|module_pathname = '/usr/local/cloudberry-pxf/gpextable/pxf'|g" "/usr/local/cloudberry-pxf/gpextable/pxf.control"

package/DEBIAN/prerm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22

3-
rm -f /usr/local/pxf-gp6/conf/pxf-private.classpath
4-
rm -rf /usr/local/pxf-gp6/pxf-service
5-
rm -rf /usr/local/pxf-gp6/run
3+
rm -f /usr/local/cloudberry-pxf/conf/pxf-private.classpath
4+
rm -rf /usr/local/cloudberry-pxf/pxf-service
5+
rm -rf /usr/local/cloudberry-pxf/run

package/README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
PXF Packaging
22
============
33

4-
PXF consists of 3 groups of artifacts, each developed using a different underlying technology:
4+
Apache Cloudberry PXF (Platform Extension Framework) consists of 3 groups of artifacts, each developed using a different underlying technology:
55

6-
* Greenplum extension -- written in C; when built, produces a `pxf.so` library and configuration files
6+
* Apache Cloudberry extension -- written in C; when built, produces a `pxf.so` library and configuration files
77
* PXF Server -- written in Java; when built, produces a `pxf.war` file, Tomcat server, dependent JAR files, templates and scripts
88
* Script Cluster Plugin -- written in Go; when built, produces a `pxf-cli` executable
99

10-
The PXF build system can create an RPM package on CentOs platform and a DEB package on Ubuntu platform,
11-
respectively. PXF compiles against and generates a different package for every major Greenplum version.
10+
The PXF build system can create an RPM package on CentOS platform and a DEB package on Ubuntu platform,
11+
respectively. PXF compiles against and generates packages for Apache Cloudberry.
1212

13-
For example, `pxf-gp5-1.2.3-1.el7.x86_64.rpm` represents an RPM package of PXF version 1.2.3 intended to work with
14-
Greenplum 5 on Centos / Redhat 7 operating systems.
13+
For example, `cloudberry-pxf-1.2.3-1.el7.x86_64.rpm` represents an RPM package of PXF version 1.2.3 intended to work with
14+
Apache Cloudberry on CentOS / Red Hat 7 operating systems.
1515

1616
## PXF RPM specification
17-
On Centos platforms PXF product is packaged as an RPM. The specification on how to build the RPM is provided by the
18-
`pxf-gpX.spec` files in this directory. The following key design decisions were made:
17+
On CentOS platforms PXF product is packaged as an RPM. The specification on how to build the RPM is provided by the
18+
`cloudberry-pxf.spec` file in this directory. The following key design decisions were made:
1919

20-
* the name of the RPM package is `pxf-gpX`, where X is the major Greenplum version (e.g. `pxf-gp5`, `pxf-gp6`)
21-
* to install a newer RPM package for the same Greenplum major release, a user will have to upgrade the PXF RPM
22-
* the RPM installs PXF server into `/usr/local/pxf-gpX` directory (e.g. `/usr/local/pxf-gp6`)
20+
* the name of the RPM package is `cloudberry-pxf`
21+
* to install a newer RPM package, a user will have to upgrade the PXF RPM
22+
* the RPM installs PXF server into `/usr/local/cloudberry-pxf-[VERSION]` directory (e.g. `/usr/local/cloudberry-pxf-1.2.3`)
2323
* the RPM is relocatable, a user can specify --prefix option when installing the RPM to install the server into another directory
24-
* the PXF greenplum extension is initially installed by RPM alongside the PXF server and is not initially active
25-
* the PXF greenplum extension is copied into Greenplum install location during `pxf init` command issued by a user after the install
24+
* the PXF Apache Cloudberry extension is initially installed by RPM alongside the PXF server and is not initially active
25+
* the PXF Apache Cloudberry extension is copied into Cloudberry install location during `pxf init` command issued by a user after the install
2626
* the PXF RPM version number follows 3-number semantic versioning and must be provided during the RPM build process
2727
* the PXF RPM release number is usually specified as `1`
28-
* example PXF RPM names are : `pxf-gp5-1.2.3-1.el6.x86_64.rpm` and `pxf-gp5-1.2.3-1.el7.x86_64.rpm`
28+
* example PXF RPM names are : `cloudberry-pxf-1.2.3-1.el7.x86_64.rpm` and `cloudberry-pxf-1.2.3-1.el8.x86_64.rpm`
2929

3030
## PXF RPM build process
3131

3232
To build an RPM, follow these steps:
3333
1. Install the `rpm-build` package: `sudo yum install rpm-build`
34-
2. Install Greenplum database
35-
3. Run `source $GPHOME/greenplum_path.sh` to configure your `PATH` to be able to find `pg_config` program
34+
2. Install Apache Cloudberry
35+
3. Run `source $GPHOME/greenplum_path.sh`(for Cloudberry 2.0) or `source $GPHOME/cloudberry-env.sh` (for Cloudberry 2.1+) to configure your `PATH` to be able to find `pg_config` program
3636
4. Run `make clean rpm` from the top-level directory to build artifacts and assemble the RPM
3737
5. The RPM will be available in `build/rpmbuild/RPMS` directory
3838

3939

4040
## PXF RPM installation process
4141
To install PXF from an RPM, follow these steps:
42-
1. Build or download PXF RPM for the corresponding major version of Greenplum. The following example will assume
43-
that PXF version `1.2.3` will be installed to work with with Greenplum 5.
44-
2. Decide which OS user will own the PXF installation. If PXF is installed alongside Greenplum, the user that owns the PXF
45-
installation should either be the same as the one owning the Greenplum installation or have write privilleges to the
46-
Greenplum installation directory. This is necessary to be able to register the PXF Greenplum extension with Greenplum.
42+
1. Build or download PXF RPM for Apache Cloudberry. The following example will assume
43+
that PXF version `1.2.3` will be installed to work with Apache Cloudberry.
44+
2. Decide which OS user will own the PXF installation. If PXF is installed alongside Apache Cloudberry, the user that owns the PXF
45+
installation should either be the same as the one owning the Cloudberry installation or have write privileges to the
46+
Cloudberry installation directory. This is necessary to be able to register the PXF Apache Cloudberry extension with Cloudberry.
4747
3. If a previous PXF version has been installed, stop the PXF server.
48-
4. As a superuser, run `rpm -Uvh pxf-gp5-1.2.3-1.el7.x86_64.rpm` to install the RPM into `/usr/local/pxf-gp5`
49-
5. As a superuser, run `chown gpadmin:gpadmin /usr/local/pxf-gp5` to change ownership of PXF installation to the user `gpadmin`.
48+
4. As a superuser, run `rpm -Uvh cloudberry-pxf-1.2.3-1.el7.x86_64.rpm` to install the RPM into `/usr/local/cloudberry-pxf-1.2.3`
49+
5. As a superuser, run `chown gpadmin:gpadmin /usr/local/cloudberry-pxf-1.2.3` to change ownership of PXF installation to the user `gpadmin`.
5050
Specify a different user other than `gpadmin`, if desired.
5151

5252
After these steps, the PXF product will be installed and is ready to be configured. If there was a previous installation of
53-
PXF for the same major Greenplum version, the files and the runtime directories from the older version will be removed.
53+
PXF, the files and the runtime directories from the older version will be removed.
5454
The PXF configuration directory should remain intact. You will need to have Java installed to run the PXF server.
5555

5656
## PXF removal process
5757
To remove the installed PXF package, follow these steps:
5858
1. Stop the PXF server.
59-
2. As a superuser, run `rpm -e pxf-gp5` (or `rpm -e pxf-gp6`). This will remove all files installed by the RPM package
59+
2. As a superuser, run `rpm -e cloudberry-pxf`. This will remove all files installed by the RPM package
6060
and the PXF runtime directories. The PXF configuration directory should remain intact.

package/cloudberry-pxf.spec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Requires: bash
2727
# installing on Cloudberry node, so inherit Cloudberry's dependencies
2828
# implicitly
2929

30-
Requires: cloudberry-db
31-
3230
# Weak dependencies either OpenJDK 8 or 11
3331
Suggests: java-1.8.0-openjdk
3432
Suggests: java-11-openjdk

package/install_binary

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ INSTALL_COMPONENT_SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
44
PXF_VERSION=$(<"${INSTALL_COMPONENT_SCRIPT_DIR}/pxf/version")
55

66
function show_help() {
7-
echo "This script installs PXF Greenplum Extension and PXF Server"
7+
echo "This script installs PXF Extension and PXF Server"
88
echo "to install the PXF Extension :"
9-
echo " set GPHOME environment variable to the installation directory of Greenplum Database"
9+
echo " set GPHOME environment variable to the installation directory of Apache Cloudberry"
1010
echo "to install the PXF Server :"
1111
echo " either set PXF_HOME environment variable to the target PXF Server installation directory"
1212
echo " or set GPHOME environment variable to have PXF Server installed into \${GPHOME}/pxf"
@@ -29,8 +29,8 @@ function check_gphome() {
2929
exit 1
3030
fi
3131
else
32-
if [[ ! -f ${GPHOME}/greenplum_path.sh ]]; then
33-
echo "Error: environment variable GPHOME (${GPHOME}) must be set to a valid Greenplum installation"
32+
if [[ ! -f ${GPHOME}/greenplum_path.sh ]] && [[ ! -f ${GPHOME}/cloudberry-env.sh ]]; then
33+
echo "Error: environment variable GPHOME (${GPHOME}) must be set to a valid Apache Cloudberry installation"
3434
exit 1
3535
fi
3636
if [[ -z "${PXF_HOME}" ]]; then
@@ -58,11 +58,11 @@ function install_new_component() {
5858
echo "Installing PXF version ${PXF_VERSION} ..."
5959

6060
if [[ ! -z "${GPHOME}" ]]; then
61-
echo "... installing PXF Greenplum Extension into ${GPHOME} ..."
61+
echo "... installing PXF Extension into ${GPHOME} ..."
6262
cp -av ${INSTALL_COMPONENT_SCRIPT_DIR}/{lib,share} ${GPHOME}
6363
check_status $?
6464
else
65-
echo "... skipping PXF Greenplum Extension as GPHOME environment variable is not set ..."
65+
echo "... skipping PXF Extension as GPHOME environment variable is not set ..."
6666
fi
6767

6868
if [[ ! -z "${PXF_HOME}" ]]; then

package/install_deb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if [[ "${owner}" != "root" ]]; then
1414
fi
1515

1616
${sudo_if_needed} dpkg --install ${INSTALL_COMPONENT_SCRIPT_DIR}/${DEB_FILE}
17-
${sudo_if_needed} chown --recursive ${owner} /usr/local/pxf-gp*
17+
${sudo_if_needed} chown --recursive ${owner} /usr/local/cloudberry-pxf*
1818

19-
echo "Successfully installed PXF version $(cat /usr/local/pxf-gp*/version)"
19+
echo "Successfully installed PXF version $(cat /usr/local/cloudberry-pxf*/version)"

package/install_rpm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if [[ "${owner}" != "root" ]]; then
1414
fi
1515

1616
${sudo_if_needed} rpm -Uvh ${INSTALL_COMPONENT_SCRIPT_DIR}/${RPM_FILE}
17-
${sudo_if_needed} chown -R ${owner} /usr/local/pxf-gp*
17+
${sudo_if_needed} chown -R ${owner} /usr/local/cloudberry-pxf*
1818

19-
echo "Successfully installed PXF version $(cat /usr/local/pxf-gp*/version)"
19+
echo "Successfully installed PXF version $(cat /usr/local/cloudberry-pxf*/version)"

0 commit comments

Comments
 (0)