-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement inference server by using vllm (#624)
**Reason for Change**: <!-- What does this PR improve or fix in Kaito? Why is it needed? --> **Requirements** - [x] added unit tests and e2e tests (if applicable). **Issue Fixed**: <!-- If this PR fixes GitHub issue 4321, add "Fixes #4321" to the next line. --> **Notes for Reviewers**: --------- Signed-off-by: zhuangqh <[email protected]> Signed-off-by: jerryzhuang <[email protected]>
- Loading branch information
Showing
12 changed files
with
2,369 additions
and
16 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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
*.dylib | ||
bin/* | ||
Dockerfile.cross | ||
__pycache__/ | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <test_dir> <requirements.txt>" | ||
exit 1 | ||
fi | ||
|
||
PROJECT_DIR=$(dirname "$(dirname "$(realpath "$0")")") | ||
|
||
TEST_DIR="$PROJECT_DIR/$1" | ||
REQUIREMENTS="$PROJECT_DIR/$2" | ||
VENV_DIR=$(mktemp -d) | ||
|
||
cleanup() { | ||
rm -rf "$VENV_DIR" | ||
} | ||
trap cleanup EXIT | ||
|
||
cd $VENV_DIR | ||
printf "Creating virtual environment in %s\n" "$VENV_DIR" | ||
python3 -m virtualenv venv | ||
source "$VENV_DIR/venv/bin/activate" | ||
if [ "$?" -ne 0 ]; then | ||
printf "Failed to activate virtual environment\n" | ||
exit 1 | ||
fi | ||
|
||
printf "Installing requirements from %s\n" "$REQUIREMENTS" | ||
pip install -r "$REQUIREMENTS" > "$VENV_DIR/pip.log" | ||
if [ "$?" -ne 0 ]; then | ||
cat "$VENV_DIR/pip.log" | ||
exit 1 | ||
fi | ||
|
||
printf "Running tests in %s\n" "$TEST_DIR" | ||
pytest -o log_cli=true -o log_cli_level=INFO "$TEST_DIR" |
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
Oops, something went wrong.