This is an automated email from the ASF dual-hosted git repository.
iwasakims pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git
The following commit(s) were added to refs/heads/master by this push:
new 36a3b4490 BIGTOP-4072: Add pkg-suffix to Alluxio to support Ambari
installation and deployment (#1242)
36a3b4490 is described below
commit 36a3b44905e062e0b1c657dba6bc82dc84accbb4
Author: jialiang <[email protected]>
AuthorDate: Tue Mar 5 14:23:08 2024 +0800
BIGTOP-4072: Add pkg-suffix to Alluxio to support Ambari installation and
deployment (#1242)
---
.../src/common/alluxio/install_alluxio.sh | 30 +++++----
.../src/common/bigtop-select/distro-select | 8 ++-
bigtop-packages/src/deb/alluxio/rules | 1 -
bigtop-packages/src/rpm/alluxio/SPECS/alluxio.spec | 74 +++++++++++++---------
bigtop.bom | 1 +
5 files changed, 67 insertions(+), 47 deletions(-)
diff --git a/bigtop-packages/src/common/alluxio/install_alluxio.sh
b/bigtop-packages/src/common/alluxio/install_alluxio.sh
index 380ce2445..3ebf5aab3 100644
--- a/bigtop-packages/src/common/alluxio/install_alluxio.sh
+++ b/bigtop-packages/src/common/alluxio/install_alluxio.sh
@@ -38,9 +38,9 @@ OPTS=$(getopt \
-l 'prefix:' \
-l 'bin-dir:' \
-l 'libexec-dir:' \
- -l 'var-dir:' \
-l 'lib-dir:' \
-l 'data-dir:' \
+ -l 'conf-dist-dir:' \
-l 'build-dir:' -- "$@")
if [ $? != 0 ] ; then
@@ -65,12 +65,12 @@ while true ; do
--bin-dir)
BIN_DIR=$2 ; shift 2
;;
- --var-dir)
- VAR_DIR=$2 ; shift 2
- ;;
--data-dir)
DATA_DIR=$2 ; shift 2
;;
+ --conf-dist-dir)
+ CONF_DIST_DIR=$2 ; shift 2
+ ;;
--)
shift ; break
;;
@@ -95,7 +95,11 @@ OS="$ID"
LIB_DIR=${LIB_DIR:-/usr/lib/alluxio}
LIBEXEC_DIR=${INSTALLED_LIB_DIR:-/usr/libexec}
BIN_DIR=${BIN_DIR:-/usr/bin}
-CONF_DIST_DIR=/etc/alluxio/conf.dist/
+ETC_ALLUXIO=${ETC_ALLUXIO:-/etc/alluxio}
+# No prefix
+NP_ETC_ALLUXIO=/etc/alluxio
+CONF_DIST_DIR=${CONF_DIST_DIR:-/etc/alluxio/conf.dist}
+NP_VAR_DIR=/var
install -d -m 0755 $PREFIX/$LIB_DIR
install -d -m 0755 $PREFIX/$LIB_DIR/assembly/client/target
@@ -109,18 +113,18 @@ install -d -m 0755 $PREFIX/$LIB_DIR/webui/worker
install -d -m 0755 $PREFIX/$LIB_DIR/integration
install -d -m 0755 $PREFIX/$LIB_DIR/share
install -d -m 0755 $PREFIX/$LIB_DIR/core/server/common/src/main/webapp
+install -d -m 0755 $PREFIX/$LIB_DIR/journal
install -d -m 0755 $PREFIX/$DATA_DIR
install -d -m 0755 $PREFIX/$DATA_DIR/alluxio
-install -d -m 0755 $PREFIX/etc
-install -d -m 0755 $PREFIX/etc/alluxio
-install -d -m 0755 $PREFIX/etc/alluxio/conf
-install -d -m 0755 $PREFIX/$VAR_DIR/log/alluxio
-install -d -m 0755 $PREFIX/$VAR_DIR/lib/alluxio/journal
-install -d -m 0755 $PREFIX/$VAR_DIR/run/alluxio
+install -d -m 0755 $PREFIX/$NP_ETC_ALLUXIO
+install -d -m 0755 $PREFIX/$NP_VAR_DIR/run/alluxio
+install -d -m 0755 $PREFIX/$NP_VAR_DIR/log/alluxio
+
+
install -d -m 0755 $PREFIX/$CONF_DIST_DIR
-ln -s $CONF_DIST_DIR $PREFIX/$LIB_DIR/conf
-ln -s $VAR_DIR/log/alluxio $PREFIX/$LIB_DIR/logs
+ln -s $NP_ETC_ALLUXIO/conf $PREFIX/$LIB_DIR/conf
+ln -s $NP_VAR_DIR/log/alluxio $PREFIX/$LIB_DIR/logs
cp assembly/server/target/alluxio*dependencies.jar
$PREFIX/$LIB_DIR/assembly/server/target
cp assembly/client/target/alluxio*dependencies.jar
$PREFIX/$LIB_DIR/assembly/client/target
diff --git a/bigtop-packages/src/common/bigtop-select/distro-select
b/bigtop-packages/src/common/bigtop-select/distro-select
index 67ab1566b..4d9c388db 100644
--- a/bigtop-packages/src/common/bigtop-select/distro-select
+++ b/bigtop-packages/src/common/bigtop-select/distro-select
@@ -69,7 +69,10 @@ leaves = {
"spark-historyserver" : "spark",
"ranger-admin" : "ranger-admin",
"ranger-usersync" : "ranger-usersync",
- "ranger-tagsync" : "ranger-tagsync"
+ "ranger-tagsync" : "ranger-tagsync",
+ "alluxio": "alluxio",
+ "alluxio-master": "alluxio",
+ "alluxio-worker": "alluxio"
}
# Define the aliases and the list of leaves they correspond to
@@ -131,7 +134,8 @@ command_symlinks = {
"spark-shell" : "spark-client/../../bin/spark-shell",
"spark-sql" : "spark-client/../../bin/spark-sql",
"spark-submit" : "spark-client/../../bin/spark-submit",
- "pyspark" : "spark-client/../../bin/pyspark"
+ "pyspark" : "spark-client/../../bin/pyspark",
+ "alluxio" : "alluxio/bin/alluxio"
}
diff --git a/bigtop-packages/src/deb/alluxio/rules
b/bigtop-packages/src/deb/alluxio/rules
index 1ec79cde9..bcce0aee1 100755
--- a/bigtop-packages/src/deb/alluxio/rules
+++ b/bigtop-packages/src/deb/alluxio/rules
@@ -36,7 +36,6 @@ override_dh_auto_install:
--bin-dir=/usr/bin \
--data-dir=/usr/share \
--libexec-dir=/usr/lib/alluxio/libexec \
- --var-dir=/var \
--prefix=debian/tmp
mkdir -p debian/alluxio/etc/init.d/
bash debian/init.d.tmpl debian/alluxio-master.svc deb
debian/alluxio/etc/init.d/alluxio-master
diff --git a/bigtop-packages/src/rpm/alluxio/SPECS/alluxio.spec
b/bigtop-packages/src/rpm/alluxio/SPECS/alluxio.spec
index 9ca6cc529..0356a0024 100644
--- a/bigtop-packages/src/rpm/alluxio/SPECS/alluxio.spec
+++ b/bigtop-packages/src/rpm/alluxio/SPECS/alluxio.spec
@@ -14,7 +14,32 @@
# limitations under the License.
%define alluxio_name alluxio
-Name: alluxio
+%define alluxio_pkg_name alluxio%{pkg_name_suffix}
+%define _binaries_in_noarch_packages_terminate_build 0
+%define _unpackaged_files_terminate_build 0
+
+%define etc_default %{parent_dir}/etc/default
+%define usr_lib_alluxio %{parent_dir}/usr/lib/%{alluxio_name}
+%define etc_alluxio %{parent_dir}/etc/%{alluxio_name}
+%define etc_alluxio_conf_dist %{parent_dir}/etc/%{alluxio_name}/conf.dist
+%define bin_dir %{parent_dir}/%{_bindir}
+
+%define libexec_dir %{usr_lib_alluxio}/libexec
+
+%define np_var_lib_alluxio_data /var/lib/%{alluxio_name}/data
+%define np_var_run_alluxio /var/run/%{alluxio_name}
+%define np_var_log_alluxio /var/log/%{alluxio_name}
+%define np_etc_alluxio /etc/%{alluxio_name}
+
+
+%define alluxio_home %{parent_dir}/usr/lib/%{alluxio_name}
+%define alluxio_services master worker job-master job-worker
+
+%global initd_dir %{_sysconfdir}/init.d
+
+
+
+Name: %{alluxio_pkg_name}
Version: %{alluxio_version}
Release: %{alluxio_release}
Summary: Reliable file sharing at memory speed across cluster frameworks
@@ -32,15 +57,6 @@ Source5: alluxio-worker.svc
Source6: alluxio-job-master.svc
Source7: alluxio-job-worker.svc
#BIGTOP_PATCH_FILES
-%define alluxio_home /usr/lib/%{alluxio_name}
-%define alluxio_services master worker job-master job-worker
-%define var_lib /var/lib/%{alluxio_name}
-%define var_run /var/run/%{alluxio_name}
-%define var_log /var/log/%{alluxio_name}
-%define etc_alluxio /etc/%{alluxio_name}
-%define config_alluxio %{etc_alluxio}/conf
-
-%global initd_dir %{_sysconfdir}/init.d
%if %{?suse_version:1}0
%define alternatives_cmd update-alternatives
@@ -65,7 +81,9 @@ Requires: initscripts
Requires: bigtop-utils
# disable repacking jars
-%define __arch_install_post %{nil}
+%define __os_install_post %{nil}
+%define __jar_repack %{nil}
+%define debug_package %{nil}
# disable debug package
%define debug_package %{nil}
@@ -97,11 +115,12 @@ rm -rf $RPM_BUILD_ROOT
# Here we run the alluxio installation script.
bash %{SOURCE2} \
--build-dir=%{buildroot} \
- --bin-dir=%{_bindir} \
+ --lib-dir=%{usr_lib_alluxio} \
+ --bin-dir=%{bin_dir} \
--data-dir=%{_datadir} \
- --libexec-dir=%{_libexecdir} \
- --var-dir=%{_var} \
- --prefix="${RPM_BUILD_ROOT}"
+ --libexec-dir=%{libexec_dir} \
+ --prefix="${RPM_BUILD_ROOT}" \
+ --conf-dist-dir=%{etc_alluxio_conf_dist}
for service in %{alluxio_services}
do
@@ -115,11 +134,11 @@ getent group alluxio >/dev/null || groupadd -r alluxio
getent passwd alluxio >/dev/null || useradd -c "Alluxio" -s /sbin/nologin -g
alluxio -r -d %{var_lib} alluxio 2> /dev/null || :
%post
-%{alternatives_cmd} --install %{config_alluxio} %{alluxio_name}-conf
%{config_alluxio}.dist 30
+%{alternatives_cmd} --install %{np_etc_alluxio}/conf %{alluxio_name}-conf
%{etc_alluxio}/conf.dist 30
%preun
if [ "$1" = 0 ]; then
- %{alternatives_cmd} --remove %{alluxio_name}-conf
%{config_alluxio}.dist || :
+ %{alternatives_cmd} --remove %{alluxio_name}-conf
%{etc_alluxio}/conf.dist || :
fi
for service in %{alluxio_services}; do
@@ -133,26 +152,19 @@ done
%files
%defattr(-,root,root,-)
%doc LICENSE README.md
-%dir %{_sysconfdir}/%{alluxio_name}
-%config(noreplace) %{_sysconfdir}/%{alluxio_name}/conf.dist
-%exclude %{_sysconfdir}/%{alluxio_name}/conf.dist/log4j.properties
-%exclude %{_sysconfdir}/%{alluxio_name}/conf.dist/alluxio-env.sh
-%exclude %{_sysconfdir}/%{alluxio_name}/conf.dist/alluxio-site.properties
-%exclude %{_sysconfdir}/%{alluxio_name}/conf.dist/core-site.xml
-%config(noreplace) %{_sysconfdir}/%{alluxio_name}/conf.dist/log4j.properties
-%config(noreplace) %{_sysconfdir}/%{alluxio_name}/conf.dist/alluxio-env.sh
-%config(noreplace)
%{_sysconfdir}/%{alluxio_name}/conf.dist/alluxio-site.properties
-%config(noreplace) %{_sysconfdir}/%{alluxio_name}/conf.dist/core-site.xml
+%dir %{np_etc_alluxio}
+%config(noreplace) %{etc_alluxio}/conf.dist
+
%config(noreplace) %{initd_dir}/%{alluxio_name}-master
%config(noreplace) %{initd_dir}/%{alluxio_name}-worker
%config(noreplace) %{initd_dir}/%{alluxio_name}-job-master
%config(noreplace) %{initd_dir}/%{alluxio_name}-job-worker
-%attr(0755,alluxio,alluxio) %{var_lib}
-%attr(0755,alluxio,alluxio) %{var_run}
-%attr(0755,alluxio,alluxio) %{var_log}
+
+%attr(0755,alluxio,alluxio) %{np_var_run_alluxio}
+%attr(0755,alluxio,alluxio) %{np_var_log_alluxio}
%{alluxio_home}
%{_datadir}/%{alluxio_name}
-/usr/bin/alluxio
+%{bin_dir}/alluxio
%clean
diff --git a/bigtop.bom b/bigtop.bom
index c2e95325c..3cd1025b6 100644
--- a/bigtop.bom
+++ b/bigtop.bom
@@ -291,6 +291,7 @@ bigtop {
'alluxio' {
name = "alluxio"
pkg = "alluxio"
+ rpm_pkg_suffix = "_" + bigtop.base_version.replace(".", "_")
relNotes = "Alluxio: a memory-centric distributed file system"
version { base = '2.9.3'; pkg = base; release = 1 }
tarball { destination = "$name-${version.base}.tar.gz"