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

Add an HTTP server for hosting of ONNX models #806

Merged
merged 237 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
76d5618
Simple integration into CMake build system
tmccrmck Feb 27, 2019
a50331e
Adds vcpkg as a submodule and updates build.py to install hosting dep…
tmccrmck Mar 1, 2019
f8643b1
Don't create vcpkg executable if already created
tmccrmck Mar 2, 2019
2e12cff
Fixes how CMake finds toolchain file and quick changes to build.py
tmccrmck Mar 2, 2019
62a6a6d
Removes setting the CMAKE_TOOLCHAIN_FILE in build.py
tmccrmck Mar 2, 2019
5069518
Adds Boost Beast echo server and Boost program_options
tmccrmck Mar 4, 2019
d1121ea
Fixes spacing problem with program_options
tmccrmck Mar 4, 2019
2dd6486
Adds Microsoft headers to all the beast server headers
tmccrmck Mar 4, 2019
dc16071
Removes CXX 14 from CMake file
tmccrmck Mar 4, 2019
54072d2
Merge pull request #1 from tmccrmck/trmccorm/build_integration
tmccrmck Mar 4, 2019
15995cd
Merge branch 'master' of github.com:NonStatic2014/onnxruntime into tr…
tmccrmck Mar 4, 2019
b18de16
Adds TODO to create configuration class
tmccrmck Mar 4, 2019
7436ad9
Run clang-format on main
tmccrmck Mar 4, 2019
30d5767
Better exception handling of program_options
tmccrmck Mar 4, 2019
7d6bba4
Remove vckpg submodule via ssh
NonStatic2014 Mar 4, 2019
4e6cb0a
Add vcpkg as https
NonStatic2014 Mar 4, 2019
ee329b6
Merge pull request #3 from NonStatic2014/bohu/update_vcpkg
NonStatic2014 Mar 4, 2019
2acbca7
Adds onnxruntime namespace to call classes
tmccrmck Mar 4, 2019
e5c41b2
Fixed places where namespaces were anonymous
tmccrmck Mar 4, 2019
b4b66ba
Adds a TODO to use the logger
tmccrmck Mar 4, 2019
8d7e26d
Moves all setting namespace shortnames outside of onnxruntime namespace
tmccrmck Mar 4, 2019
36a8750
Add onnxruntime session options to force app to link with it
tmccrmck Mar 4, 2019
530d651
Merge pull request #2 from NonStatic2014/trmccorm/boost_dep
tmccrmck Mar 4, 2019
02e6ceb
Set CMAKE_TOOLCHAIN_FILE in build.py
Mar 5, 2019
2596f02
Remove whitespace
Mar 5, 2019
7f51a09
Merge pull request #4 from NonStatic2014/trmccorm/cmake_toolchain
NonStatic2014 Mar 5, 2019
0675be4
Adds initial ONNX Hosting tests (#5)
tmccrmck Mar 5, 2019
fd75a0c
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 6, 2019
966bde1
Merge changes from upstream
NonStatic2014 Mar 6, 2019
8539f17
Enable CI build in Vienna environment
NonStatic2014 Mar 7, 2019
0d0bb1b
make hosting_run*.sh executable
NonStatic2014 Mar 7, 2019
68dac7e
Add boost path in unittest
NonStatic2014 Mar 7, 2019
3eab223
Add boost to TEST_INC_DIR
NonStatic2014 Mar 7, 2019
08a57a2
Add component detection task in ci yaml
NonStatic2014 Mar 7, 2019
2c88022
Get tests and hosting to compile with re2 (#7)
tmccrmck Mar 7, 2019
b9c2901
Add finding boost packages before using it in unit tests
NonStatic2014 Mar 7, 2019
6409f06
Merge from master and solve the conflict
NonStatic2014 Mar 7, 2019
d09ac52
Merge pull request #6 from NonStatic2014/bohu/enable_ci
NonStatic2014 Mar 7, 2019
e09e156
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 7, 2019
11a46a5
Add predict.proto and build
NonStatic2014 Mar 8, 2019
c385e9b
Ignore unused parameters in generated code
NonStatic2014 Mar 8, 2019
8aedb7c
Removes std::regex in favor of re2 (#8)
tmccrmck Mar 8, 2019
03de564
Adding more protos
NonStatic2014 Mar 9, 2019
59e5bfc
Fix google protobuf file path in the cmake file
NonStatic2014 Mar 9, 2019
1a57205
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 11, 2019
742dc65
Ignore unused parameters for pb generated code
NonStatic2014 Mar 11, 2019
5bb0072
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Mar 11, 2019
8e2c7c8
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 11, 2019
7614165
Updates onnx submodule (#10)
tmccrmck Mar 11, 2019
ef420d5
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Mar 11, 2019
3c3fd7a
Remove duplicated lib in link
NonStatic2014 Mar 11, 2019
e18b5f7
Merge pull request #9 from NonStatic2014/bohu/protobuf
NonStatic2014 Mar 11, 2019
44768db
Follow Google style guide (#11)
tmccrmck Mar 12, 2019
3742779
Consume protobuf
NonStatic2014 Mar 12, 2019
ab9f576
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Mar 12, 2019
d21da55
Unit Test setup
NonStatic2014 Mar 12, 2019
b93e32e
Json deserialization simple test cases
NonStatic2014 Mar 12, 2019
341c856
Split hosting app to lib and exe for testability
NonStatic2014 Mar 13, 2019
72893da
Add more cases
NonStatic2014 Mar 13, 2019
db8f827
Clean up
NonStatic2014 Mar 13, 2019
ae3f7bc
Add more comments
NonStatic2014 Mar 13, 2019
48817ea
Update namespace and format the cmake files
NonStatic2014 Mar 13, 2019
fb9b97a
Merge pull request #12 from NonStatic2014/bohu/pb_handling
NonStatic2014 Mar 13, 2019
7aeae1d
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 13, 2019
77fd59f
Update cmake/external/onnx to checkout 1ec81bc6d49ccae23cd7801515feaa…
NonStatic2014 Mar 13, 2019
550569e
Separate h and cc in http folder
NonStatic2014 Mar 13, 2019
54a518c
Clean up hosting application cmake file
NonStatic2014 Mar 13, 2019
aee4a80
Merge pull request #13 from NonStatic2014/bohu/httpimpl2cc
NonStatic2014 Mar 13, 2019
2a2bd33
Enable logging and proper initialize the session
NonStatic2014 Mar 14, 2019
24fda76
Update const position for GetSession()
NonStatic2014 Mar 14, 2019
692fb24
Merge pull request #14 from NonStatic2014/bohu/onnxrt_init
NonStatic2014 Mar 14, 2019
d9f0f69
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 14, 2019
88ea9b9
Take latest onnx and onnx-tensorrt
NonStatic2014 Mar 14, 2019
b397cd8
Creates configuration header file for program_options (#15)
tmccrmck Mar 18, 2019
e0e95de
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 18, 2019
2db832c
Sets up PredictRequest callback (#16)
tmccrmck Mar 20, 2019
4b97054
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 20, 2019
d58b9a5
Init version, porting from prototype, e2e works
NonStatic2014 Mar 20, 2019
b3a5c67
More executor implementation
NonStatic2014 Mar 22, 2019
180bc5b
Adds function on application startup (#17)
tmccrmck Mar 25, 2019
8d47578
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 25, 2019
60c4562
Using full protobuf for hosting app build
NonStatic2014 Mar 25, 2019
f3dd62d
MLValue2TensorProto
NonStatic2014 Mar 25, 2019
56bc8e7
Merge branch 'bohu/executor' of https://github.com/NonStatic2014/onnx…
NonStatic2014 Mar 25, 2019
59eef48
Merge latest master
NonStatic2014 Mar 25, 2019
9e71bce
Revert back changes in inference_session.cc
NonStatic2014 Mar 25, 2019
1789194
Refactor logger access and predict handler
NonStatic2014 Mar 25, 2019
9aaba33
Create an error handling callback (#19)
tmccrmck Mar 27, 2019
2e6bfc9
Refactor executor and add some test cases
NonStatic2014 Mar 28, 2019
7157367
Fix build warning
NonStatic2014 Mar 28, 2019
874a252
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Mar 28, 2019
98887f6
Add onnx as a dependency and in includes to hosting app (#20)
tmccrmck Mar 29, 2019
a5fe244
Converter for specific types and more UTs
NonStatic2014 Mar 29, 2019
3746d8f
More unit tests
NonStatic2014 Mar 29, 2019
0357598
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Mar 29, 2019
1ba4af8
Update onnx submodule
NonStatic2014 Mar 29, 2019
417670c
Fix string data test
NonStatic2014 Mar 29, 2019
fd083e6
Clean up code
NonStatic2014 Mar 30, 2019
83596e6
Cleanup code
NonStatic2014 Mar 31, 2019
a5f97db
Refactor logging to use unique id per request and take logging level …
tmccrmck Apr 1, 2019
2df4498
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 1, 2019
6aed3be
Update GetHttpStatusCode signature
NonStatic2014 Apr 1, 2019
5390322
Merge pull request #18 from NonStatic2014/bohu/executor
NonStatic2014 Apr 2, 2019
19747b1
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 2, 2019
0588d40
Fix random result issue and camel-case names
NonStatic2014 Apr 2, 2019
d115119
Rollback accidentally changed pybin_state.cc
NonStatic2014 Apr 2, 2019
74c2f8e
Rollback pybind_state.cc
NonStatic2014 Apr 2, 2019
094aca2
Merge pull request #22 from NonStatic2014/bohu/fix_random_result
NonStatic2014 Apr 2, 2019
c8e76be
Generate protobuf status from onnxruntime status
NonStatic2014 Apr 2, 2019
f6d2af2
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 2, 2019
492bd60
Fix function name in error message
NonStatic2014 Apr 2, 2019
f44e907
Clean up comments
NonStatic2014 Apr 2, 2019
05847b0
Merge pull request #23 from NonStatic2014/bohu/generate_protobuf_status
NonStatic2014 Apr 3, 2019
9f2b824
Support protobuf byte array as input
NonStatic2014 Apr 4, 2019
8c7c3ff
Refactor predict handler and add unit tests
NonStatic2014 Apr 4, 2019
5b921e9
Add one more test
NonStatic2014 Apr 4, 2019
13d36e0
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 4, 2019
193389a
update cmake/external/onnx
NonStatic2014 Apr 4, 2019
1a15081
Accept more protobuf MIME types
NonStatic2014 Apr 4, 2019
6e5f6f8
Merge pull request #24 from NonStatic2014/bohu/binary_input
NonStatic2014 Apr 4, 2019
5205686
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime
NonStatic2014 Apr 4, 2019
bc2c4b0
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 4, 2019
3d3240d
Update onnx-tensorrt
NonStatic2014 Apr 4, 2019
a6ef31c
Add build instruction and usage doc
NonStatic2014 Apr 5, 2019
9b9b8d4
Address PR comments
NonStatic2014 Apr 5, 2019
c2ac9ef
Merge pull request #25 from NonStatic2014/bohu/prepare_pr
NonStatic2014 Apr 5, 2019
9a92ae4
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime
NonStatic2014 Apr 5, 2019
ec8b90d
Install g++-7 in the Ubuntu 16.04 build image for vcpkg
NonStatic2014 Apr 5, 2019
69e0546
Fix onnx-tensorrt version
NonStatic2014 Apr 5, 2019
8f1988f
Merge pull request #26 from NonStatic2014/bohu/update_build_env
NonStatic2014 Apr 5, 2019
f3da6e0
Check return value during initialization
NonStatic2014 Apr 5, 2019
579cc3c
Merge branch 'master' into bohu/check_result
NonStatic2014 Apr 6, 2019
d6811ec
Merge pull request #28 from NonStatic2014/bohu/check_result
NonStatic2014 Apr 6, 2019
789c725
Fix infinite loop when http port is in use (#29)
NonStatic2014 Apr 6, 2019
e22295b
Simplify Executor.cc by breaking up Run method (#27)
tmccrmck Apr 7, 2019
81b0c0a
Merge upstream master (#31)
tmccrmck Apr 9, 2019
ae5ec67
Remove all possible shared_ptrs (#30)
tmccrmck Apr 9, 2019
5fb1314
Enable full protobuf if building hosting (#32)
tmccrmck Apr 9, 2019
09d7244
Merge branch 'master' of github.com:Microsoft/onnxruntime into trmcco…
tmccrmck Apr 9, 2019
2d64d25
Merge pull request #35 from NonStatic2014/trmccorm/update_master2
tmccrmck Apr 10, 2019
b716e08
Move server core into separate folder (#34)
letmaik Apr 10, 2019
b95fdbd
Merge branch 'master' of github.com:Microsoft/onnxruntime into trmcco…
tmccrmck Apr 10, 2019
71e77c7
Merge branch 'master' of github.com:Microsoft/onnxruntime into trmcco…
tmccrmck Apr 10, 2019
3b6f88d
Merge pull request #37 from NonStatic2014/trmccorm/update_master3
tmccrmck Apr 10, 2019
47ab7e6
Turn hosting project off by default (#38)
tmccrmck Apr 11, 2019
7fee4d6
Remove vcpkg as a submodule and download/install Boost from source (#39)
tmccrmck Apr 15, 2019
c648652
Remove std::move for const references
tmccrmck Apr 15, 2019
5b6c156
Remove error_code.proto
tmccrmck Apr 15, 2019
c54667a
Change wording of executable help description
tmccrmck Apr 15, 2019
7fd83d9
Better GenerateProtobufStatus description
tmccrmck Apr 15, 2019
69024e4
Remove error_code protobuf from CMake files
tmccrmck Apr 15, 2019
7554190
Use all outputs if no filter is given
tmccrmck Apr 15, 2019
6aa444e
Pass MLValue by const reference in MLValueToTensorProto
tmccrmck Apr 15, 2019
2f758a7
Rename variables to argc and argv
tmccrmck Apr 15, 2019
4cc7fa7
Revert "Use all outputs if no filter is given"
tmccrmck Apr 15, 2019
3719010
Remove all header guards in favor of #pragma once
tmccrmck Apr 16, 2019
ba1f15d
Reserve size for output vector and optimize for-loop
tmccrmck Apr 16, 2019
53b108c
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 16, 2019
bf0112d
Use static libs by default for Boost
tmccrmck Apr 16, 2019
92d67f9
Improves documentation for GenerateResponseInJson function
tmccrmck Apr 16, 2019
297c153
Start Result enum at 0 instead of 1
tmccrmck Apr 16, 2019
7a8ae3d
Remove g++ from Ubuntu's install.sh
tmccrmck Apr 16, 2019
663f13c
Update cmake files
NonStatic2014 Apr 16, 2019
a63bd0d
Give explanation for Result enum type
tmccrmck Apr 16, 2019
8227b5f
Remove all program options shortcuts except for -h
tmccrmck Apr 16, 2019
4121e3f
Add comments for predict.proto
NonStatic2014 Apr 16, 2019
814d676
Fix JSON for error codes
tmccrmck Apr 16, 2019
3789ff4
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 16, 2019
59887b1
Merge pull request #41 from NonStatic2014/bohu/cmake_and_proto
NonStatic2014 Apr 17, 2019
01c3707
Add notice on hosting application docs that it's in beta
tmccrmck Apr 17, 2019
761be0e
Change HostingEnvironment back to a shared_ptr
tmccrmck Apr 17, 2019
4397e8a
Merge branch 'master' of github.com:NonStatic2014/onnxruntime into tr…
tmccrmck Apr 17, 2019
6ef6e2c
Merge pull request #40 from NonStatic2014/trmccorm/feedback
tmccrmck Apr 17, 2019
bf63273
Handle empty output_filter field
NonStatic2014 Apr 17, 2019
be17a0c
Fix build break
NonStatic2014 Apr 18, 2019
0c67e6d
Merge pull request #42 from NonStatic2014/bohu/empty_output_filters
NonStatic2014 Apr 18, 2019
c9f8abd
Refactor unit tests location and groups
NonStatic2014 Apr 18, 2019
6f3b719
Merge pull request #43 from NonStatic2014/bohu/move_unit_tests
NonStatic2014 Apr 18, 2019
a89c740
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 18, 2019
a9d9538
First end-to-end test
NonStatic2014 Apr 19, 2019
f77798e
Add missing log
NonStatic2014 Apr 19, 2019
2d96ffa
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 19, 2019
1fc624d
Missing req id and client req id in error response
NonStatic2014 Apr 19, 2019
f83b3ab
Add one test case to validate failed resp header
NonStatic2014 Apr 20, 2019
c24400e
Add build flag for hosting app end to end tests
NonStatic2014 Apr 20, 2019
16d7313
Update pipeline setup to run e2e test for CI build
NonStatic2014 Apr 20, 2019
a8104dd
Merge pull request #45 from NonStatic2014/bohu/e2e_tests
NonStatic2014 Apr 20, 2019
16cbbfa
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 20, 2019
6961982
Model Zoo data preparation and tests
NonStatic2014 Apr 21, 2019
3150086
Add protobuf tests
NonStatic2014 Apr 21, 2019
0ed377c
Remove mention of needing g++-7 in BUILD.md
tmccrmck Apr 22, 2019
1df651d
Make GetAppLogger const
tmccrmck Apr 22, 2019
33118fb
Make using_raw_data_ match the styling of other fields
tmccrmck Apr 22, 2019
abd7714
Avoid copy of strings when initializing model
tmccrmck Apr 22, 2019
71227be
Escape JSON strings correctly for error messages (#44)
tmccrmck Apr 22, 2019
2840e68
Merge branch 'master' of github.com:NonStatic2014/onnxruntime into tr…
tmccrmck Apr 22, 2019
20d1440
Add result validation
NonStatic2014 Apr 22, 2019
2c80553
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 22, 2019
b986f66
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 22, 2019
5585246
Remove temporary path
NonStatic2014 Apr 22, 2019
ed89d0f
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
tmccrmck Apr 22, 2019
4e97523
Optimize model zoo test execution
NonStatic2014 Apr 22, 2019
0157f42
Improve reliability of test cases
NonStatic2014 Apr 22, 2019
0c439c4
Merge pull request #46 from NonStatic2014/trmccorm/feedback2
NonStatic2014 Apr 22, 2019
c1a7e3c
Generate _pb2.py during the build time
NonStatic2014 Apr 23, 2019
46f94c3
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 23, 2019
802bc58
README for integration tests
NonStatic2014 Apr 23, 2019
48eecc2
Merge pull request #47 from NonStatic2014/bohu/model_zoo_tests
NonStatic2014 Apr 24, 2019
b8310e5
Pass environment by pointer instead of shared_ptr to executor (#49)
tmccrmck Apr 24, 2019
435ba5c
More Integration tests
NonStatic2014 Apr 24, 2019
c8792e3
Remove generated files
NonStatic2014 Apr 24, 2019
a9c13eb
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 24, 2019
2b941b9
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 24, 2019
f56a0e0
Make session private and use a getter instead (#53)
tmccrmck Apr 24, 2019
769b2c1
Merge branch 'master' into bohu/more_integration_tests
tmccrmck Apr 24, 2019
3f07006
Merge pull request #54 from NonStatic2014/bohu/more_integration_tests
NonStatic2014 Apr 25, 2019
588ac8f
logging_level to log_level for CLI
NonStatic2014 Apr 25, 2019
57057b4
Single model prediction shortcut
NonStatic2014 Apr 25, 2019
09a33e9
Health endpoint
NonStatic2014 Apr 25, 2019
e39ccad
Integration tests
NonStatic2014 Apr 25, 2019
6abc722
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 25, 2019
e8da7c8
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 25, 2019
17c6220
Merge pull request #55 from NonStatic2014/bohu/shortcut
NonStatic2014 Apr 26, 2019
00078cd
Rename to onnxruntime server
NonStatic2014 Apr 26, 2019
1cd43ab
Merge pull request #56 from NonStatic2014/bohu/rename
NonStatic2014 Apr 26, 2019
e7cfdc0
Build ONNX Server application on Windows (#57)
tmccrmck Apr 27, 2019
9db26f8
Missing test data from the rename change
NonStatic2014 Apr 29, 2019
b9c378f
Fix server app path (#58)
tmccrmck Apr 29, 2019
2757afb
Pass shared_ptr by const reference to avoid ref count increase (#59)
tmccrmck Apr 29, 2019
1c8eaff
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 29, 2019
e2307fa
Merge branch 'master' of https://github.com/Microsoft/onnxruntime
NonStatic2014 Apr 29, 2019
72043c8
Merge branch 'master' of https://github.com/NonStatic2014/onnxruntime…
NonStatic2014 Apr 29, 2019
6979e82
Download test model during test setup
NonStatic2014 Apr 29, 2019
e2694dc
Make download into test_util
NonStatic2014 Apr 29, 2019
a29d331
Merge pull request #60 from NonStatic2014/bohu/missing_test_data
NonStatic2014 Apr 29, 2019
c9c0bf0
Rename ci pipeline for onnx runtime server
NonStatic2014 Apr 29, 2019
8cf8705
Support up to 10MiB http request (#61)
NonStatic2014 Apr 30, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ distribute/*
*.bin
cmake_build
.cmake_build
cmake-build-debug
gen
*~
.vs
Expand Down
4 changes: 4 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ The complete list of build options can be found by running `./build.sh (or ./bui
1. For Windows, just add --x86 argument when launching build.bat
2. For Linux, it must be built out of a x86 os, --x86 argument also needs be specified to build.sh

## Build ONNX Runtime Server on Linux

1. In the ONNX Runtime root folder, run `./build.sh --config RelWithDebInfo --build_server --use_openmp --parallel`

## Build/Test Flavors for CI

### CI Build Environments
Expand Down
6 changes: 6 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ option(onnxruntime_USE_BRAINSLICE "Build with BrainSlice" OFF)
option(onnxruntime_USE_TENSORRT "Build with TensorRT support" OFF)
option(onnxruntime_ENABLE_LTO "Enable link time optimization, which is not stable on older GCCs" OFF)
option(onnxruntime_CROSS_COMPILING "Cross compiling onnx runtime" OFF)
option(onnxruntime_BUILD_SERVER "Build ONNX Runtime Server" OFF)
option(onnxruntime_USE_FULL_PROTOBUF "Use full protobuf" OFF)
option(onnxruntime_DISABLE_CONTRIB_OPS "Disable contrib ops" OFF)
option(onnxruntime_USE_EIGEN_THREADPOOL "Use eigen threadpool. Otherwise OpenMP or a homemade one will be used" OFF)
Expand Down Expand Up @@ -607,6 +608,10 @@ if (onnxruntime_BUILD_SHARED_LIB)
include(onnxruntime.cmake)
endif()

if (onnxruntime_BUILD_SERVER)
include(onnxruntime_server.cmake)
endif()

# some of the tests rely on the shared libs to be
# built; hence the ordering
if (onnxruntime_BUILD_UNIT_TESTS)
Expand All @@ -633,3 +638,4 @@ if (onnxruntime_BUILD_CSHARP)
# set_property(GLOBAL PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "netstandard2.0")
include(onnxruntime_csharp.cmake)
endif()

100 changes: 100 additions & 0 deletions cmake/get_boost.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(BOOST_REQUESTED_VERSION 1.69.0 CACHE STRING "")
set(BOOST_SHA1 8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 CACHE STRING "")
snnn marked this conversation as resolved.
Show resolved Hide resolved
set(BOOST_USE_STATIC_LIBS true CACHE BOOL "")

set(BOOST_COMPONENTS program_options system thread)

# These components are only needed for Windows
if(WIN32)
list(APPEND BOOST_COMPONENTS date_time regex)
endif()

# MSVC doesn't set these variables
if(WIN32)
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
set(CMAKE_SHARED_LIBRARY_PREFIX lib)
endif()

# Set lib prefixes and suffixes for linking
if(BOOST_USE_STATIC_LIBS)
set(LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
set(LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()

# Create list of components in Boost format
foreach(component ${BOOST_COMPONENTS})
list(APPEND BOOST_COMPONENTS_FOR_BUILD --with-${component})
endforeach()

set(BOOST_ROOT_DIR ${CMAKE_BINARY_DIR}/boost CACHE PATH "")

# TODO: let user give their own Boost installation
macro(DOWNLOAD_BOOST)
if(NOT BOOST_REQUESTED_VERSION)
message(FATAL_ERROR "BOOST_REQUESTED_VERSION is not defined.")
endif()

string(REPLACE "." "_" BOOST_REQUESTED_VERSION_UNDERSCORE ${BOOST_REQUESTED_VERSION})

set(BOOST_MAYBE_STATIC)
if(BOOST_USE_STATIC_LIBS)
set(BOOST_MAYBE_STATIC "link=static")
endif()

set(VARIANT "release")
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(VARIANT "debug")
endif()

set(WINDOWS_B2_OPTIONS)
set(WINDOWS_LIB_NAME_SCHEME)
if(WIN32)
set(BOOTSTRAP_FILE_TYPE "bat")
set(WINDOWS_B2_OPTIONS "toolset=msvc-14.1" "architecture=x86" "address-model=64")
set(WINDOWS_LIB_NAME_SCHEME "-vc141-mt-gd-x64-1_69")
else()
set(BOOTSTRAP_FILE_TYPE "sh")
endif()

message(STATUS "Adding Boost components")
include(ExternalProject)
ExternalProject_Add(
Boost
URL http://dl.bintray.com/boostorg/release/${BOOST_REQUESTED_VERSION}/source/boost_${BOOST_REQUESTED_VERSION_UNDERSCORE}.tar.bz2
URL_HASH SHA256=${BOOST_SHA1}
DOWNLOAD_DIR ${BOOST_ROOT_DIR}
SOURCE_DIR ${BOOST_ROOT_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ./bootstrap.${BOOTSTRAP_FILE_TYPE} --prefix=${BOOST_ROOT_DIR}
BUILD_COMMAND ./b2 install ${BOOST_MAYBE_STATIC} --prefix=${BOOST_ROOT_DIR} variant=${VARIANT} ${WINDOWS_B2_OPTIONS} ${BOOST_COMPONENTS_FOR_BUILD}
BUILD_IN_SOURCE true
INSTALL_COMMAND ""
INSTALL_DIR ${BOOST_ROOT_DIR}
)

# Set include folders
ExternalProject_Get_Property(Boost INSTALL_DIR)
set(Boost_INCLUDE_DIR ${INSTALL_DIR}/include)
if(WIN32)
set(Boost_INCLUDE_DIR ${INSTALL_DIR}/include/boost-1_69)
endif()

# Set libraries to link
macro(libraries_to_fullpath varname)
set(${varname})
foreach(component ${BOOST_COMPONENTS})
list(APPEND ${varname} ${INSTALL_DIR}/lib/${LIBRARY_PREFIX}boost_${component}${WINDOWS_LIB_NAME_SCHEME}${LIBRARY_SUFFIX})
endforeach()
endmacro()

libraries_to_fullpath(Boost_LIBRARIES)
mark_as_advanced(Boost_LIBRARIES Boost_INCLUDE_DIR)
endmacro()

DOWNLOAD_BOOST()
122 changes: 122 additions & 0 deletions cmake/onnxruntime_server.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(SERVER_APP_NAME "onnxruntime_server")

# Generate .h and .cc files from protobuf file
add_library(server_proto ${ONNXRUNTIME_ROOT}/server/protobuf/predict.proto)
if(WIN32)
target_compile_options(server_proto PRIVATE "/wd4125" "/wd4456")
endif()
target_include_directories(server_proto PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES> "${CMAKE_CURRENT_BINARY_DIR}/.." ${CMAKE_CURRENT_BINARY_DIR}/onnx)
target_compile_definitions(server_proto PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_DEFINITIONS>)
onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${REPO_ROOT}/cmake/external/protobuf/src ${ONNXRUNTIME_ROOT}/server/protobuf ${ONNXRUNTIME_ROOT}/core/protobuf TARGET server_proto)
add_dependencies(server_proto onnx_proto ${onnxruntime_EXTERNAL_DEPENDENCIES})
if(NOT WIN32)
if(HAS_UNUSED_PARAMETER)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/model_metadata.pb.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/model_status.pb.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/predict.pb.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
endif()
endif()

# Setup dependencies
include(get_boost.cmake)
set(re2_src ${REPO_ROOT}/cmake/external/re2)

# Setup source code
set(onnxruntime_server_lib_srcs
"${ONNXRUNTIME_ROOT}/server/http/json_handling.cc"
"${ONNXRUNTIME_ROOT}/server/http/predict_request_handler.cc"
"${ONNXRUNTIME_ROOT}/server/http/util.cc"
"${ONNXRUNTIME_ROOT}/server/environment.cc"
"${ONNXRUNTIME_ROOT}/server/executor.cc"
"${ONNXRUNTIME_ROOT}/server/converter.cc"
"${ONNXRUNTIME_ROOT}/server/util.cc"
)
if(NOT WIN32)
if(HAS_UNUSED_PARAMETER)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/http/json_handling.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/http/predict_request_handler.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/executor.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/converter.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/util.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
endif()
endif()

file(GLOB_RECURSE onnxruntime_server_http_core_lib_srcs
"${ONNXRUNTIME_ROOT}/server/http/core/*.cc"
)

file(GLOB_RECURSE onnxruntime_server_srcs
"${ONNXRUNTIME_ROOT}/server/main.cc"
)

# HTTP core library
add_library(onnxruntime_server_http_core_lib STATIC
${onnxruntime_server_http_core_lib_srcs})
target_include_directories(onnxruntime_server_http_core_lib
PUBLIC
${ONNXRUNTIME_ROOT}/server/http/core
${Boost_INCLUDE_DIR}
${re2_src}
)
add_dependencies(onnxruntime_server_http_core_lib Boost)
target_link_libraries(onnxruntime_server_http_core_lib PRIVATE
${Boost_LIBRARIES}
)

# Server library
add_library(onnxruntime_server_lib ${onnxruntime_server_lib_srcs})
onnxruntime_add_include_to_target(onnxruntime_server_lib gsl onnx_proto server_proto)
target_include_directories(onnxruntime_server_lib PRIVATE
${ONNXRUNTIME_ROOT}
${CMAKE_CURRENT_BINARY_DIR}/onnx
${ONNXRUNTIME_ROOT}/server
${ONNXRUNTIME_ROOT}/server/http
PUBLIC
${Boost_INCLUDE_DIR}
${re2_src}
)

target_link_libraries(onnxruntime_server_lib PRIVATE
server_proto
${Boost_LIBRARIES}
onnxruntime_server_http_core_lib
onnxruntime_session
onnxruntime_optimizer
onnxruntime_providers
onnxruntime_util
onnxruntime_framework
onnxruntime_util
onnxruntime_graph
onnxruntime_common
onnxruntime_mlas
${onnxruntime_EXTERNAL_LIBRARIES}
)

# For IDE only
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_server_srcs} ${onnxruntime_server_lib_srcs} ${onnxruntime_server_lib})

# Server Application
add_executable(${SERVER_APP_NAME} ${onnxruntime_server_srcs})
add_dependencies(${SERVER_APP_NAME} onnx server_proto onnx_proto ${onnxruntime_EXTERNAL_DEPENDENCIES})

if(NOT WIN32)
if(HAS_UNUSED_PARAMETER)
set_source_files_properties("${ONNXRUNTIME_ROOT}/server/main.cc" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
endif()
endif()

onnxruntime_add_include_to_target(${SERVER_APP_NAME} onnxruntime_session onnxruntime_server_lib gsl onnx onnx_proto server_proto)

target_include_directories(${SERVER_APP_NAME} PRIVATE
${ONNXRUNTIME_ROOT}
${ONNXRUNTIME_ROOT}/server/http
)

target_link_libraries(${SERVER_APP_NAME} PRIVATE
onnxruntime_server_http_core_lib
onnxruntime_server_lib
)

58 changes: 56 additions & 2 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ set(onnxruntime_test_framework_libs
onnxruntime_mlas
)

set(onnxruntime_test_server_libs
onnxruntime_test_utils
onnxruntime_test_utils_for_server
)

if(WIN32)
list(APPEND onnxruntime_test_framework_libs Advapi32)
endif()



set (onnxruntime_test_providers_dependencies ${onnxruntime_EXTERNAL_DEPENDENCIES})

if(onnxruntime_USE_CUDA)
Expand Down Expand Up @@ -550,6 +552,58 @@ if (onnxruntime_BUILD_SHARED_LIB)
endif()
endif()

if (onnxruntime_BUILD_SERVER)
file(GLOB onnxruntime_test_server_src
"${TEST_SRC_DIR}/server/unit_tests/*.cc"
"${TEST_SRC_DIR}/server/unit_tests/*.h"
)

file(GLOB onnxruntime_integration_test_server_src
"${TEST_SRC_DIR}/server/integration_tests/*.py"
)
if(NOT WIN32)
if(HAS_UNUSED_PARAMETER)
set_source_files_properties("${TEST_SRC_DIR}/server/unit_tests/json_handling_tests.cc" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties("${TEST_SRC_DIR}/server/unit_tests/converter_tests.cc" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties("${TEST_SRC_DIR}/server/unit_tests/util_tests.cc" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
endif()
endif()

add_library(onnxruntime_test_utils_for_server ${onnxruntime_test_server_src})
onnxruntime_add_include_to_target(onnxruntime_test_utils_for_server onnxruntime_test_utils gtest gmock gsl onnx onnx_proto server_proto)
add_dependencies(onnxruntime_test_utils_for_server onnxruntime_server_lib onnxruntime_server_http_core_lib Boost ${onnxruntime_EXTERNAL_DEPENDENCIES})
target_include_directories(onnxruntime_test_utils_for_server PUBLIC ${Boost_INCLUDE_DIR} ${REPO_ROOT}/cmake/external/re2 ${CMAKE_CURRENT_BINARY_DIR}/onnx ${ONNXRUNTIME_ROOT}/server/http ${ONNXRUNTIME_ROOT}/server/http/core PRIVATE ${ONNXRUNTIME_ROOT} )
target_link_libraries(onnxruntime_test_utils_for_server ${Boost_LIBRARIES} ${onnx_test_libs})

AddTest(
TARGET onnxruntime_server_tests
SOURCES ${onnxruntime_test_server_src}
LIBS ${onnxruntime_test_server_libs} server_proto onnxruntime_server_lib ${onnxruntime_test_providers_libs}
DEPENDS ${onnxruntime_EXTERNAL_DEPENDENCIES}
)

onnxruntime_protobuf_generate(
APPEND_PATH IMPORT_DIRS ${REPO_ROOT}/cmake/external/protobuf/src ${ONNXRUNTIME_ROOT}/server/protobuf ${ONNXRUNTIME_ROOT}/core/protobuf
PROTOS ${ONNXRUNTIME_ROOT}/server/protobuf/predict.proto ${ONNXRUNTIME_ROOT}/server/protobuf/onnx-ml.proto
LANGUAGE python
TARGET onnxruntime_server_tests
OUT_VAR server_test_py)

add_custom_command(
TARGET onnxruntime_server_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/server_test
COMMAND ${CMAKE_COMMAND} -E copy
${onnxruntime_integration_test_server_src}
${CMAKE_CURRENT_BINARY_DIR}/server_test/
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/onnx_ml_pb2.py
${CMAKE_CURRENT_BINARY_DIR}/server_test/
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/predict_pb2.py
${CMAKE_CURRENT_BINARY_DIR}/server_test/
)

endif()

add_executable(onnxruntime_mlas_test ${TEST_SRC_DIR}/mlas/unittest.cpp)
target_include_directories(onnxruntime_mlas_test PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc)
Expand Down
Loading