Skip to content
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

[CI] Configured Jenkinsfile to support nightly test #2405

Merged
merged 6 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 51 additions & 38 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,70 +1,78 @@
pipeline {
agent any
environment {
PYPI_PWD = credentials('PYPI_PWD')
PATH = "/usr/local/clang-7.0.1/bin:/usr/local/cuda/bin/:$PATH"
LD_LIBRARY_PATH = "/usr/local/clang-7.0.1/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
CC = "clang-7"
CXX = "clang++"
PYPI_PWD = credentials("${PYPI_PWD}")
PATH = "/opt/taichi-llvm-10.0.0/bin:/usr/local/cuda/bin/:$PATH"
CC = "clang-10"
CXX = "clang++-10"
PYTHON_EXECUTABLE = "python3"
// Local machine uses version 11.2. However, we need to define
// TI_CUDAVERSION, which eventually translates to the version number
// of the slimmed CUDA libdevice bytecode. Currently this slimmed
// version only covers 10. See:
// https://github.com/taichi-dev/taichi/tree/master/external/cuda_libdevice
// so we pass hack version to avoid build errors.
HACK_CUDA_VERSION = "10.0"
}
stages{
stage('Build') {
stage('Build and Test') {
parallel {
stage('cuda10.0-python3.6') {
stage('python3.6') {
agent {
node {
label "cuda10_0 && python3_6"
customWorkspace "taichi_cu100_py36"
label "python36"
customWorkspace "taichi_py36"
}
}
environment {
PYTHON_EXECUTABLE = "python3.6"
CUDA_VERSION = "10.0"
CONDA_ENV = "py36"
}
steps{
build_taichi()
}
}
stage('cuda10.0-python3.7') {
stage('python3.7') {
agent {
node {
label "cuda10_0 && python3_7"
customWorkspace "taichi_cu100_py37"
label "python37"
customWorkspace "taichi_py37"
}
}
environment {
PYTHON_EXECUTABLE = "python3.7"
CUDA_VERSION = "10.0"
CONDA_ENV = "py37"
}
steps{
build_taichi()
}
}
stage('cuda10.0-python3.8') {
stage('python3.8') {
agent {
node {
label "cuda10_0 && python3_8"
customWorkspace "taichi_cu100_py38"
label "python38"
customWorkspace "taichi_py38"
}
}
environment {
PYTHON_EXECUTABLE = "python3.8"
CUDA_VERSION = "10.0"
CONDA_ENV = "py38"
}
steps{
build_taichi()
}
}
stage('python3.9') {
agent {
node {
label "python39"
customWorkspace "taichi_py39"
}
}
environment {
CONDA_ENV = "py39"
}
steps{
build_taichi()
}
}
}
}
stage('Test') {
steps {
sh "echo Testing"
}
}
stage('Release') {
steps {
sh "echo releasing"
}
}
}
Expand All @@ -81,25 +89,30 @@ void build_taichi() {
$CC --version
$CXX --version
echo $WORKSPACE
. "/home/buildbot/miniconda3/etc/profile.d/conda.sh"
conda activate $CONDA_ENV
$PYTHON_EXECUTABLE -m pip install --user setuptools astor pybind11 pylint sourceinspect
$PYTHON_EXECUTABLE -m pip install --user pytest pytest-rerunfailures pytest-xdist yapf
$PYTHON_EXECUTABLE -m pip install --user numpy GitPython coverage colorama autograd
export TAICHI_REPO_DIR=$WORKSPACE/
$PYTHON_EXECUTABLE -m pip install --user numpy GitPython coverage colorama autograd torch
Leonz5288 marked this conversation as resolved.
Show resolved Hide resolved
export TAICHI_REPO_DIR=$WORKSPACE
echo $TAICHI_REPO_DIR
export PYTHONPATH=$TAICHI_REPO_DIR/python
export PATH=$WORKSPACE/bin/:$PATH
nvidia-smi
cd $TAICHI_REPO_DIR
git submodule update --init --recursive
[ -e build ] && rm -rf build
mkdir build && cd build
export CUDA_BIN_PATH=/usr/local/cuda-${CUDA_VERSION}
cmake .. -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -DCUDA_VERSION=$CUDA_VERSION
mkdir build
cd build
cmake .. -DLLVM_DIR=/opt/taichi-llvm-10.0.0/lib/cmake/llvm \
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
-DCUDA_VERSION=$HACK_CUDA_VERSION \
-DTI_WITH_OPENGL=ON
make -j 8
ldd libtaichi_core.so
objdump -T libtaichi_core.so| grep GLIBC
cd ../python
ti test -t 1 -na opengl
$PYTHON_EXECUTABLE build.py upload
ti test -t 2
$PYTHON_EXECUTABLE build.py upload ${TEST_OPTION}
'''
}
3 changes: 2 additions & 1 deletion python/build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import argparse
import os
import platform
import re
import shutil
import sys
import re

import taichi as ti

Expand Down Expand Up @@ -148,6 +148,7 @@ def main():
project_name = args.project_name

env_pypi_pwd = os.environ.get('PYPI_PWD', '')

if mode == 'try_upload':
if env_pypi_pwd == '':
print("Missing environment variable PYPI_PWD")
Expand Down