-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature]: Add github prebuild workflow after new release. (#1852)
* add prebuild dockerfile * add prebuild test workflw * update * update * rm other workflow for test * Update docker image * add win1o prebuild * add test prebuild * add windows scripts in prebuilt package * add linux scripts in prebuilt package * generate_build_config.py * fix cudnn search * fix env * fix script * fix rpath * fix cwd * fix windows * fix lint * windows prebuild ci * linux prebuild ci * fix * update trigger * Revert "rm other workflow for test" This reverts commit 0a03872. * update sdk build readme * update prebuild * fix dll deps for python >= 3.8 on windows * fix ci * test prebuild * update test script to avoid modify upload folder * add onnxruntime.dll to mmdeploy_python * update prebuild workflow * update prebuild * Update loader.cpp.in * remove exists prebuild files * fix opencv env * update cmake options for mmdeploy python build * remove test code * fix lint --------- Co-authored-by: RunningLeon <mnsheng@yeah.net> Co-authored-by: RunningLeon <maningsheng@sensetime.com>
- Loading branch information
1 parent
9f9b3a8
commit a14177c
Showing
28 changed files
with
1,313 additions
and
215 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
name: prebuild | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev-1.x | ||
paths: | ||
- "mmdeploy/version.py" | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
linux_build: | ||
runs-on: [self-hosted, linux-3090] | ||
container: | ||
image: openmmlab/mmdeploy:manylinux2014_x86_64-cuda11.3 | ||
options: "--gpus=all --ipc=host" | ||
volumes: | ||
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Get mmdeploy version | ||
run: | | ||
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$MMDEPLOY_VERSION" >> $GITHUB_ENV | ||
- name: Build MMDeploy | ||
run: | | ||
source activate mmdeploy-3.6 | ||
pip install pyyaml packaging setuptools wheel | ||
mkdir pack; cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'trt;ort' \ | ||
--system linux --output config.yml --build-mmdeploy | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Build sdk cpu backend | ||
run: | | ||
source activate mmdeploy-3.6 | ||
cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'ort' \ | ||
--system linux --output config.yml --device cpu --build-sdk --build-sdk-monolithic \ | ||
--build-sdk-python --sdk-dynamic-net | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Build sdk cuda backend | ||
run: | | ||
source activate mmdeploy-3.6 | ||
cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'ort;trt' \ | ||
--system linux --output config.yml --device cuda --build-sdk --build-sdk-monolithic \ | ||
--build-sdk-python --sdk-dynamic-net | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Move artifact | ||
run: | | ||
mkdir -p /__w/mmdeploy/prebuild/$MMDEPLOY_VERSION | ||
rm -rf /__w/mmdeploy/prebuild/$MMDEPLOY_VERSION/* | ||
mv pack/* /__w/mmdeploy/prebuild/$MMDEPLOY_VERSION | ||
linux_test: | ||
runs-on: [self-hosted, linux-3090] | ||
needs: linux_build | ||
container: | ||
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3 | ||
options: "--gpus=all --ipc=host" | ||
volumes: | ||
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild | ||
- /data2/actions-runner/testmodel:/__w/mmdeploy/testmodel | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get mmdeploy version | ||
run: | | ||
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$MMDEPLOY_VERSION" >> $GITHUB_ENV | ||
- name: Test python | ||
run: | | ||
cd /__w/mmdeploy/prebuild/$MMDEPLOY_VERSION | ||
bash $GITHUB_WORKSPACE/tools/package_tools/test/test_sdk_python.sh | ||
- name: Test c/cpp | ||
run: | | ||
cd /__w/mmdeploy/prebuild/$MMDEPLOY_VERSION | ||
bash $GITHUB_WORKSPACE/tools/package_tools/test/test_sdk.sh | ||
linux_upload: | ||
runs-on: [self-hosted, linux-3090] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
environment: 'prod' | ||
needs: linux_test | ||
env: | ||
PREBUILD_DIR: /data2/actions-runner/prebuild | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get mmdeploy version | ||
run: | | ||
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$MMDEPLOY_VERSION" >> $GITHUB_ENV | ||
- name: Upload mmdeploy | ||
run: | | ||
cd $PREBUILD_DIR/$MMDEPLOY_VERSION/mmdeploy | ||
pip install twine | ||
# twine upload * --repository testpypi -u __token__ -p ${{ secrets.test_pypi_password }} | ||
twine upload * -u __token__ -p ${{ secrets.pypi_password }} | ||
- name: Upload mmdeploy_python | ||
run: | | ||
cd $PREBUILD_DIR/$MMDEPLOY_VERSION/mmdeploy_python | ||
# twine upload * --repository testpypi -u __token__ -p ${{ secrets.test_pypi_password }} | ||
twine upload * -u __token__ -p ${{ secrets.pypi_password }} | ||
- name: Zip mmdeploy sdk | ||
run: | | ||
cd $PREBUILD_DIR/$MMDEPLOY_VERSION/sdk | ||
for folder in * | ||
do | ||
tar czf $folder.tar.gz $folder | ||
done | ||
- name: Upload mmdeploy sdk | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
$PREBUILD_DIR/$MMDEPLOY_VERSION/sdk/*.tar.gz | ||
windows_build: | ||
runs-on: [self-hosted, win10-3080] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Get mmdeploy version | ||
run: | | ||
conda activate mmdeploy-3.8 | ||
$env:MMDEPLOY_VERSION=(python -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $env:MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$env:MMDEPLOY_VERSION" >> $env:GITHUB_ENV | ||
- name: Build MMDeploy | ||
run: | | ||
. D:\DEPS\cienv\prebuild_gpu_env.ps1 | ||
conda activate mmdeploy-3.6 | ||
mkdir pack; cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'trt;ort' ` | ||
--system windows --output config.yml --build-mmdeploy | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Build sdk cpu backend | ||
run: | | ||
. D:\DEPS\cienv\prebuild_cpu_env.ps1 | ||
conda activate mmdeploy-3.6 | ||
cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'ort' ` | ||
--system windows --output config.yml --device cpu --build-sdk --build-sdk-monolithic ` | ||
--build-sdk-python --sdk-dynamic-net | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Build sdk cuda backend | ||
run: | | ||
. D:\DEPS\cienv\prebuild_gpu_env.ps1 | ||
conda activate mmdeploy-3.6 | ||
cd pack | ||
python ../tools/package_tools/generate_build_config.py --backend 'ort;trt' ` | ||
--system windows --output config.yml --device cuda --build-sdk --build-sdk-monolithic ` | ||
--build-sdk-python --sdk-dynamic-net | ||
python ../tools/package_tools/mmdeploy_builder.py --config config.yml | ||
- name: Move artifact | ||
run: | | ||
New-Item "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION" -ItemType Directory -Force | ||
Remove-Item "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION/*" -Force -Recurse | ||
Move-Item pack/* "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION" | ||
windows_test: | ||
runs-on: [self-hosted, win10-3080] | ||
needs: windows_build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get mmdeploy version | ||
run: | | ||
conda activate mmdeploy-3.8 | ||
$env:MMDEPLOY_VERSION=(python -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $env:MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$env:MMDEPLOY_VERSION" >> $env:GITHUB_ENV | ||
- name: Test python | ||
run: | | ||
cd "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION" | ||
. D:\DEPS\cienv\prebuild_cpu_env.ps1 | ||
conda activate ci-test | ||
& "$env:GITHUB_WORKSPACE/tools/package_tools/test/test_sdk_python.ps1" | ||
- name: Test c/cpp | ||
run: | | ||
cd "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION" | ||
. D:\DEPS\cienv\prebuild_cpu_env.ps1 | ||
& "$env:GITHUB_WORKSPACE/tools/package_tools/test/test_sdk.ps1" | ||
windows_upload: | ||
runs-on: [self-hosted, win10-3080] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
environment: 'prod' | ||
needs: windows_test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get mmdeploy version | ||
run: | | ||
conda activate mmdeploy-3.8 | ||
$env:MMDEPLOY_VERSION=(python -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)") | ||
echo $env:MMDEPLOY_VERSION | ||
echo "MMDEPLOY_VERSION=$env:MMDEPLOY_VERSION" >> $env:GITHUB_ENV | ||
- name: Upload mmdeploy | ||
run: | | ||
cd "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION/mmdeploy" | ||
conda activate mmdeploy-3.8 | ||
# twine upload * --repository testpypi -u __token__ -p ${{ secrets.test_pypi_password }} | ||
twine upload * -u __token__ -p ${{ secrets.pypi_password }} | ||
- name: Upload mmdeploy_python | ||
run: | | ||
cd "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION/mmdeploy_python" | ||
conda activate mmdeploy-3.8 | ||
# twine upload * --repository testpypi -u __token__ -p ${{ secrets.test_pypi_password }} | ||
twine upload * -u __token__ -p ${{ secrets.pypi_password }} | ||
- name: Zip mmdeploy sdk | ||
run: | | ||
cd "D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION/sdk" | ||
$folders = $(ls).Name | ||
foreach ($folder in $folders) { | ||
Compress-Archive -Path $folder -DestinationPath "$folder.zip" | ||
} | ||
- name: Upload mmdeploy sdk | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
D:/DEPS/ciartifact/$env:MMDEPLOY_VERSION/sdk/*.zip |
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
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
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
Oops, something went wrong.