-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from chenyufeifei/feat/workflows
Feat/workflows
- Loading branch information
Showing
14 changed files
with
439 additions
and
276 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,58 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
jobs: | ||
build: | ||
name: Build libtritonrepoagent_dragonfly.so | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
tar \ | ||
pkg-config \ | ||
python3 | ||
- name: Install vcpkg | ||
run: | | ||
git clone https://github.com/Microsoft/vcpkg.git $HOME/vcpkg | ||
$HOME/vcpkg/bootstrap-vcpkg.sh | ||
- name: Install project dependencies with vcpkg | ||
run: | | ||
$HOME/vcpkg/vcpkg install re2 | ||
$HOME/vcpkg/vcpkg install aws-sdk-cpp | ||
$HOME/vcpkg/vcpkg install google-cloud-cpp[storage] | ||
$HOME/vcpkg/vcpkg install azure-storage-blobs-cpp | ||
$HOME/vcpkg/vcpkg install rapidjson | ||
- name: Create build directory | ||
run: mkdir -p $HOME/build | ||
|
||
- name: Build the repository agent | ||
run: | | ||
mkdir -p $HOME/build && cd $HOME/build | ||
cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake \ | ||
-DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install \ | ||
-DTRITON_ENABLE_GCS=true \ | ||
-DTRITON_ENABLE_AZURE_STORAGE=true \ | ||
-DTRITON_ENABLE_S3=true \ | ||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | ||
$GITHUB_WORKSPACE | ||
make install |
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 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
jobs: | ||
lint: | ||
name: CPP Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install clang-format | ||
run: sudo apt-get install -y clang-format | ||
|
||
- name: Run clang-format | ||
run: | | ||
find . -iname *.h -o -iname *.cpp | xargs clang-format -i | ||
- name: Check for changes | ||
run: | | ||
if ! git diff --exit-code; then | ||
echo "Code style issues found" | ||
git diff | ||
exit 1 | ||
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
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,56 @@ | ||
# Use a base image that includes development essentials and git | ||
FROM ubuntu:latest AS builder | ||
|
||
# Install build tools, git, and other dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
tar \ | ||
pkg-config \ | ||
python3 | ||
|
||
# Install vcpkg | ||
RUN git clone https://github.com/Microsoft/vcpkg.git /vcpkg \ | ||
&& /vcpkg/bootstrap-vcpkg.sh | ||
|
||
# Install the required dependencies using vcpkg | ||
RUN /vcpkg/vcpkg install re2 \ | ||
&& /vcpkg/vcpkg install aws-sdk-cpp \ | ||
&& /vcpkg/vcpkg install google-cloud-cpp[storage] \ | ||
&& /vcpkg/vcpkg install azure-storage-blobs-cpp \ | ||
&& /vcpkg/vcpkg install rapidjson | ||
|
||
RUN mkdir -p /dragonfly-repository-agent/build | ||
|
||
# Assuming the source code is located in a directory called 'source' | ||
# You can COPY this in or clone from a repository as needed | ||
COPY ./src /dragonfly-repository-agent/src | ||
COPY ./cmake /dragonfly-repository-agent/cmake | ||
COPY ./CMakeLists.txt /dragonfly-repository-agent/CMakeLists.txt | ||
|
||
# Set the working directory | ||
WORKDIR /dragonfly-repository-agent/build | ||
|
||
# Set the environment variable for the vcpkg toolchain file | ||
ENV VCPKG_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
|
||
# Build the repository agent | ||
RUN cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_TOOLCHAIN_FILE} \ | ||
-DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install \ | ||
-DTRITON_ENABLE_GCS=true \ | ||
-DTRITON_ENABLE_AZURE_STORAGE=true \ | ||
-DTRITON_ENABLE_S3=true \ | ||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | ||
.. | ||
|
||
RUN make install | ||
|
||
FROM nvcr.io/nvidia/tritonserver:23.08-py3 | ||
|
||
RUN mkdir /opt/tritonserver/repoagents/dragonfly | ||
|
||
COPY --from=builder /dragonfly-repository-agent/build/libtritonrepoagent_dragonfly.so /opt/tritonserver/repoagents/dragonfly/libtritonrepoagent_dragonfly.so |
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.