-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run package test in docker (#345)
- Loading branch information
Showing
5 changed files
with
75 additions
and
104 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
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 |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
# deps | ||
/.deps | ||
|
||
# pip cache | ||
/.pip | ||
|
||
# libtorch | ||
/libtorch | ||
|
||
|
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 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
ensure_env() { | ||
local var_name="$1" | ||
if [ -z "${!var_name}" ]; then | ||
echo "Error: Environment variable '$var_name' is not set." | ||
exit 1 | ||
fi | ||
} | ||
|
||
ensure_env PYTHON_VERSION | ||
ensure_env TORCH_VERSION | ||
ensure_env CUDA_VERSION | ||
|
||
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
cd "$PROJECT_ROOT" | ||
|
||
export HOME=/tmp/home | ||
mkdir -p $HOME | ||
export PATH="$HOME/.local/bin:$PATH" | ||
|
||
# choose python version | ||
PYVER="${PYTHON_VERSION//./}" | ||
export PATH="/opt/python/cp${PYVER}-cp${PYVER}/bin:$PATH" | ||
|
||
# install PyTorch | ||
pip install torch==$TORCH_VERSION -i "https://download.pytorch.org/whl/cu${CUDA_VERSION//./}" | ||
|
||
# install dependencies | ||
pip install -r requirements-test.txt | ||
|
||
# install scalellm wheel | ||
pip install dist/*.whl | ||
|
||
# run pytest | ||
cd tests | ||
pytest |