Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-4056. Support Detect Python Path #1223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
37 changes: 37 additions & 0 deletions bigtop-packages/src/common/bigtop-utils/bigtop-detect-pythonpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Override python3 in the file below if you want to disable
# automatic python3 detection
BIGTOP_DEFAULTS_DIR=${BIGTOP_DEFAULTS_DIR-/etc/default}
[ -n "${BIGTOP_DEFAULTS_DIR}" -a -r ${BIGTOP_DEFAULTS_DIR}/bigtop-utils ] && . ${BIGTOP_DEFAULTS_DIR}/bigtop-utils

PYTHON3_PATH_CANDIDATES=(
'/usr/bin/python3'
'/opt/python3/bin/python3'
'/usr/lib/python3/bin/python3'
)

# attempt to find python3
if [ -z "${PYTHON3_PATH}" ]; then
for candidate in ${PYTHON3_PATH_CANDIDATES[@]} ; do
if [ -e ${candidate} ]; then
export PYTHON3_PATH=${candidate}
break
fi
done
fi
3 changes: 3 additions & 0 deletions bigtop-packages/src/common/bigtop-utils/bigtop-utils.default
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Override JAVA_HOME detection for all bigtop packages
# export JAVA_HOME

# Override PYTHON3_PATH detection for all bigtop packages
# export PYTHON3_PATH

# Provide a colon-delimited list of directories to search for native Java libraries (e.g. libjvm.so)
# export JAVA_NATIVE_PATH

Expand Down
1 change: 1 addition & 0 deletions bigtop-packages/src/deb/bigtop-utils/rules
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ override_dh_auto_install:
install -p -m 755 debian/bigtop-detect-javahome debian/bigtop-utils/usr/lib/bigtop-utils/
install -p -m 755 debian/bigtop-detect-javalibs debian/bigtop-utils/usr/lib/bigtop-utils/
install -p -m 755 debian/bigtop-detect-classpath debian/bigtop-utils/usr/lib/bigtop-utils/
install -p -m 755 debian/bigtop-detect-pythonpath debian/bigtop-utils/usr/lib/bigtop-utils/
install -p -m 755 debian/bigtop-monitor-service debian/bigtop-utils/usr/lib/bigtop-utils/
install -d -p -m 755 debian/bigtop-utils/etc/default
install -p -m 644 debian/bigtop-utils.default debian/bigtop-utils/etc/default/bigtop-utils
3 changes: 3 additions & 0 deletions bigtop-packages/src/rpm/bigtop-utils/SPECS/bigtop-utils.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Source2: bigtop-utils.default
Source3: bigtop-detect-javalibs
Source4: bigtop-detect-classpath
Source5: bigtop-monitor-service
Source6: bigtop-detect-pythonpath
Requires: bash

# "which" command is needed for a lot of projects.
Expand All @@ -54,6 +55,7 @@ install -p -m 644 %{SOURCE2} .
install -p -m 644 %{SOURCE3} .
install -p -m 644 %{SOURCE4} .
install -p -m 644 %{SOURCE5} .
install -p -m 644 %{SOURCE6} .

%build

Expand All @@ -66,6 +68,7 @@ install -p -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{lib_dir}/
install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{lib_dir}/
install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{lib_dir}/
install -p -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{lib_dir}/
install -p -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{lib_dir}/
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/default/bigtop-utils

%clean
Expand Down