Skip to content

Commit

Permalink
BIGTOP-4149. Support Livy in bigtop-select and pkgSuffix and parentDi…
Browse files Browse the repository at this point in the history
…r build arguments. (#1282)

Co-authored-by: Paul Yakovlev <[email protected]>
Co-authored-by: Carmen Blaine <[email protected]>
  • Loading branch information
3 people committed Jul 1, 2024
1 parent 9bd66b3 commit 4066896
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bigtop-packages/src/common/bigtop-select/conf-select
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vconfroot = 'etc'
lib_root = "usr/lib"
vconf_name = "conf.dist"
packages = ("hadoop", "hbase", "hive", "hive-hcatalog",
"kafka", "spark", "tez",
"kafka", "spark", "tez", "livy",
"zookeeper", "zeppelin", "flink", "solr", "ranger-admin", "ranger-usersync", "ranger-tagsync")
''' conf link
/usr/bigtop/3.2.0/usr/lib/${pname}/conf -> /etc/${pname}/conf -> /etc/alternatives/${pname}-conf -> /usr/bigtop/3.2.0/etc/${pname}/conf.dist.0
Expand Down
5 changes: 4 additions & 1 deletion bigtop-packages/src/common/bigtop-select/distro-select
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ leaves = {
"ranger-admin" : "ranger-admin",
"ranger-usersync" : "ranger-usersync",
"ranger-tagsync" : "ranger-tagsync",
"livy-server" : "livy",
"livy-client" : "livy"
"alluxio": "alluxio",
"alluxio-master": "alluxio",
"alluxio-worker": "alluxio"
Expand All @@ -85,7 +87,8 @@ aliases = {
"phoenix-client",
"zookeeper-client",
"flink-client",
"spark-client"],
"spark-client",
"livy-client"],
"hadoop-hdfs-server": ["hadoop-hdfs-datanode",
"hadoop-hdfs-journalnode",
"hadoop-hdfs-namenode",
Expand Down
42 changes: 22 additions & 20 deletions bigtop-packages/src/rpm/livy/SPECS/livy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

%define lib_livy /usr/lib/%{name}
%define etc_livy %{_sysconfdir}/%{name}
%define livy_name livy
%define livy_pkg_name %{livy_name}%{pkg_name_suffix}
%define lib_livy %{parent_dir}/usr/lib/%{livy_name}
%define etc_livy %{_sysconfdir}/%{livy_name}
%define config_livy %{etc_livy}/conf
%define livy_services server
%define var_lib_livy /var/lib/%{name}
%define var_run_livy /var/run/%{name}
%define var_log_livy /var/log/%{name}
%define var_lib_livy /var/lib/%{livy_name}
%define var_run_livy /var/run/%{livy_name}
%define var_log_livy /var/log/%{livy_name}

Name: livy
Name: %{livy_pkg_name}
Version: %{livy_version}
Release: %{livy_release}
BuildArch: noarch
Summary: Livy Server
URL: http://livy.incubator.apache.org/
Group: Development/Libraries
License: ASL 2.0
Source0: %{name}-%{livy_base_version}.zip
Source0: %{livy_name}-%{livy_base_version}.zip
Source1: do-component-build
Source2: install_%{name}.sh
Source2: install_%{livy_name}.sh
Source3: livy-server.svc
Source4: bigtop.bom
Source6: init.d.tmpl
Expand Down Expand Up @@ -72,7 +74,7 @@ Requires: /lib/lsb/init-functions
%__rm -rf $RPM_BUILD_ROOT

%prep
%setup -n %{name}-%{version}
%setup -n %{livy_name}-%{version}
#BIGTOP_PATCH_COMMANDS

%build
Expand All @@ -82,22 +84,22 @@ bash %{SOURCE1}
# Init.d scripts
%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/

bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build
bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build --lib-dir=%{lib_livy}

for service in %{livy_services}
do
# Install init script
initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-${service}
bash %{SOURCE6} $RPM_SOURCE_DIR/%{name}-${service}.svc rpm $initd_script
initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{livy_name}-${service}
bash %{SOURCE6} $RPM_SOURCE_DIR/%{livy_name}-${service}.svc rpm $initd_script
done

%preun
for service in %{livy_services}; do
/sbin/service %{name}-${service} status > /dev/null 2>&1
/sbin/service %{livy_name}-${service} status > /dev/null 2>&1
if [ $? -eq 0 ]; then
/sbin/service %{name}-${service} stop > /dev/null 2>&1
/sbin/service %{livy_name}-${service} stop > /dev/null 2>&1
fi
chkconfig --del %{name}-${service}
chkconfig --del %{livy_name}-${service}
done

%pre
Expand All @@ -106,19 +108,19 @@ getent passwd livy >/dev/null || useradd -c "Livy" -s /sbin/nologin -g livy -r -

%post
install --owner livy --group livy --directory --mode=0755 %{var_log_livy}
%{alternatives_cmd} --install %{config_livy} %{name}-conf %{config_livy}.dist 30
%{alternatives_cmd} --install %{config_livy} %{livy_name}-conf %{config_livy}.dist 30
for service in %{livy_services}; do
chkconfig --add %{name}-${service}
chkconfig --add %{livy_name}-${service}
done

%postun
for service in %{livy_services}; do
if [ $1 -ge 1 ]; then
service %{name}-${service} condrestart >/dev/null 2>&1
service %{livy_name}-${service} condrestart >/dev/null 2>&1
fi
done

%{alternatives_cmd} --remove %{name}-conf %{config_livy}.dist
%{alternatives_cmd} --remove %{livy_name}-conf %{config_livy}.dist

%files
%defattr(-,root,root)
Expand All @@ -127,4 +129,4 @@ done
%attr(0755,livy,livy) %{var_lib_livy}
%attr(0755,livy,livy) %{var_run_livy}
%attr(0755,livy,livy) %{var_log_livy}
%attr(0755,root,root) %{initd_dir}/%{name}*
%attr(0755,root,root) %{initd_dir}/%{livy_name}*
1 change: 1 addition & 0 deletions bigtop.bom
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ bigtop {
}
'livy' {
name = 'livy'
rpm_pkg_suffix = "_" + bigtop.base_version.replace(".", "_")
relNotes = 'Apache Livy'
version { base = '0.8.0'; pkg = base; release = 1 }
tarball { destination = "${name}-${version.base}.zip"
Expand Down

0 comments on commit 4066896

Please sign in to comment.