From afbb118775521333a4acdc262751caa24f1cd792 Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 4 Jun 2021 10:33:02 +0800 Subject: [PATCH 1/6] Changed exit() to better sys.exit() --- examples/mass_spring_3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mass_spring_3d.py b/examples/mass_spring_3d.py index 5098df16aebe3..adda7315b8ebb 100644 --- a/examples/mass_spring_3d.py +++ b/examples/mass_spring_3d.py @@ -1,7 +1,7 @@ import sys import numpy as np - +import sys import taichi as ti try: From 2900cda8cadd68f227b2874a21b3612c660b3d8f Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 4 Jun 2021 18:49:11 +0800 Subject: [PATCH 2/6] [CI] Configured Jenkinsfile to support nightly test --- Jenkinsfile | 78 +++++++++++++++++++++++++++---------------------- python/build.py | 1 + 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8674107eaeeea..836ae781018b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,70 +1,73 @@ 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 use 11.2, we pass a hack version to avoid build errors. + HACK_CUDA_VERSION = "10.0" } stages{ stage('Build') { 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" } } } @@ -81,10 +84,12 @@ 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/ + export TAICHI_REPO_DIR=$WORKSPACE echo $TAICHI_REPO_DIR export PYTHONPATH=$TAICHI_REPO_DIR/python export PATH=$WORKSPACE/bin/:$PATH @@ -93,13 +98,16 @@ void build_taichi() { 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 + export CUDA_BIN_PATH=/usr/local/cuda-${HACK_CUDA_VERSION} + 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} ''' } diff --git a/python/build.py b/python/build.py index 39dce436ffe57..a9754af94c96f 100644 --- a/python/build.py +++ b/python/build.py @@ -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") From 497a7432eb58a2de636d239207895605bb82494b Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 5 Jun 2021 14:50:20 +0800 Subject: [PATCH 3/6] [CI] Configured Jenkinsfile to support nightly test --- Jenkinsfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 836ae781018b5..2302c6a9e374a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,11 +6,16 @@ pipeline { CC = "clang-10" CXX = "clang++-10" PYTHON_EXECUTABLE = "python3" - // Local machine use 11.2, we pass a hack version to avoid build errors. + // 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('python3.6') { agent { @@ -88,7 +93,7 @@ void build_taichi() { 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 + $PYTHON_EXECUTABLE -m pip install --user numpy GitPython coverage colorama autograd torch export TAICHI_REPO_DIR=$WORKSPACE echo $TAICHI_REPO_DIR export PYTHONPATH=$TAICHI_REPO_DIR/python @@ -97,8 +102,8 @@ void build_taichi() { 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-${HACK_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 \ From cf9c7ead6c8447c59311611819a5c58dabf945e7 Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 5 Jun 2021 14:52:36 +0800 Subject: [PATCH 4/6] delete redundancy --- examples/mass_spring_3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mass_spring_3d.py b/examples/mass_spring_3d.py index adda7315b8ebb..5098df16aebe3 100644 --- a/examples/mass_spring_3d.py +++ b/examples/mass_spring_3d.py @@ -1,7 +1,7 @@ import sys import numpy as np -import sys + import taichi as ti try: From 0b932e06d279441dce79505bf6597b749abe7c1d Mon Sep 17 00:00:00 2001 From: Taichi Gardener Date: Sat, 5 Jun 2021 06:54:39 +0000 Subject: [PATCH 5/6] Auto Format --- python/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/build.py b/python/build.py index a9754af94c96f..f78e4277759df 100644 --- a/python/build.py +++ b/python/build.py @@ -1,9 +1,9 @@ import argparse import os import platform +import re import shutil import sys -import re import taichi as ti From db361acf1bf456de68a2b9d3feade7aab0b5fed2 Mon Sep 17 00:00:00 2001 From: Jiasheng Zhang Date: Mon, 7 Jun 2021 10:10:00 +0800 Subject: [PATCH 6/6] Update Jenkinsfile Co-authored-by: Ye Kuang --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2302c6a9e374a..4ab3019d84bef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,7 +93,7 @@ void build_taichi() { 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 torch + $PYTHON_EXECUTABLE -m pip install --user numpy GitPython coverage colorama autograd export TAICHI_REPO_DIR=$WORKSPACE echo $TAICHI_REPO_DIR export PYTHONPATH=$TAICHI_REPO_DIR/python