-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmf-mesos-executor.in
executable file
·37 lines (25 loc) · 1.12 KB
/
mf-mesos-executor.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# This script uses MESOS_SOURCE_DIR and MESOS_BUILD_DIR which come
# from configuration substitutions.
MESOS_SOURCE_DIR=/home/zc/Work/mesos
MESOS_BUILD_DIR=/home/zc/Work/mesos/build
# Use colors for errors.
. ${MESOS_SOURCE_DIR}/support/colors.sh
# Force the use of the Python interpreter configured during building.
test ! -z "${PYTHON}" && \
echo "${RED}Ignoring PYTHON environment variable (using @PYTHON@)${NORMAL}"
PYTHON=/usr/bin/python
SETUPTOOLS=`echo ${MESOS_BUILD_DIR}/3rdparty/setuptools-*/`
# Just warn in the case when build with --disable-bundled.
test ! -e ${SETUPTOOLS} && \
echo "${RED}Failed to find ${SETUPTOOLS}${NORMAL}"
PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/libprocess/3rdparty/protobuf-*/python/`
test ! -e ${PROTOBUF} && \
echo "${RED}Failed to find ${PROTOBUF}${NORMAL}"
MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":")
SCRIPT=${CCTOOLS}/bin/mf_mesos_executor.py
test ! -e ${SCRIPT} && \
echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \
exit 1
PYTHONPATH="${SETUPTOOLS}:${PROTOBUF}:${MESOS_EGGS}" \
exec ${PYTHON} ${SCRIPT} "${@}"