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] Add libtaichi_export_core build for desktop in CI #4871

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 14 additions & 5 deletions .github/workflows/scripts/unix_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ setup_python() {
python3 -m pip install -r requirements_dev.txt
}

build() {
build_taichi_wheel() {
git fetch origin master
PROJECT_TAGS=""
EXTRA_ARGS=""
Expand All @@ -69,12 +69,21 @@ build() {
sccache -s
}

build_libtaichi_export() {
git fetch origin master
python3 setup.py build_ext
}

setup_sccache
setup_python
build
cat "$SCCACHE_ERROR_LOG" || true
NUM_WHL=$(ls dist/*.whl | wc -l)
if [ $NUM_WHL -ne 1 ]; then echo "ERROR: created more than 1 whl." && exit 1; fi

if [ "$EXPORT_CORE" == "1" ]; then
build_libtaichi_export
else
build_taichi_wheel
NUM_WHL=$(ls dist/*.whl | wc -l)
if [ $NUM_WHL -ne 1 ]; then echo "ERROR: created more than 1 whl." && exit 1; fi
fi

chmod -R 777 "$SCCACHE_DIR"
rm -f python/CHANGELOG.md
54 changes: 54 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,57 @@ jobs:
PY: ${{ matrix.python }}
PLATFORM: 'm1'
TI_CI: 1

build_libtaichi_export:
name: Build libtaichi_export.so(GPU)
needs: check_files
runs-on: [self-hosted, cuda, vulkan, cn]
timeout-minutes: 60
strategy:
matrix:
include:
- os: ubuntu-latest
python: py39
with_cc: ON
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Get sccache cache
uses: actions/cache@v2
with:
path: sccache_cache
key: sccache-linux-${{matrix.with_cc}}-${{ github.sha }}
restore-keys: |
sccache-linux-${{matrix.with_cc}}-

- name: Build For Desktop
run: |
if [[ ${{needs.check_files.outputs.run_job}} == false ]]; then
exit 0
fi
docker create --user dev --name taichi_build_desktop --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix \
-e PY -e GPU_BUILD -e PROJECT_NAME -e TAICHI_CMAKE_ARGS -e DISPLAY -e EXPORT_CORE\
registry.taichigraphics.com/taichidev-ubuntu18.04:v0.2.1 \
/home/dev/taichi/.github/workflows/scripts/unix_build.sh
# A tarball is needed because sccache needs some permissions that only the file owner has.
# 1000 is the uid and gid of user "dev" in the container.
# If the uid or gid of the user inside the docker changes, please change the uid and gid in the following line.
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx --owner 1000 --group 1000 | docker cp - taichi_build_desktop:/home/dev/
docker start -a taichi_build_desktop
env:
PY: ${{ matrix.python }}
GPU_BUILD: ON
PROJECT_NAME: taichi
TAICHI_CMAKE_ARGS: -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_LLVM:BOOL=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DTI_EXPORT_CORE:BOOL=ON
EXPORT_CORE: 1
DISPLAY: :1

- name: clean docker container
if: always()
run: |
docker rm taichi_build_desktop -f
1 change: 0 additions & 1 deletion cmake/TaichiExportCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ set(TAICHI_EXPORT_CORE_NAME taichi_export_core)

add_library(${TAICHI_EXPORT_CORE_NAME} SHARED)
target_link_libraries(${TAICHI_EXPORT_CORE_NAME} taichi_isolated_core)
install(TARGETS ${TAICHI_EXPORT_CORE_NAME} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/build)