-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a manylinux image for building X86_64 wheels #27
Merged
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7b3ea93
Trigger workflow for `dev2` branch
StrikerRUS 8e15bea
have GitHub Actions try building clang from source
jameslamb 4ad9723
Merge branch 'dev2' of github.com:guolinke/lightgbm-ci-docker into dev2
jameslamb d12823c
comment out unnecessary jobs
jameslamb ab2b011
minimize clang build
jameslamb c5ad9e8
actually install after building
jameslamb 5b083a2
add gcc RPATH to clang
jameslamb 5337735
use clang11, build libc++
jameslamb e0a7a07
add PoCL and Java
jameslamb b388859
fix trailing slash
jameslamb dabd70e
add remaining components and clean up
jameslamb c3554d1
fix JAVA_HOME
jameslamb fd653d9
java-devel
jameslamb 8b31b8b
install sudo
jameslamb aaf9fd2
set JAVA_HOME to a location with jni.h
jameslamb b1c602b
save clang to figure out what is happening
jameslamb ebe16d5
switch to symlinks for libc++
jameslamb 7965b4c
uncomment
jameslamb 16027a6
Merge branch 'dev2' of github.com:guolinke/lightgbm-ci-docker into dev2
jameslamb 1c2df32
add /usr/local/lib64 to LD_LIBRARY_PATH
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!start_azure.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
FROM quay.io/pypa/manylinux_2_28_x86_64 | ||
|
||
# ensure that libraries like libc++ built in this image can be found by the linker | ||
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" | ||
|
||
RUN yum update -y \ | ||
&& yum clean all | ||
|
||
# Install CMake | ||
RUN curl -sL https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.sh -o cmake.sh \ | ||
&& chmod +x cmake.sh \ | ||
&& ./cmake.sh --prefix=/usr/local --exclude-subdir \ | ||
&& rm -f ./cmake.sh | ||
|
||
# building clang | ||
# | ||
# [why v11.1.0?] | ||
# | ||
# - LightGBM is incompatible with libomp v12 and v13 (https://github.com/microsoft/LightGBM/issues/4229) | ||
# - PoCL v1.8 requires LLVM+clang, but only supports v6-v13 (https://github.com/pocl/pocl/blob/3f420ef735672e439097d020db605778dbc4a6a1/cmake/LLVM.cmake#L209) | ||
# - so v11.x is the latest version that will work with the these constraints, and v11.1.0 was the last release in the v11 series | ||
# | ||
# [why from source?] | ||
# | ||
# - manylinux images use a custom sysroot foor the gcc toolchain, which doesn't play well with the precompiled llvm+clang available from https://github.com/llvm/llvm-project/releases | ||
# - there is not a precompiled llvm+clang available for x86_64 architecture + non-Ubuntu distributions | ||
# | ||
# [why are we building libcxx and lld?] | ||
# | ||
# - in case compilation with clang (e.g. of PoCL v1.8) uses libc++ instead of libstdc++ | ||
# | ||
# https://clang.llvm.org/get_started.html | ||
# https://llvm.org/docs/GettingStarted.html#compiling-the-llvm-suite-source-code | ||
ARG CLANG_VER=11.1.0 | ||
RUN mkdir /usr/local/src/clang \ | ||
&& cd /usr/local/src/clang \ | ||
&& git clone --depth 1 --branch llvmorg-$CLANG_VER https://github.com/llvm/llvm-project.git \ | ||
&& cd llvm-project \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DGCC_INSTALL_PREFIX=${DEVTOOLSET_ROOTPATH} \ | ||
-DLLVM_BUILD_BENCHMARKS=OFF \ | ||
-DLLVM_BUILD_DOCS=OFF \ | ||
-DLLVM_BUILD_TESTS=OFF \ | ||
-DLLVM_INCLUDE_BENCHMARKS=OFF \ | ||
-DLLVM_INCLUDE_DOCS=OFF \ | ||
-DLLVM_INCLUDE_TESTS=OFF \ | ||
-DLLVM_ENABLE_BINDINGS=OFF \ | ||
-DLLVM_ENABLE_DOXYGEN=OFF \ | ||
-DLLVM_ENABLE_OCAMLDOC=OFF \ | ||
-DLLVM_ENABLE_PROJECTS="clang;openmp" \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ | ||
-DLLVM_ENABLE_SPHINX=OFF \ | ||
-DLLVM_TARGETS_TO_BUILD="X86" \ | ||
-G "Unix Makefiles" \ | ||
../llvm \ | ||
&& make -j2 \ | ||
&& make install \ | ||
# 'make install' doesn't install these libraries to a standard location | ||
&& cp /usr/local/src/clang/llvm-project/build/lib/x86_64-unknown-linux-gnu/c++/* /usr/local/lib/ \ | ||
&& cd "${HOME}" \ | ||
&& rm -rf /usr/local/src/clang | ||
|
||
# Install PoCL | ||
RUN git clone --depth 1 --branch v1.8 https://github.com/pocl/pocl.git \ | ||
&& cmake \ | ||
-B pocl/build \ | ||
-S pocl \ | ||
-DCMAKE_BUILD_TYPE=release \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_CXX_FLAGS=-stdlib=libstdc++ \ | ||
-DPOCL_INSTALL_ICD_VENDORDIR=/etc/OpenCL/vendors \ | ||
-DPOCL_DEBUG_MESSAGES=OFF \ | ||
-DSTATIC_LLVM=ON \ | ||
-DINSTALL_OPENCL_HEADERS=OFF \ | ||
-DENABLE_SPIR=OFF \ | ||
-DENABLE_POCLCC=OFF \ | ||
-DENABLE_TESTS=OFF \ | ||
-DENABLE_EXAMPLES=OFF \ | ||
&& cmake --build pocl/build -j4 \ | ||
&& cmake --install pocl/build \ | ||
&& rm -f ./compile_test*.bc \ | ||
&& rm -f ./compile_test*.o \ | ||
&& rm -rf ./pocl | ||
|
||
# Install Java | ||
RUN yum install -y \ | ||
java-1.8.0-openjdk.x86_64 \ | ||
&& yum clean all | ||
|
||
ENV JAVA_HOME_8_X64=/usr/lib/jvm/jre-1.8.0-openjdk/lib/ | ||
ENV JAVA_HOME=$JAVA_HOME_8_X64 | ||
|
||
# Install SWIG | ||
RUN curl -sLk https://sourceforge.net/projects/swig/files/swig/swig-4.0.2/swig-4.0.2.tar.gz/download -o swig.tar.gz \ | ||
&& tar -xzf swig.tar.gz \ | ||
&& cd swig-4.0.2 \ | ||
&& ./configure --prefix=/usr/local --without-pcre \ | ||
&& make \ | ||
&& make install \ | ||
&& cd .. \ | ||
&& rm -f ./swig.tar.gz \ | ||
&& rm -rf ./swig-4.0.2 | ||
|
||
# Install miniforge | ||
RUN curl -sL "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-$(uname -m).sh" -o miniforge.sh \ | ||
&& chmod +x miniforge.sh \ | ||
&& ./miniforge.sh -b -p /opt/miniforge \ | ||
&& rm -f ./miniforge.sh \ | ||
&& /opt/miniforge/bin/conda clean -a -y \ | ||
&& chmod -R 777 /opt/miniforge | ||
|
||
ENV CONDA=/opt/miniforge/ | ||
|
||
WORKDIR /vsts | ||
|
||
COPY ./start_azure.sh . | ||
RUN chmod +x start_azure.sh | ||
|
||
CMD ["./start_azure.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
export VSO_AGENT_IGNORE=_,MAIL,OLDPWD,PATH,PWD,VSTS_AGENT,VSTS_ACCOUNT,VSTS_TOKEN_FILE,VSTS_TOKEN,VSTS_POOL,VSTS_WORK,VSO_AGENT_IGNORE | ||
if [ -n "$VSTS_AGENT_IGNORE" ]; then | ||
export VSO_AGENT_IGNORE=$VSO_AGENT_IGNORE,VSTS_AGENT_IGNORE,$VSTS_AGENT_IGNORE | ||
fi | ||
|
||
if [ -e /vsts/agent -a ! -e /vsts/.configure ]; then | ||
trap 'kill -SIGINT $!; exit 130' INT | ||
trap 'kill -SIGTERM $!; exit 143' TERM | ||
/vsts/agent/bin/Agent.Listener run & wait $! | ||
exit $? | ||
fi | ||
|
||
if [ -z "$VSTS_ACCOUNT" ]; then | ||
echo 1>&2 error: missing VSTS_ACCOUNT environment variable | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$VSTS_TOKEN_FILE" ]; then | ||
if [ -z "$VSTS_TOKEN" ]; then | ||
echo 1>&2 error: missing VSTS_TOKEN environment variable | ||
exit 1 | ||
fi | ||
VSTS_TOKEN_FILE=/vsts/.token | ||
echo -n $VSTS_TOKEN > "$VSTS_TOKEN_FILE" | ||
fi | ||
unset VSTS_TOKEN | ||
|
||
if [ -n "$VSTS_AGENT" ]; then | ||
export VSTS_AGENT="$(eval echo $VSTS_AGENT)" | ||
fi | ||
|
||
if [ -n "$VSTS_WORK" ]; then | ||
export VSTS_WORK="$(eval echo $VSTS_WORK)" | ||
mkdir -p "$VSTS_WORK" | ||
fi | ||
|
||
touch /vsts/.configure | ||
rm -rf /vsts/agent | ||
mkdir /vsts/agent | ||
cd /vsts/agent | ||
|
||
web-server() { | ||
while true; do | ||
printf 'HTTP/1.1 302 Found\r\nLocation: https://'$VSTS_ACCOUNT'.visualstudio.com/_admin/_AgentPool\r\n\r\n' | nc -l -p 80 -q 0 > /dev/null | ||
done | ||
} | ||
|
||
cleanup() { | ||
if [ -e config.sh ]; then | ||
./bin/Agent.Listener remove --unattended \ | ||
--auth PAT \ | ||
--token $(cat "$VSTS_TOKEN_FILE") | ||
fi | ||
} | ||
|
||
trap 'cleanup; exit 130' INT | ||
trap 'cleanup; exit 143' TERM | ||
|
||
echo Determining matching VSTS agent... | ||
VSTS_AGENT_RESPONSE=$(curl -LsS \ | ||
-u user:$(cat "$VSTS_TOKEN_FILE") \ | ||
-H 'Accept:application/json;api-version=3.0-preview' \ | ||
"https://$VSTS_ACCOUNT.visualstudio.com/_apis/distributedtask/packages/agent?platform=linux-x64") | ||
|
||
if echo "$VSTS_AGENT_RESPONSE" | jq . >/dev/null 2>&1; then | ||
VSTS_AGENT_URL=$(echo "$VSTS_AGENT_RESPONSE" \ | ||
| jq -r '.value | map([.version.major,.version.minor,.version.patch,.downloadUrl]) | sort | .[length-1] | .[3]') | ||
fi | ||
|
||
if [ -z "$VSTS_AGENT_URL" -o "$VSTS_AGENT_URL" == "null" ]; then | ||
echo 1>&2 error: could not determine a matching VSTS agent - check that account \'$VSTS_ACCOUNT\' is correct and the token is valid for that account | ||
exit 1 | ||
fi | ||
|
||
echo Downloading and installing VSTS agent... | ||
curl -LsS $VSTS_AGENT_URL | tar -xz --no-same-owner & wait $! | ||
|
||
source ./env.sh | ||
|
||
./bin/Agent.Listener configure --unattended \ | ||
--agent "${VSTS_AGENT:-$(hostname)}" \ | ||
--url "https://$VSTS_ACCOUNT.visualstudio.com" \ | ||
--auth PAT \ | ||
--token $(cat "$VSTS_TOKEN_FILE") \ | ||
--pool "${VSTS_POOL:-Default}" \ | ||
--work "${VSTS_WORK:-_work}" \ | ||
--replace & wait $! | ||
|
||
web-server & | ||
./bin/Agent.Listener run & wait $! |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was exactly copied from https://github.com/guolinke/lightgbm-ci-docker/blob/master/dockers/ubuntu-14.04/start_azure.sh. I didn't change anything ini it.