Format changes as per Google's feedback
This commit is contained in:
parent
ae408bb512
commit
c65fccf0a6
@ -64,9 +64,9 @@ RUN bazel --bazelrc=/root/.bazelrc build -c opt \
|
|||||||
|
|
||||||
# Install OpenMPI/Horovod
|
# Install OpenMPI/Horovod
|
||||||
COPY install_openmpi_horovod.sh .
|
COPY install_openmpi_horovod.sh .
|
||||||
RUN if [ "${ENABLE_HOROVOD}" = "yes" ]; then \
|
RUN if [ "${ENABLE_HOROVOD}" == "yes" ]; then \
|
||||||
chmod +x install_openmpi_horovod.sh && \
|
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; \
|
rm -rf install_openmpi_horovod.sh; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -201,21 +201,20 @@ function test_container()
|
|||||||
debug "ID of the running docker container: ${CONTAINER_ID}"
|
debug "ID of the running docker container: ${CONTAINER_ID}"
|
||||||
|
|
||||||
debug "Performing basic sanity checks on the running container..."
|
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
|
${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'from tensorflow.python import _pywrap_util_port; print(_pywrap_util_port.IsMklEnabled())'"
|
||||||
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}"
|
echo "PASS: MKL enabled test in ${TEMP_IMAGE_NAME}"
|
||||||
else
|
} || {
|
||||||
|
${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}"
|
die "FAIL: MKL enabled test in ${TEMP_IMAGE_NAME}"
|
||||||
fi
|
}
|
||||||
|
|
||||||
# Test to check if horovod is installed successfully
|
# Test to check if horovod is installed successfully
|
||||||
if [[ ${ENABLE_HOROVOD} == "yes" ]]; then
|
if [[ ${ENABLE_HOROVOD} == "yes" ]]; then
|
||||||
debug "Test horovod in the container..."
|
debug "Test horovod in the container..."
|
||||||
HOROVOD_TEST_CMD=$(${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'import horovod.tensorflow as hvd;'")
|
${DOCKER_BINARY} exec ${CONTAINER_ID} bash -c "${PYTHON} -c 'import horovod.tensorflow as hvd;'"
|
||||||
${HOROVOD_TEST_CMD}
|
|
||||||
if [[ $? == "0" ]]; then
|
if [[ $? == "0" ]]; then
|
||||||
echo "PASS: HOROVOD installation test in ${TEMP_IMAGE_NAME}"
|
echo "PASS: HOROVOD installation test in ${TEMP_IMAGE_NAME}"
|
||||||
else
|
else
|
||||||
|
@ -54,7 +54,8 @@ echo 'OpenMPI version:'
|
|||||||
mpirun --version
|
mpirun --version
|
||||||
|
|
||||||
# Install OpenSSH for MPI to communicate between containers
|
# Install OpenSSH for MPI to communicate between containers
|
||||||
apt-get clean && apt-get update && apt-get install -y --no-install-recommends --fix-missing \
|
apt-get clean && apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends --fix-missing \
|
||||||
openssh-client openssh-server libnuma-dev && \
|
openssh-client openssh-server libnuma-dev && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
if [[ $? == "0" ]]; then
|
if [[ $? == "0" ]]; then
|
||||||
@ -70,7 +71,7 @@ else
|
|||||||
fi
|
fi
|
||||||
mkdir -p /var/run/sshd
|
mkdir -p /var/run/sshd
|
||||||
# Allow OpenSSH to talk to containers without asking for confirmation
|
# 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
|
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new
|
||||||
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
|
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user