Skip to content

Commit 8d341bb

Browse files
committed
Initial commit for GitHub Actions
1 parent 07ccb5a commit 8d341bb

File tree

102 files changed

+3488
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3488
-2
lines changed
+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Deploy on CentOS
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Install environment
6+
shell: bash
7+
run: |
8+
cd /root
9+
10+
SCL_ENABLE="devtoolset-7"
11+
CENTOS_VERSION=$(rpm --eval '%{centos_ver}')
12+
if [[ "$CENTOS_VERSION" == "6" ]]; then
13+
find /etc/yum.repos.d/ -name *.repo | xargs -i sed -i 's/mirror\.centos\.org\/centos/vault.centos.org/g;s/$releasever/6.10/g;s/mirrorlist/#mirrorlist/g;s/#baseurl/baseurl/g' {}
14+
SCL_ENABLE="devtoolset-7 rh-python36 python27"
15+
fi
16+
echo "SCL_ENABLE=$SCL_ENABLE" >> $GITHUB_ENV
17+
18+
yum -y update
19+
yum -y install centos-release-scl-rh epel-release
20+
if [[ "$CENTOS_VERSION" == "6" ]]; then
21+
sed -i 's/mirror\.centos\.org\/centos/vault.centos.org/g;s/6\/sclo/6.10\/sclo/g;s/mirrorlist/#mirrorlist/g;s/#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
22+
fi
23+
yum -y install $SCL_ENABLE rh-java-common-ant boost-devel ccache clang gcc-c++ gcc-gfortran java-1.8.0-openjdk-devel ant python python36-devel python36-pip swig file which wget unzip tar bzip2 gzip xz patch autoconf-archive automake make libtool bison flex perl nasm alsa-lib-devel freeglut-devel gtk2-devel libusb-devel libusb1-devel curl-devel expat-devel gettext-devel openssl-devel zlib-devel SDL-devel libva-devel libxkbcommon-devel libxkbcommon-x11-devel xcb-util* fontconfig-devel libffi-devel ragel ocl-icd-devel
24+
# https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01962.html
25+
sed -i 's/_mm512_abs_pd (__m512 __A)/_mm512_abs_pd (__m512d __A)/g' /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/include/avx512fintrin.h
26+
source scl_source enable $SCL_ENABLE || true
27+
28+
curl -LO https://github.com/Kitware/CMake/releases/download/v3.16.6/cmake-3.16.6-Linux-x86_64.tar.gz
29+
curl -LO https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
30+
curl -LO https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.3.tar.gz
31+
tar -xzf cmake-3.16.6-Linux-x86_64.tar.gz -C /opt/
32+
tar -xzf apache-maven-3.6.3-bin.tar.gz -C /opt/
33+
tar -xzf git-2.18.3.tar.gz
34+
pushd git-2.18.3; make -j2 prefix=/usr/local/; make -j2 prefix=/usr/local/ install; popd
35+
ln -sf /usr/bin/python3.6 /usr/bin/python3
36+
ln -sf /opt/cmake-3.16.6-Linux-x86_64/bin/* /usr/bin/
37+
ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn
38+
39+
python3 -m pip install gdown
40+
41+
if [[ $CI_DEPLOY_PLATFORM == android-* ]]; then
42+
curl -LO https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
43+
unzip -qq android-ndk-r18b-linux-x86_64.zip
44+
ln -sf android-ndk-r18b android-ndk
45+
echo "MAVEN_OPTIONS=-Djavacpp.platform.root=$(pwd)/android-ndk/ -Djava.library.path=" >> $GITHUB_ENV
46+
fi
47+
48+
if [[ $CI_DEPLOY_PLATFORM == "linux-x86" ]]; then
49+
rpm -qa | sed s/.x86_64$/.i686/ | xargs yum -q -y install
50+
wget --no-directories --no-parent -r https://www.repo.cloudlinux.com/cloudlinux/$CENTOS_VERSION/sclo/devtoolset-7/i386/
51+
rpm -i --force --nodeps *.rpm
52+
fi
53+
54+
if [[ -n ${CI_DEPLOY_NEED_BAZEL:-} ]]; then
55+
echo Installing Bazel
56+
curl -LO https://github.com/bazelbuild/bazel/releases/download/0.25.3/bazel-0.25.3-installer-linux-x86_64.sh
57+
bash bazel-0.25.3-installer-linux-x86_64.sh
58+
fi
59+
60+
if [[ "$CI_DEPLOY_PLATFORM" == "linux-x86_64" ]] && [[ -n ${CI_DEPLOY_NEED_CUDA:-} ]]; then
61+
echo Installing CUDA, cuDNN, etc
62+
curl -LO https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-rhel7-11-1-local-11.1.1_455.32.00-1.x86_64.rpm
63+
curl -LO https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.4/cudnn-11.1-linux-x64-v8.0.4.30.tgz
64+
curl -LO https://developer.download.nvidia.com/compute/redist/nccl/v2.7/nccl_2.7.8-1+cuda11.1_x86_64.txz
65+
66+
rpm -i cuda-repo-rhel7-11-1-local-11.1.1_455.32.00-1.x86_64.rpm
67+
pushd /var/cuda-repo-rhel7-11-1-local/; rpm -i --nodeps cuda*.rpm libc*.rpm libn*.rpm; rm *.rpm; popd
68+
ln -sf /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/libcuda.so
69+
ln -sf /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/libnvidia-ml.so
70+
tar -hxvf cudnn-11.1-linux-x64-v8.0.4.30.tgz -C /usr/local/
71+
tar -hxvf nccl_2.7.8-1+cuda11.1_x86_64.txz --strip-components=1 -C /usr/local/cuda/
72+
mv /usr/local/cuda/lib/* /usr/local/cuda/lib64/
73+
74+
# Work around issues with CUDA 10.2/11.x
75+
mv /usr/include/cublas* /usr/include/nvblas* /usr/local/cuda/include/ || true
76+
mv /usr/lib64/libcublas* /usr/lib64/libnvblas* /usr/local/cuda/lib64/ || true
77+
for f in /usr/local/cuda/lib64/*.so.10; do ln -s $f $f.2; done
78+
for f in /usr/local/cuda/lib64/*.so.10; do ln -s $f ${f:0:${#f}-1}1; done
79+
ln -s libcudart.so.11.0 /usr/local/cuda/lib64/libcudart.so.11.1
80+
cp /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib64/libcuda.so
81+
cp /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib64/libcuda.so.1
82+
cp /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/lib64/libnvidia-ml.so
83+
cp /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/lib64/libnvidia-ml.so.1
84+
85+
# Remove downloaded archives and unused libraries to avoid running out of disk space
86+
rm -f *.rpm *.tgz *.txz *.tar.*
87+
rm -f $(find /usr/local/cuda/ -name '*.a' -and -not -name libcudart_static.a -and -not -name libcudadevrt.a)
88+
fi
89+
90+
if [[ "$CI_DEPLOY_MODULE" == "tensorrt" ]]; then
91+
python3 -m gdown.cli https://drive.google.com/uc?id=1-SQo1jZZ6FM6PWbAt9YLZisWQolCxbxX
92+
tar -hxvf TensorRT-7.2.1.6.CentOS-7.6.x86_64-gnu.cuda-11.1.cudnn8.0.tar.gz -C /usr/local/
93+
ln -sf /usr/local/TensorRT* /usr/local/tensorrt
94+
fi
95+
96+
if [[ "$CI_DEPLOY_MODULE" == "mkl" ]]; then
97+
echo Installing MKL
98+
curl -LO https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/16917/l_mkl_2020.4.304.tgz
99+
tar -xzvf l_mkl_2020.4.304.tgz
100+
sed -i -e 's/decline/accept/g' l_mkl_2020.4.304/silent.cfg
101+
l_mkl_2020.4.304/install.sh -s l_mkl_2020.4.304/silent.cfg
102+
fi
103+
104+
if [[ "$CI_DEPLOY_PLATFORM" == "linux-x86" ]] && [[ "$CI_DEPLOY_MODULE" == "flycapture" ]]; then
105+
echo Installing FlyCapture i386
106+
python3 -m gdown.cli https://drive.google.com/uc?id=1BOpSik1Fndagzjf4ykwzermt2qlTzsWI
107+
tar -xzvf flycapture2-2.13.3.31-i386-pkg_xenial.tgz
108+
find -name *.deb | while read f; do ar -xv $f; tar --totals -xf data.tar.xz -C /; done;
109+
fi
110+
111+
if [[ "$CI_DEPLOY_PLATFORM" == "linux-x86_64" ]] && [[ "$CI_DEPLOY_MODULE" == "flycapture" ]]; then
112+
echo Installing FlyCapture amd64
113+
python3 -m gdown.cli https://drive.google.com/uc?id=1YtVjdnbQLZHX_ocQ6xAmiq6pjftuPOPd
114+
tar -xzvf flycapture2-2.13.3.31-amd64-pkg_xenial.tgz
115+
find -name *.deb | while read f; do ar -xv $f; tar --totals -xf data.tar.xz -C /; done;
116+
fi
117+
118+
if [[ "$CI_DEPLOY_PLATFORM" == "linux-x86_64" ]] && [[ "$CI_DEPLOY_MODULE" == "spinnaker" ]]; then
119+
echo Installing Spinnaker amd64
120+
python3 -m gdown.cli https://drive.google.com/uc?id=1DiI8mG1fyewEGWxW7keg-dqXk0rLwmAK
121+
tar -xzvf spinnaker-1.27.0.48-Ubuntu16.04-amd64-pkg.tar.gz
122+
find -name *.deb | while read f; do ar -xv $f; tar --totals -xf data.tar.xz -C /; done;
123+
ln -s libSpinnaker_C.so.1.27.0.48 /usr/lib/libSpinnaker_C.so.1
124+
ln -s libSpinnaker.so.1.27.0.48 /usr/lib/libSpinnaker.so.1
125+
fi
126+
127+
rm -f /usr/lib/libgfortran.so.3* /usr/lib64/libgfortran.so.3* # not required for GCC 7+
128+
129+
- name: Build project
130+
shell: bash
131+
run: |
132+
source scl_source enable $SCL_ENABLE || true
133+
git --version
134+
gcc --version
135+
mvn -version
136+
cmake --version
137+
gpg --version
138+
df -h
139+
140+
echo Fetching $GITHUB_REPOSITORY@$GITHUB_SHA
141+
git init
142+
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY $GITHUB_SHA
143+
git checkout $GITHUB_SHA
144+
145+
echo "Fixing HOME to /root (was '$HOME')"
146+
export HOME=/root
147+
mkdir -p $HOME/.m2
148+
[[ "${{ github.event_name }}" == "pull_request" ]] && MAVEN_PHASE=install || MAVEN_PHASE=deploy
149+
echo "<settings>" > $HOME/.m2/settings.xml
150+
echo "<mirrors><mirror><id>google-maven-central</id><name>GCS Maven Central mirror</name><url>https://maven-central.storage-download.googleapis.com/maven2/</url><mirrorOf>central</mirrorOf></mirror></mirrors>" >> $HOME/.m2/settings.xml
151+
echo "<servers><server><id>sonatype-nexus-snapshots</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server><server><id>sonatype-nexus-staging</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server></servers>" >> $HOME/.m2/settings.xml
152+
echo "</settings>" >> $HOME/.m2/settings.xml
153+
154+
SECONDS=$(( RANDOM % 300 ))
155+
echo Sleeping $SECONDS seconds to help avoid race conditions with Maven
156+
sleep $SECONDS
157+
158+
export MAKEJ=$(getconf _NPROCESSORS_ONLN)
159+
echo Executing Maven $MAVEN_PHASE on $MAKEJ processors
160+
export EXT=${{ matrix.ext }}
161+
export EXT2=${EXT:1}
162+
export MAVEN_OPTIONS="clean $MAVEN_PHASE -B -U -e -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3 -Djavacpp.platform=$CI_DEPLOY_PLATFORM -Djavacpp.platform.extension=$EXT $MAVEN_OPTIONS"
163+
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE && break || STATUS=$? && sleep 60; done; (exit $STATUS)
164+
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE/platform/$EXT2/pom.xml && break || STATUS=$? && sleep 60; done; (exit $STATUS)
165+
df -h
166+
167+
- name: Clean up
168+
shell: bash
169+
run: |
170+
cd /root
171+
rm -Rf $(find .m2/repository/ -name '*SNAPSHOT*')
+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Deploy on Mac OS X
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Install environment
6+
shell: bash
7+
run: |
8+
cd $HOME
9+
10+
export MACOSX_DEPLOYMENT_TARGET=10.13
11+
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV
12+
13+
brew install boost ccache gcc swig autoconf-archive automake cmake libomp libtool libusb ant maven nasm xz pkg-config sdl gpg1 bison flex perl ragel
14+
15+
if [[ -n ${CI_DEPLOY_NEED_GCC:-} ]]; then
16+
brew install gcc@7
17+
brew link --overwrite gcc@7
18+
19+
echo Removing "fixed" header files that are actually broken
20+
sudo rm -Rf $(find /usr/local/Cellar/gcc@7/ -iname include-fixed)
21+
22+
echo Fixing up some binaries to support rpath
23+
sudo install_name_tool -add_rpath /usr/local/lib/gcc/7/ -add_rpath @loader_path/. -id @rpath/libgomp.1.dylib /usr/local/lib/gcc/7/libgomp.1.dylib
24+
sudo install_name_tool -add_rpath /usr/local/lib/gcc/7/ -add_rpath @loader_path/. -id @rpath/libstdc++.6.dylib /usr/local/lib/gcc/7/libstdc++.6.dylib
25+
sudo install_name_tool -add_rpath /usr/local/lib/gcc/7/ -add_rpath @loader_path/. -id @rpath/libgfortran.4.dylib /usr/local/lib/gcc/7/libgfortran.4.dylib
26+
sudo install_name_tool -add_rpath /usr/local/lib/gcc/7/ -add_rpath @loader_path/. -id @rpath/libquadmath.0.dylib /usr/local/lib/gcc/7/libquadmath.0.dylib
27+
sudo install_name_tool -add_rpath /usr/local/lib/gcc/7/ -add_rpath @loader_path/. -id @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/7/libgcc_s.1.dylib
28+
sudo install_name_tool -change /usr/local/Cellar/gcc@7/7.5.0_2/lib/gcc/7/libquadmath.0.dylib @rpath/libquadmath.0.dylib /usr/local/lib/gcc/7/libgfortran.4.dylib
29+
sudo install_name_tool -change /usr/local/lib/gcc/7/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/7/libgomp.1.dylib
30+
sudo install_name_tool -change /usr/local/lib/gcc/7/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/7/libstdc++.6.dylib
31+
sudo install_name_tool -change /usr/local/lib/gcc/7/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/7/libgfortran.4.dylib
32+
sudo install_name_tool -change /usr/local/lib/gcc/7/libgcc_s.1.dylib @rpath/libgcc_s.1.dylib /usr/local/lib/gcc/7/libquadmath.0.dylib
33+
fi
34+
35+
sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libomp.dylib /usr/local/opt/libomp/lib/libomp.dylib
36+
sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libSDL-1.2.0.dylib /usr/local/lib/libSDL-1.2.0.dylib
37+
sudo install_name_tool -add_rpath @loader_path/. -id @rpath/libusb-1.0.0.dylib /usr/local/lib/libusb-1.0.0.dylib
38+
39+
python3 -m pip install gdown
40+
41+
if [[ -n ${CI_DEPLOY_NEED_BAZEL:-} ]]; then
42+
echo Installing Bazel
43+
curl -LO https://github.com/bazelbuild/bazel/releases/download/0.25.3/bazel-0.25.3-installer-darwin-x86_64.sh
44+
sudo bash bazel-0.25.3-installer-darwin-x86_64.sh
45+
fi
46+
47+
if [[ "$CI_DEPLOY_MODULE" == "mkl" ]]; then
48+
echo Installing MKL
49+
curl -LO https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17172/m_mkl_2020.4.301.dmg
50+
hdiutil mount m_mkl_2020.4.301.dmg
51+
cp /Volumes/m_mkl_2020.4.301/m_mkl_2020.4.301.app/Contents/MacOS/silent.cfg .
52+
sed -i -e 's/decline/accept/g' silent.cfg
53+
sudo /Volumes/m_mkl_2020.4.301/m_mkl_2020.4.301.app/Contents/MacOS/install.sh -s silent.cfg
54+
fi
55+
56+
- name: Build project
57+
shell: bash
58+
run: |
59+
git --version
60+
clang --version
61+
/usr/local/bin/gcc-? --version
62+
mvn -version
63+
cmake --version
64+
gpg --version
65+
df -h
66+
67+
echo Fetching $GITHUB_REPOSITORY@$GITHUB_SHA
68+
git init
69+
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY $GITHUB_SHA
70+
git checkout $GITHUB_SHA
71+
72+
mkdir -p $HOME/.m2
73+
[[ "${{ github.event_name }}" == "pull_request" ]] && MAVEN_PHASE=install || MAVEN_PHASE=deploy
74+
echo "<settings>" > $HOME/.m2/settings.xml
75+
echo "<mirrors><mirror><id>google-maven-central</id><name>GCS Maven Central mirror</name><url>https://maven-central.storage-download.googleapis.com/maven2/</url><mirrorOf>central</mirrorOf></mirror></mirrors>" >> $HOME/.m2/settings.xml
76+
echo "<servers><server><id>sonatype-nexus-snapshots</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server><server><id>sonatype-nexus-staging</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server></servers>" >> $HOME/.m2/settings.xml
77+
echo "</settings>" >> $HOME/.m2/settings.xml
78+
79+
SECONDS=$(( RANDOM % 300 ))
80+
echo Sleeping $SECONDS seconds to help avoid race conditions with Maven
81+
sleep $SECONDS
82+
83+
export MAKEJ=$(getconf _NPROCESSORS_ONLN)
84+
echo Executing Maven $MAVEN_PHASE on $MAKEJ processors
85+
export EXT=${{ matrix.ext }}
86+
export EXT2=${EXT:1}
87+
export MAVEN_OPTIONS="clean $MAVEN_PHASE -B -U -e -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3 -Djavacpp.platform=$CI_DEPLOY_PLATFORM -Djavacpp.platform.extension=$EXT $MAVEN_OPTIONS"
88+
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE && break || STATUS=$? && sleep 60; done; (exit $STATUS)
89+
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE/platform/$EXT2/pom.xml && break || STATUS=$? && sleep 60; done; (exit $STATUS)
90+
df -h
91+
92+
- name: Clean up
93+
shell: bash
94+
run: |
95+
cd $HOME
96+
rm -Rf $(find .m2/repository/ -name '*SNAPSHOT*')

0 commit comments

Comments
 (0)