Skip to content

Commit

Permalink
[ci] added job for swig compilation on Linux with artifacts (#2125)
Browse files Browse the repository at this point in the history
* added job for swig compilation on Linux with artifacts

* hotfix

* test: SWIG with Clang compiler

* switch compiler back to gcc

* switch to main docker
  • Loading branch information
StrikerRUS authored and guolinke committed Apr 30, 2019
1 parent 8d2ec69 commit 739c263
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .ci/dockers/ubuntu-14.04/Dockerfile
Expand Up @@ -41,6 +41,26 @@ RUN curl -sL https://cmake.org/files/v3.14/cmake-3.14.1-Linux-x86_64.sh -o cmake
&& ./cmake.sh --prefix=/usr/local --exclude-subdir \
&& rm cmake.sh

# Install Java

This comment has been minimized.

Copy link
@StrikerRUS

StrikerRUS Apr 30, 2019

Author Collaborator

@guolinke Sorry for bothering you. Docker has been updated and is fresh now. Please re-run CI for this commit to start providing jar artifact when you have time.

This comment has been minimized.

Copy link
@guolinke

guolinke Apr 30, 2019

Collaborator

just manually start the build.
I think we can have a new release with the jar.

This comment has been minimized.

Copy link
@StrikerRUS

StrikerRUS Apr 30, 2019

Author Collaborator

Thanks!

RUN add-apt-repository ppa:openjdk-r/ppa -y \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/

# Install SWIG
RUN curl -sL https://downloads.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz -o swig.tar.gz \
&& tar -xzf swig.tar.gz \
&& cd swig-3.0.12 \
&& ./configure --prefix=/usr/local --without-pcre \
&& make \
&& make install \
&& cd .. \
&& rm swig.tar.gz \
&& rm -rf swig-3.0.12

# Install Miniconda
RUN curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
&& chmod +x miniconda.sh \
Expand Down
13 changes: 13 additions & 0 deletions .ci/test.sh
Expand Up @@ -18,6 +18,19 @@ else
CMAKE_OPTS=()
fi

if [[ $AZURE == "true" ]] && [[ $OS_NAME == "linux" ]] && [[ $TASK == "swig" ]]; then
mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build
cmake -DUSE_SWIG=ON "${CMAKE_OPTS[@]}" ..
make -j4 || exit -1
if [[ $COMPILER == "gcc" ]]; then
objdump -T $BUILD_DIRECTORY/lib_lightgbm.so > $BUILD_DIRECTORY/objdump.log || exit -1
objdump -T $BUILD_DIRECTORY/lib_lightgbm_swig.so >> $BUILD_DIRECTORY/objdump.log || exit -1
python $BUILD_DIRECTORY/helpers/check_dynamic_dependencies.py $BUILD_DIRECTORY/objdump.log || exit -1
fi
cp $BUILD_DIRECTORY/build/lightgbmlib.jar $BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib.jar
exit 0
fi

conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION
source activate $CONDA_ENV

Expand Down
4 changes: 3 additions & 1 deletion .vsts-ci.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
vmImage: 'ubuntu-16.04'
container: ubuntu1404
strategy:
maxParallel: 6
maxParallel: 7
matrix:
regular:
TASK: regular
Expand All @@ -25,6 +25,8 @@ jobs:
bdist:
TASK: bdist
PYTHON_VERSION: 3.6
swig:
TASK: swig
inference:
TASK: if-else
mpi_source:
Expand Down

0 comments on commit 739c263

Please sign in to comment.