Skip to content

Commit 2d02b07

Browse files
committed
Merge remote-tracking branch 'origin/master' into vs/triton_client
2 parents 8417e81 + 32e8a5a commit 2d02b07

File tree

257 files changed

+9387
-12157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+9387
-12157
lines changed

.clang-format

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
UseTab: Never
4+
ColumnLimit: 120
5+
6+
Language: Cpp
7+
Standard: Cpp11
8+
9+
AccessModifierOffset: -4
10+
AlignConsecutiveMacros: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllConstructorInitializersOnNextLine: false
13+
AllowAllParametersOfDeclarationOnNextLine: false
14+
AllowShortFunctionsOnASingleLine: Empty
15+
AllowShortIfStatementsOnASingleLine: Never
16+
AllowShortLambdasOnASingleLine: Empty
17+
AllowShortLoopsOnASingleLine: false
18+
AlwaysBreakBeforeMultilineStrings: false
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
CommentPragmas: "^#"
22+
DerivePointerAlignment: false
23+
FixNamespaceComments: true
24+
IndentCaseLabels: false
25+
IndentPPDirectives: AfterHash
26+
ForEachMacros:
27+
- foreach
28+
- FOREACH_CHILD

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Once you're done, someone will review your PR shortly (see the section "Who can
1414

1515
Fixes # (issue)
1616

17-
1817
## Before submitting
18+
1919
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
2020
- [ ] Did you make sure to update the documentation with your changes?
2121
- [ ] Did you write any new necessary tests?

.github/labeler.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See help here: https://github.com/marketplace/actions/labeler
2+
3+
cpp:
4+
- changed-files:
5+
- any-glob-to-any-file:
6+
- model_api/cpp/**
7+
8+
python:
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- model_api/python/**
12+
13+
tests:
14+
- changed-files:
15+
- any-glob-to-any-file:
16+
- tests/**
17+
18+
docs:
19+
- changed-files:
20+
- any-glob-to-any-file:
21+
- docs/**
22+
- "**/*.md"
23+
- "LICENSE"
24+
25+
build:
26+
- changed-files:
27+
- any-glob-to-any-file:
28+
- ".github/**/*"
29+
- ".pre-commit-config.yaml"
30+
- "pyproject.toml"
31+
- "**/CMakeLists.txt"

