Merge pull request #25833 from a6802739:environment_capture

PiperOrigin-RevId: 249262596
This commit is contained in:
TensorFlower Gardener 2019-05-21 09:24:48 -07:00
commit 64a6966e9a

View File

@ -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`;
@ -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"