[CI] Fix broken Docker container 'cpu' (#5956)

This commit is contained in:
Philip Hyunsu Cho 2020-07-29 04:29:57 -07:00 committed by GitHub
parent f5fdcbe194
commit 071e10c1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 10 deletions

4
Jenkinsfile vendored
View File

@ -159,7 +159,7 @@ def Lint() {
def container_type = "cpu" def container_type = "cpu"
def docker_binary = "docker" def docker_binary = "docker"
sh """ sh """
${dockerRun} ${container_type} ${docker_binary} make lint ${dockerRun} ${container_type} ${docker_binary} bash -c "source activate cpu_test && make lint"
""" """
deleteDir() deleteDir()
} }
@ -173,7 +173,7 @@ def SphinxDoc() {
def docker_binary = "docker" def docker_binary = "docker"
def docker_extra_params = "CI_DOCKER_EXTRA_PARAMS_INIT='-e SPHINX_GIT_BRANCH=${BRANCH_NAME}'" def docker_extra_params = "CI_DOCKER_EXTRA_PARAMS_INIT='-e SPHINX_GIT_BRANCH=${BRANCH_NAME}'"
sh """#!/bin/bash sh """#!/bin/bash
${docker_extra_params} ${dockerRun} ${container_type} ${docker_binary} make -C doc html ${docker_extra_params} ${dockerRun} ${container_type} ${docker_binary} bash -c "source activate cpu_test && make -C doc html"
""" """
deleteDir() deleteDir()
} }

View File

@ -127,7 +127,7 @@ def TestWin64() {
bat "build\\testxgboost.exe" bat "build\\testxgboost.exe"
echo "Installing Python dependencies..." echo "Installing Python dependencies..."
def env_name = 'win64_' + UUID.randomUUID().toString().replaceAll('-', '') def env_name = 'win64_' + UUID.randomUUID().toString().replaceAll('-', '')
bat "conda env create -n ${env_name} --file=tests/ci_build/win64_conda_env.yml" bat "conda env create -n ${env_name} --file=tests/ci_build/conda_env/win64_test.yml"
echo "Installing Python wheel..." echo "Installing Python wheel..."
bat """ bat """
conda activate ${env_name} && for /R %%i in (python-package\\dist\\*.whl) DO python -m pip install "%%i" conda activate ${env_name} && for /R %%i in (python-package\\dist\\*.whl) DO python -m pip install "%%i"

View File

@ -19,13 +19,9 @@ ENV PATH=/opt/python/bin:$PATH
ENV GOSU_VERSION 1.10 ENV GOSU_VERSION 1.10
# Install Python packages in default env # Create new Conda environment
RUN \ COPY conda_env/cpu_test.yml /scripts/
pip install pyyaml cpplint pylint astroid sphinx numpy scipy pandas matplotlib sh \ RUN conda env create -n cpu_test --file=/scripts/cpu_test.yml
recommonmark guzzle_sphinx_theme mock breathe graphviz hypothesis\
pytest scikit-learn wheel kubernetes urllib3 jsonschema boto3 && \
pip install https://h2o-release.s3.amazonaws.com/datatable/stable/datatable-0.7.0/datatable-0.7.0-cp37-cp37m-linux_x86_64.whl && \
pip install "dask[complete]"
# Install lightweight sudo (not bound to TTY) # Install lightweight sudo (not bound to TTY)
RUN set -ex; \ RUN set -ex; \

View File

@ -0,0 +1,33 @@
name: cpu_test
channels:
- conda-forge
dependencies:
- python=3.7
- pip
- wheel
- pyyaml
- cpplint
- pylint
- numpy
- scipy
- scikit-learn
- pandas
- matplotlib
- dask
- python-graphviz
- hypothesis
- astroid
- sphinx
- sh
- recommonmark
- mock
- breathe
- pytest
- python-kubernetes
- urllib3
- jsonschema
- boto3
- awscli
- pip:
- guzzle_sphinx_theme
- datatable

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
source activate cpu_test
export DMLC_SUBMIT_CLUSTER=local export DMLC_SUBMIT_CLUSTER=local
submit="python3 dmlc-core/tracker/dmlc-submit" submit="python3 dmlc-core/tracker/dmlc-submit"

View File

@ -45,6 +45,7 @@ case "$suite" in
;; ;;
cpu) cpu)
source activate cpu_test
install_xgboost install_xgboost
pytest -v -s --fulltrace tests/python pytest -v -s --fulltrace tests/python
cd tests/distributed cd tests/distributed