-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
239 additions
and
125 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,38 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
|
||
jobs: | ||
test-production: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install development dependencies | ||
run: | | ||
pip install pre-commit==2.20.0 | ||
- name: Apply pre-commit | ||
run: | | ||
pre-commit run --all-files | ||
- name: Setup environment | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends software-properties-common build-essential | ||
bash ./scripts/install_latest_cmake.bash | ||
bash ./scripts/install_onnx_runtime.bash | ||
bash ./scripts/install_apps_dependencies.bash | ||
- name: Test building | ||
run: | | ||
make apps -j`nproc` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /build | ||
COPY ./scripts . | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
sudo \ | ||
gnupg2 \ | ||
lsb-release \ | ||
build-essential \ | ||
software-properties-common \ | ||
cmake \ | ||
git \ | ||
tmux && \ | ||
bash install_latest_cmake.bash && \ | ||
bash install_onnx_runtime.bash && \ | ||
bash install_apps_dependencies.bash && \ | ||
rm -rf /build && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /workspace | ||
|
||
ENTRYPOINT ["/bin/bash"] |
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,26 @@ | ||
FROM nvidia/cuda:11.4.0-cudnn8-devel-ubuntu20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /build | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
sudo \ | ||
gnupg2 \ | ||
lsb-release \ | ||
build-essential \ | ||
software-properties-common \ | ||
cmake \ | ||
git \ | ||
tmux && \ | ||
bash install_latest_cmake.bash && \ | ||
bash install_onnx_runtime.bash && \ | ||
bash install_apps_dependencies.bash && \ | ||
rm -rf /build && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /workspace | ||
|
||
ENTRYPOINT ["/bin/bash"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
function command_exists | ||
{ | ||
type "$1" &> /dev/null; | ||
} | ||
|
||
if ! command_exists nvcc; then | ||
echo "Cuda package not found" | ||
else | ||
if [ ! "$(dpkg -S cudnn)" ];then | ||
echo "cudnn not found" | ||
else | ||
export CUDA_HOME=`whereis cuda | awk '{print $2}'` | ||
export CUDA_VERSION=`nvcc --version | grep release | awk '{print $6}' | cut -c 2-4` | ||
export CUDNN_HOME=$(dirname `whereis cudnn.h | awk '{print $2}'`) | ||
fi | ||
fi |
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo -l | ||
|
||
sudo apt-get install -y --no-install-recommends libopencv-dev |
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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly CMAKE_VERSION_TO_INSTALL="3.18.0" | ||
|
||
function command_exists | ||
{ | ||
type "$1" &> /dev/null; | ||
} | ||
|
||
function version_greater_equal | ||
{ | ||
printf '%s\n%s\n' "$2" "$1" | sort -V -C | ||
} | ||
|
||
if command_exists cmake; then | ||
readonly CMAKE_VERSION=`cmake --version | head -n1 | cut -d" " -f3` | ||
if version_greater_equal "${CMAKE_VERSION}" "${CMAKE_VERSION_TO_INSTALL}"; then | ||
exit 0 | ||
fi | ||
fi | ||
|
||
echo "Need cmake ${CMAKE_VERSION_TO_INSTALL} or above. Install now..." | ||
|
||
sudo -l | ||
|
||
sudo apt-get update | ||
sudo apt-get -y purge cmake | ||
sudo apt-get -y --no-install-recommends install python3-pip | ||
python3 -m pip install cmake==$CMAKE_VERSION_TO_INSTALL | ||
exec bash |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# reference: https://github.com/microsoft/onnxruntime#installation | ||
|
||
readonly CURRENT_DIR=$(dirname $(realpath $0)) | ||
|
||
sudo -l | ||
|
||
sudo apt-get update | ||
sudo apt install -y --no-install-recommends zlib1g-dev | ||
|
||
readonly ONNXRUNTIME_VERSION="v1.10.0" | ||
git clone --recursive -b ${ONNXRUNTIME_VERSION} https://github.com/Microsoft/onnxruntime | ||
cd onnxruntime | ||
|
||
INSTALL_PREFIX="/usr/local" | ||
BUILDTYPE=Release | ||
BUILDARGS="--config ${BUILDTYPE}" | ||
BUILDARGS="${BUILDARGS} --build_shared_lib --skip_tests" | ||
BUILDARGS="${BUILDARGS} --parallel" | ||
BUILDARGS="${BUILDARGS} --cmake_extra_defines CMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}" | ||
|
||
source $CURRENT_DIR/get_cuda_environment_variables.bash | ||
if [ ! -z "$CUDA_HOME" -a ! -z "$CUDA_VERSION" -a ! -z "$CUDNN_HOME" ]; then | ||
BUILDARGS="${BUILDARGS} --use_cuda --cuda_version=${CUDA_VERSION} --cuda_home=${CUDA_HOME} --cudnn_home=${CUDNN_HOME}" | ||
fi | ||
./build.sh ${BUILDARGS} | ||
cd ./build/Linux/${BUILDTYPE} | ||
sudo make install |
Oops, something went wrong.