Skip to content

Commit

Permalink
Merge branch 'release/2023.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Jun 20, 2023
2 parents 1f5650a + c8bb579 commit f79f9c6
Show file tree
Hide file tree
Showing 47 changed files with 4,887 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Language: Cpp
BasedOnStyle: Chromium
ReflowComments: false
---
Language: ObjC
BasedOnStyle: Chromium
ReflowComments: false
17 changes: 17 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":timezone(Asia/Tokyo)",
":combinePatchMinorReleases",
":prHourlyLimitNone",
":prConcurrentLimit10",
"group:recommended",
"group:allNonMajor",
"schedule:weekly"
],
"ignorePaths": [
"**/.python-version"
],
"dependencyDashboard": false
}
183 changes: 183 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: build

on:
workflow_dispatch:
push:
paths-ignore:
- "doc/**"
- "**.md"

jobs:
build_linux_macos:
strategy:
fail-fast: false
matrix:
platform:
- name: ubuntu-22.04_x86_64
runs_on: ubuntu-22.04
os: ubuntu
auditwheel_plat: manylinux_2_35_x86_64
- name: ubuntu-20.04_armv8_jetson
runs_on: ubuntu-20.04
os: ubuntu
- name: macos-13_arm64
runs_on: macos-13
os: macos
python_host_platform: "macosx-13.0-arm64"
archflags: "-arch arm64"
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
exclude:
# Jetson は Python 3.8 のみ作成する
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.9"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
runs-on: ${{ matrix.platform.runs_on }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- run: |
sudo apt-get update
sudo apt-get -y install libva-dev libdrm-dev
if: ${{ matrix.platform.os == 'ubuntu' }}
- run: curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash
- run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
- run: rye pin cpython@${{ matrix.python_version }}
- run: rye sync

# Jetson 以外の Ubuntu 向け
- run: |
rye run python run.py
rye run python -m build
# # auditwheel を適用する
# rm -rf patchelf
# mkdir -p patchelf
# pushd patchelf
# # Ubuntu 20.04 の patchelf は auditwheel が要求するバージョンを満たしてないので
# # リポジトリから新しいバイナリを取得する
# curl -LO https://github.com/NixOS/patchelf/releases/download/0.14.3/patchelf-0.14.3-x86_64.tar.gz
# tar -xf patchelf-0.14.3-x86_64.tar.gz
# popd
# # 共有ライブラリを除ける
# ./scripts/fix_shared_lib.sh src/sora_sdk/*.so > excludes
# PATH=`pwd`/patchelf/bin:$PATH rye run python -m auditwheel repair --plat ${{ matrix.platform.auditwheel_plat }} dist/*.whl `cat excludes`
if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-20.04_armv8_jetson' }}
# Jetson 向け
- name: Set up QEMU
if: ${{ matrix.platform.name == 'ubuntu-20.04_armv8_jetson' }}
uses: docker/setup-qemu-action@v2
- run: |
sudo apt-get install -y multistrap binutils-aarch64-linux-gnu
# multistrap に insecure なリポジトリからの取得を許可する設定を入れる
sudo sed -e 's/Apt::Get::AllowUnauthenticated=true/Apt::Get::AllowUnauthenticated=true";\n$config_str .= " -o Acquire::AllowInsecureRepositories=true/' -i /usr/sbin/multistrap
rye run python run.py
# auditwheel も適用する
# ./scripts/package.ubuntu-20.04_armv8_jetson.sh --with-auditwheel
./scripts/package.ubuntu-20.04_armv8_jetson.sh
if: ${{ matrix.platform.name == 'ubuntu-20.04_armv8_jetson' }}
env:
SORA_SDK_TARGET: ubuntu-20.04_armv8_jetson
# macOS 向け
- run: |
rye run python run.py
rye run python -m build
if: ${{ matrix.platform.os == 'macos' }}
env:
_PYTHON_HOST_PLATFORM: ${{ matrix.platform.python_host_platform }}
ARCHFLAGS: ${{ matrix.platform.archflags }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.name }}_python-${{ matrix.python_version }}
path: "dist/"

build_windows:
runs-on: windows-2019
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python_version }}"
cache: "pip"
- run: pip install -r requirements-dev.lock
- run: python run.py
- run: python -m build

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: windows-2019_python-${{ matrix.python_version }}
path: dist/

publish_wheel:
if: contains(github.ref, 'tags/202')
needs:
- build_linux_macos
- build_windows
strategy:
fail-fast: false
matrix:
platform:
- name: ubuntu-22.04_x86_64
- name: ubuntu-20.04_armv8_jetson
- name: macos-13_arm64
- name: windows-2019
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
exclude:
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.9"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.platform.name }}_python-${{ matrix.python_version }}
path: dist
- run: |
if [ -e dist/*.tar.gz ]; then
mv dist/*.tar.gz ./
fi
# matrix の中で1個だけソースディストリビューション用のデータを残しておく
- run: mv *.tar.gz dist/
if: ${{ matrix.platform.name == 'macos-13_arm64' && matrix.python_version == '3.8' }}

# テスト用
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# verbose: true

# 本番用
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/_install
/_build
/_source
/_package
__pycache__/
.pytest_cache/
.venv/
*.egg-info/
/_skbuild
build

src/sora_sdk/*.so
src/sora_sdk/*.dll
src/sora_sdk/model_coeffs/*
!src/sora_sdk/model_coeffs/.gitkeep

# パッケージ
/dist
/wheelhouse
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8.16
34 changes: 34 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"configurations": [
{
"includePath": [
"${workspaceFolder}/_install/boost/include",
"${workspaceFolder}/_install/llvm/libcxx/include",
"${workspaceFolder}/_install/nanobind/include",
"${workspaceFolder}/_install/sora/include",
"${workspaceFolder}/_install/webrtc/include",
"${workspaceFolder}/_install/webrtc/include/third_party/abseil-cpp",
"${workspaceFolder}/_install/webrtc/include/third_party/boringssl/src/include",
"${workspaceFolder}/_install/webrtc/include/third_party/libyuv/include",
"${workspaceFolder}/_install/webrtc/include/third_party/zlib",
"/usr/include/python3.8"
],
"defines": [
"WEBRTC_POSIX",
"_LIBCPP_ABI_UNSTABLE",
"_LIBCPP_DISABLE_AVAILABILITY",
"OPENSSL_IS_BORINGSSL",
"SORA_CPP_SDK_UBUNTU_2004",
"USE_NVCODEC_ENCODER=1"
],
"compilerPath": "${workspaceFolder}/_install/llvm/clang/bin/clang++",
"compilerArgs": [
"-nostdinc++"
],
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
Loading

0 comments on commit f79f9c6

Please sign in to comment.