Format changes as per Google's feedback

This commit is contained in:
shwetaoj 2020-06-17 11:55:27 -07:00
parent ae408bb512
commit c65fccf0a6
3 changed files with 16 additions and 16 deletions

View File

@ -64,9 +64,9 @@ RUN bazel --bazelrc=/root/.bazelrc build -c opt \
# Install OpenMPI/Horovod
COPY install_openmpi_horovod.sh .
RUN if [ "${ENABLE_HOROVOD}" = "yes" ]; then \
RUN if [ "${ENABLE_HOROVOD}" == "yes" ]; then \
chmod +x install_openmpi_horovod.sh && \
./install_openmpi_horovod.sh OPENMPI_VERSION=${OPENMPI_VERSION} OPENMPI_DOWNLOAD_URL=${OPENMPI_DOWNLOAD_URL} HOROVOD_VERSION=${HOROVOD_VERSION} && \
OPENMPI_VERSION=${OPENMPI_VERSION} OPENMPI_DOWNLOAD_URL=${OPENMPI_DOWNLOAD_URL} HOROVOD_VERSION=${HOROVOD_VERSION} ./install_openmpi_horovod.sh && \
rm -rf install_openmpi_horovod.sh; \
fi

View File

@ -201,21 +201,20 @@ function test_container()
debug "ID of the running docker container: ${CONTAINER_ID}"
debug "Performing basic sanity checks on the running container..."
TEST_CMD_1=$(${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'from tensorflow.python import _pywrap_util_port; print(_pywrap_util_port.IsMklEnabled())'")
# Make TEST_CMD backward compatible with older code
TEST_CMD_2=$(${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'from tensorflow.python import pywrap_tensorflow; print(pywrap_tensorflow.IsMklEnabled())'")
if [ "${TEST_CMD_1}" = "True" -o "${TEST_CMD_2}" = "True" ] ; then
echo "PASS: MKL enabled test in ${TEMP_IMAGE_NAME}"
else
die "FAIL: MKL enabled test in ${TEMP_IMAGE_NAME}"
fi
{
${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'from tensorflow.python import _pywrap_util_port; print(_pywrap_util_port.IsMklEnabled())'"
echo "PASS: MKL enabled test in ${TEMP_IMAGE_NAME}"
} || {
${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'from tensorflow.python import pywrap_tensorflow; print(pywrap_tensorflow.IsMklEnabled())'"
echo "PASS: Old MKL enabled in ${TEMP_IMAGE_NAME}"
} || {
die "FAIL: MKL enabled test in ${TEMP_IMAGE_NAME}"
}
# Test to check if horovod is installed successfully
if [[ ${ENABLE_HOROVOD} == "yes" ]]; then
debug "Test horovod in the container..."
HOROVOD_TEST_CMD=$(${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'import horovod.tensorflow as hvd;'")
${HOROVOD_TEST_CMD}
${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'import horovod.tensorflow as hvd;'"
if [[ $? == "0" ]]; then
echo "PASS: HOROVOD installation test in ${TEMP_IMAGE_NAME}"
else

View File

@ -54,8 +54,9 @@ echo 'OpenMPI version:'
mpirun --version
# Install OpenSSH for MPI to communicate between containers
apt-get clean && apt-get update && apt-get install -y --no-install-recommends --fix-missing \
openssh-client openssh-server libnuma-dev && \
apt-get clean && apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
openssh-client openssh-server libnuma-dev && \
rm -rf /var/lib/apt/lists/*
if [[ $? == "0" ]]; then
echo "PASS: OpenSSH installation"
@ -70,7 +71,7 @@ else
fi
mkdir -p /var/run/sshd
# Allow OpenSSH to talk to containers without asking for confirmation
cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new
grep -v StrictHostKeyChecking /etc/ssh/ssh_config > /etc/ssh/ssh_config.new
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config