From: Kefu Chai Date: Wed, 23 Jan 2019 11:41:18 +0000 (+0800) Subject: cmake: use $CMAKE_BINARY_DIR for default $CEPH_BUILD_VIRTUALENV X-Git-Tag: v14.1.0~250^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a8d6b2170dfa0838dad0d1b7b03fc8cf19e4eeff;p=ceph.git cmake: use $CMAKE_BINARY_DIR for default $CEPH_BUILD_VIRTUALENV to avoid conflict with other `make check` runs in the same host See-also: http://tracker.ceph.com/issues/36737 Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9507eaaa614..d0cc193e9712 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -459,7 +459,7 @@ install(TARGETS librados-config DESTINATION bin) # virtualenv base directory for ceph-disk and ceph-detect-init set(CEPH_BUILD_VIRTUALENV $ENV{TMPDIR}) if(NOT CEPH_BUILD_VIRTUALENV) - set(CEPH_BUILD_VIRTUALENV /tmp) + set(CEPH_BUILD_VIRTUALENV ${CMAKE_BINARY_DIR}) endif() add_subdirectory(pybind) diff --git a/src/pybind/mgr/ansible/run-tox.sh b/src/pybind/mgr/ansible/run-tox.sh index 951ea23150e7..88f0f18ee6eb 100644 --- a/src/pybind/mgr/ansible/run-tox.sh +++ b/src/pybind/mgr/ansible/run-tox.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # run from ./ or from ../ -: ${MGR_ANSIBLE_VIRTUALENV:=/tmp/mgr-ansible-virtualenv} +: ${MGR_ANSIBLE_VIRTUALENV:=$CEPH_BUILD_DIR/mgr-ansible-virtualenv} : ${WITH_PYTHON2:=ON} : ${WITH_PYTHON3:=ON} : ${CEPH_BUILD_DIR:=$PWD/.tox} diff --git a/src/pybind/mgr/dashboard/run-tox.sh b/src/pybind/mgr/dashboard/run-tox.sh index c57f93a4802f..33a7db0cef27 100755 --- a/src/pybind/mgr/dashboard/run-tox.sh +++ b/src/pybind/mgr/dashboard/run-tox.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # run from ./ or from ../ -: ${MGR_DASHBOARD_VIRTUALENV:=/tmp/mgr-dashboard-virtualenv} +: ${MGR_DASHBOARD_VIRTUALENV:=$CEPH_BUILD_DIR/mgr-dashboard-virtualenv} : ${WITH_PYTHON2:=ON} : ${WITH_PYTHON3:=ON} : ${CEPH_BUILD_DIR:=$PWD/.tox} diff --git a/src/pybind/mgr/insights/run-tox.sh b/src/pybind/mgr/insights/run-tox.sh index fb7f755142cb..450149910b1e 100644 --- a/src/pybind/mgr/insights/run-tox.sh +++ b/src/pybind/mgr/insights/run-tox.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # run from ./ or from ../ -: ${MGR_INSIGHTS_VIRTUALENV:=/tmp/mgr-insights-virtualenv} +: ${MGR_INSIGHTS_VIRTUALENV:=$CEPH_BUILD_DIR/mgr-insights-virtualenv} : ${WITH_PYTHON2:=ON} : ${WITH_PYTHON3:=ON} : ${CEPH_BUILD_DIR:=$PWD/.tox} diff --git a/src/pybind/mgr/orchestrator_cli/run-tox.sh b/src/pybind/mgr/orchestrator_cli/run-tox.sh index 04d30d6d647e..a7ef70ba384c 100644 --- a/src/pybind/mgr/orchestrator_cli/run-tox.sh +++ b/src/pybind/mgr/orchestrator_cli/run-tox.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # run from ./ or from ../ -: ${MGR_ORCHESTRATOR_CLI_VIRTUALENV:=/tmp/mgr-orchestrator_cli-virtualenv} +: ${MGR_ORCHESTRATOR_CLI_VIRTUALENV:=$CEPH_BUILD_DIR/mgr-orchestrator_cli-virtualenv} : ${WITH_PYTHON2:=ON} : ${WITH_PYTHON3:=ON} : ${CEPH_BUILD_DIR:=$PWD/.tox} diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index cbe32695eee4..f7707aca2dcd 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -1,5 +1,6 @@ import json import re +import os import threading import functools import uuid @@ -196,9 +197,9 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): c_v_out = check_output(['ceph-volume', 'inventory', '--format', 'json']) except OSError: cmd = """ - . /tmp/ceph-volume-virtualenv/bin/activate + . {}/ceph-volume-virtualenv/bin/activate ceph-volume inventory --format json - """ + """.format(tmpdir=os.environ.get('TMPDIR', '/tmp')) c_v_out = check_output(cmd, shell=True) for out in c_v_out.splitlines():