Skip to content

Commit

Permalink
[DOCKER] Only pass pythonpath for ci images (apache#6005)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and Trevor Morris committed Jul 14, 2020
1 parent dcb5577 commit ff2ed93
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docker/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ else
DOCKER_BINARY="docker"
fi

if [[ "${DOCKER_IMAGE_NAME}" == *"ci"* ]]; then
CI_PY_ENV="-e PYTHONPATH=/workspace/python:/workspace/topi/python"
else
CI_PY_ENV=""
fi

# Print arguments.
echo "WORKSPACE: ${WORKSPACE}"
echo "DOCKER CONTAINER NAME: ${DOCKER_IMAGE_NAME}"
Expand Down Expand Up @@ -99,10 +105,10 @@ ${DOCKER_BINARY} run --rm --pid=host\
-e "CI_BUILD_UID=$(id -u)" \
-e "CI_BUILD_GROUP=$(id -g -n)" \
-e "CI_BUILD_GID=$(id -g)" \
-e "PYTHONPATH=/workspace/python:/workspace/topi/python"\
-e "CI_PYTEST_ADD_OPTIONS=$CI_PYTEST_ADD_OPTIONS" \
${CUDA_ENV}\
${CI_PY_ENV} \
${CUDA_ENV} \
${CI_DOCKER_EXTRA_PARAMS[@]} \
${DOCKER_IMAGE_NAME}\
${DOCKER_IMAGE_NAME} \
bash --login /docker/with_the_same_user \
${COMMAND[@]}

0 comments on commit ff2ed93

Please sign in to comment.