.github/workflows/docs.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build Docs
2+
permissions: read-all
3+
4+
on:
5+
workflow_dispatch: # run on request (no need for PR)
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
Build-Docs:
12+
runs-on: ubuntu-20.04
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install dependencies
23+
run: pip install 'model_api/python/.[docs]'
24+
- name: Install and Generate Doxygen
25+
uses: mattnotmitt/[email protected]
26+
- name: Build Docs
27+
run: |
28+
cd docs
29+
make html
30+
- name: Create gh-pages branch
31+
run: |
32+
if [[ ${{github.event_name}} == 'workflow_dispatch' ]]; then
33+
echo RELEASE_VERSION="test_build" >> $GITHUB_ENV
34+
else
35+
echo RELEASE_VERSION=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
36+
fi
37+
echo SOURCE_NAME=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
38+
echo SOURCE_BRANCH=${GITHUB_REF#refs/heads/} >> $GITHUB_OUTPUT
39+
echo SOURCE_TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
40+
41+
existed_in_remote=$(git ls-remote --heads origin gh-pages)
42+
43+
if [[ -z ${existed_in_remote} ]]; then
44+
echo "Creating gh-pages branch"
45+
git config --local user.email "[email protected]"
46+
git config --local user.name "GitHub Action"
47+
git checkout --orphan gh-pages
48+
git reset --hard
49+
touch .nojekyll
50+
git add .nojekyll
51+
git commit -m "Initializing gh-pages branch"
52+
git push origin gh-pages
53+
git checkout ${{steps.branch_name.outputs.SOURCE_NAME}}
54+
echo "Created gh-pages branch"
55+
else
56+
echo "Branch gh-pages already exists"
57+
fi
58+
- name: Commit docs to gh-pages branch
59+
run: |
60+
git fetch
61+
git checkout gh-pages
62+
mkdir -p /tmp/docs_build
63+
cp -r docs/build/html/* /tmp/docs_build/
64+
rm -rf ${{ env.RELEASE_VERSION }}/*
65+
echo '<html><head><meta http-equiv="refresh" content="0; url=stable/" /></head></html>' > index.html
66+
mkdir -p ${{ env.RELEASE_VERSION }}
67+
cp -r /tmp/docs_build/* ./${{ env.RELEASE_VERSION }}
68+
rm -rf /tmp/docs_build
69+
git config --local user.email "[email protected]"
70+
git config --local user.name "GitHub Action"
71+
if [[ ${{ env.RELEASE_VERSION }} != 'test_build' ]]; then
72+
ln -sfn ${{ env.RELEASE_VERSION }} latest
73+
fi
74+
git add ./latest ${{ env.RELEASE_VERSION }}
75+
git commit -m "Update documentation" -a || true
76+
- name: Push changes
77+
uses: ad-m/github-push-action@master
78+
with:
79+
github_token: ${{ secrets.GITHUB_TOKEN }}
80+
branch: gh-pages

.github/workflows/pr-labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Pull Request Labeler"
2+
permissions: read-all
3+
on:
4+
- pull_request_target
5+
6+
jobs:
7+
labeler:
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/labeler@v5
14+
with:
15+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/pre_commit.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Pre-Commit Checks
2+
permissions: read-all
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- ready_for_review
14+
workflow_dispatch: # run on request (no need for PR)
15+
16+
jobs:
17+
Code-Quality-Checks:
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- name: CHECKOUT REPOSITORY
21+
uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.10"
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
- name: Install clang-format
31+
run: sudo apt-get install -y clang-format-10
32+
- name: Install dependencies
33+
run: pip install 'model_api/python/.[full]'
34+
- name: Run pre-commit checks
35+
run: pre-commit run --all-files
36+
Unit-Tests:
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- name: CHECKOUT REPOSITORY
40+
uses: actions/checkout@v4
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.9"
45+
- name: Install dependencies
46+
run: pip install 'model_api/python/.[tests,ovms]'
47+
- name: Run python unit tests
48+
run: pytest tests/python/unit
Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
11
name: test_accuracy
22
permissions: read-all
3-
on: pull_request
3+
on:
4+
pull_request:
5+
merge_group:
6+
branches:
7+
- master
48
concurrency:
59
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
610
cancel-in-progress: true
711
jobs:
812
test_accuracy:
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-python@v4
13-
with:
14-
python-version: 3.9
15-
cache: pip
16-
- name: Create and start a virtual environment
17-
run: |
18-
python -m venv venv
19-
source venv/bin/activate
20-
- name: Install dependencies
21-
run: |
22-
source venv/bin/activate
23-
python -m pip install --upgrade pip
24-
pip install model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu
25-
- name: Prepare test data
26-
run: |
27-
source venv/bin/activate
28-
python tests/python/accuracy/prepare_data.py -d data
29-
- name: Run Python Test
30-
run: |
31-
source venv/bin/activate
32-
pytest --data=./data tests/python/accuracy/test_accuracy.py
33-
DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py
34-
- name: Install CPP ependencies
35-
run: |
36-
sudo bash model_api/cpp/install_dependencies.sh
37-
- name: Build CPP Test
38-
run: |
39-
mkdir build && cd build
40-
cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror
41-
make -j
42-
- name: Run CPP Test
43-
run: |
44-
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
45-
DATA=data build/test_YOLOv8
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.9
19+
cache: pip
20+
- name: Create and start a virtual environment
21+
run: |
22+
python -m venv venv
23+
source venv/bin/activate
24+
- name: Install dependencies
25+
run: |
26+
source venv/bin/activate
27+
python -m pip install --upgrade pip
28+
pip install model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu
29+
- name: Prepare test data
30+
run: |
31+
source venv/bin/activate
32+
python tests/python/accuracy/prepare_data.py -d data
33+
- name: Run Python Test
34+
run: |
35+
source venv/bin/activate
36+
pytest --data=./data tests/python/accuracy/test_accuracy.py
37+
DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py
38+
- name: Install CPP ependencies
39+
run: |
40+
sudo bash model_api/cpp/install_dependencies.sh
41+
- name: Build CPP Test
42+
run: |
43+
mkdir build && cd build
44+
cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror
45+
make -j
46+
- name: Run CPP Test
47+
run: |
48+
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
49+
DATA=data build/test_YOLOv8

0 commit comments

Comments
 (0)