diff --git a/.pfnci/common.sh b/.pfnci/common.sh index 0225dfabb0..acc7e69114 100644 --- a/.pfnci/common.sh +++ b/.pfnci/common.sh @@ -15,38 +15,59 @@ TEMP=$(mktemp -d) mount -t tmpfs tmpfs ${TEMP}/ -o size=100% REPOSITORY=${REPOSITORY:-chainercv} -if [ ${REPOSITORY} = chainercv ]; then - cp -a . ${TEMP}/chainercv -elif [ ${REPOSITORY} = chainer ]; then - CHAINER=local - cp -a . ${TEMP}/chainer - mv ${TEMP}/chainer/chainercv/ ${TEMP}/ -fi +case ${REPOSITORY} in + chainercv) + CUPY=${CHAINER} + cp -a . ${TEMP}/chainercv + ;; + chainer) + CHAINER=local + CUPY=master + cp -a . ${TEMP}/chainer + mv ${TEMP}/chainer/chainercv/ ${TEMP}/ + ;; + cupy) + CHAINER=master + CUPY=local + cp -a . ${TEMP}/cupy + mv ${TEMP}/cupy/chainercv/ ${TEMP}/ + ;; +esac cd ${TEMP}/ -if [ ${CHAINER} = stable ]; then - echo pip${PYTHON} install \ - chainer==${STABLE} \ - cupy-cuda92==${STABLE} >> install.sh -elif [ ${CHAINER} = latest ]; then - echo pip${PYTHON} install \ - chainer==${LATEST} \ - cupy-cuda92==${LATEST} >> install.sh -elif [ ${CHAINER} = master ]; then - CHAINER_MASTER=$(git ls-remote https://github.com/chainer/chainer.git master | cut -f1) - echo pip${PYTHON} install \ - git+https://github.com/chainer/chainer.git@${CHAINER_MASTER}#egg=chainer >> install.sh - - CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -) - gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl . - echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh -elif [ ${CHAINER} = local ]; then - echo pip${PYTHON} install -e chainer/ >> install.sh - - CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -) - gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl . - echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh -fi +case ${CHAINER} in + stable) + echo pip${PYTHON} install chainer==${STABLE} >> install.sh + ;; + latest) + echo pip${PYTHON} install chainer==${LATEST} >> install.sh + ;; + master) + CHAINER_MASTER=$(git ls-remote https://github.com/chainer/chainer.git master | cut -f1) + echo pip${PYTHON} install \ + git+https://github.com/chainer/chainer.git@${CHAINER_MASTER}#egg=chainer >> install.sh + ;; + local) + echo pip${PYTHON} install -e chainer/ >> install.sh + ;; +esac + +case ${CUPY} in + stable) + echo pip${PYTHON} install cupy-cuda92==${STABLE} >> install.sh + ;; + latest) + echo pip${PYTHON} install cupy-cuda92==${LATEST} >> install.sh + ;; + master) + CUPY_MASTER=$(gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/master -) + gsutil -q cp gs://tmp-pfn-public-ci/cupy/wheel/${CUPY_MASTER}/cuda9.2/*.whl . + echo pip${PYTHON} install cupy-*-cp${PYTHON}*-cp${PYTHON}*-linux_x86_64.whl >> install.sh + ;; + local) + echo pip${PYTHON} install -e cupy/ >> install.sh + ;; +esac echo pip${PYTHON} install -e chainercv/ >> install.sh