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

Add python and os information in environment capture script #25833

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 56 additions & 14 deletions tools/tf_env_collect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,62 @@ OUTPUT_FILE=tf_env.txt
python_bin_path=$(which python || which python3 || die "Cannot find Python binary")

{
echo
echo "== cat /etc/issue ==============================================="
uname -a
uname=`uname -s`
if [ "$(uname)" == "Darwin" ]; then
echo Mac OS X `sw_vers -productVersion`
elif [ "$(uname)" == "Linux" ]; then
cat /etc/*release | grep VERSION
fi

echo
echo '== check python ==================================================='
} >> ${OUTPUT_FILE}

cat <<EOF > /tmp/check_python.py
import platform

print("""python version: %s
python branch: %s
python build version: %s
python compiler version: %s
python implementation: %s
""" % (
platform.python_version(),
platform.python_branch(),
platform.python_build(),
platform.python_compiler(),
platform.python_implementation(),
))
EOF
${python_bin_path} /tmp/check_python.py 2>&1 >> ${OUTPUT_FILE}

{
echo
echo '== check os platform ==============================================='
} >> ${OUTPUT_FILE}

cat <<EOF > /tmp/check_os.py
import platform

print("""os: %s
os kernel version: %s
os release version: %s
os platform: %s
linux distribution: %s
linux os distribution: %s
mac version: %s
uname: %s
architecture: %s
machine: %s
""" % (
platform.system(),
platform.version(),
platform.release(),
platform.platform(),
platform.linux_distribution(),
platform.dist(),
platform.mac_ver(),
platform.uname(),
platform.architecture(),
platform.machine(),
))
EOF
${python_bin_path} /tmp/check_os.py 2>&1 >> ${OUTPUT_FILE}

{
echo
echo '== are we in docker ============================================='
num=`cat /proc/1/cgroup | grep docker | wc -l`;
Expand All @@ -55,10 +101,6 @@ python_bin_path=$(which python || which python3 || die "Cannot find Python binar
echo '== compiler ====================================================='
c++ --version 2>&1

echo
echo '== uname -a ====================================================='
uname -a

echo
echo '== check pips ==================================================='
pip list 2>&1 | grep "proto\|numpy\|tensorflow"
Expand Down