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

poetry test #54

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Move code to custom directory
run: |
set -ex
mv $GITHUB_WORKSPACE/* ${{ env.CI_PATH }}/
rsync -a $GITHUB_WORKSPACE/ ${{ env.CI_PATH }}/

BasicTests:
runs-on: tps_sco_nv
Expand All @@ -67,6 +67,7 @@ jobs:
steps:
- name: RunTests
run: |
set -ex
cd ${{ env.CI_PATH }}
env | grep '^SCC'
export LAZYLLM_SCO_ENV_NAME=lazyllm
Expand All @@ -76,4 +77,4 @@ jobs:
export LAZYLLM_SCO_WORKSPACE=expert-services
export LAZYLLM_DATA_PATH=/mnt/lustre/share_data/lazyllm/data/
export LAZYLLM_MODEL_PATH=/mnt/lustre/share_data/lazyllm/models
python -m pytest tests/advanced_tests/
python -m pytest tests/advanced_tests/
77 changes: 77 additions & 0 deletions .github/workflows/poetry_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Poetry Test

on:
workflow_dispatch:
push:
paths:
- 'LazyLLM-Env'
pull_request:
paths:
- 'LazyLLM-Env'



env:
CI_PATH: '/home/mnt/platform_ci/GitHub/${{ github.repository }}/${GITHUB_RUN_NUMBER}_poetry'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Clone:
runs-on: tps_sco_nv
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Create custom directory
run: |
set -ex
echo ${{ env.CI_PATH }}
mkdir -p ${{ env.CI_PATH }}
- name: Clean custom directory
run: |
set -ex
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}/*
fi
- name: Move code to custom directory
run: |
set -ex
rsync -a $GITHUB_WORKSPACE/ ${{ env.CI_PATH }}/

Poetry_Test:
runs-on: tps_sco_nv
needs: [Clone]
steps:
- name: Install deps
shell: bash
run: |
cd ${{ env.CI_PATH }}
source deactivate
cp LazyLLM-Env/poetry.lock . && poetry install --extras "full" && poetry add pytest
- name: RunTests
run: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
realpath .
export LAZYLLM_SCO_ENV_NAME=lazyllm
export PYTHONPATH=$PWD:$PYTHONPATH
export LAZYLLM_DATA_PATH=/mnt/lustre/share_data/lazyllm/data/
export LAZYLLM_MODEL_PATH=/mnt/lustre/share_data/lazyllm/models
poetry run python -m pytest tests/advanced_tests/ -k "not test_deploy"
poetry run python -m pytest tests/basic_tests/ -k "not test_component and not test_launcher and not test_module"

- name: Clean_Poetry_env
if: always()
run: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
current_env=$(poetry env list | grep 'Activated' | awk '{print $1}')
poetry env remove "$current_env"
2 changes: 1 addition & 1 deletion LazyLLM-Env
Submodule LazyLLM-Env updated 1 files
+18 −472 poetry.lock
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ redis = { version = ">=5.0.4", optional = true }
huggingface-hub = { version = ">=0.23.1", optional = true }
jieba = { version = ">=0.42.1", optional = true }
llama-index = { version = ">=0.10.25", optional = true }
modelscope = { version = ">=1.14.0", optional = true }
pandas = { version = ">=2.2.2", optional = true }
pyjwt = { version = ">=2.8.0", optional = true }
rank-bm25 = { version = ">=0.2.2", optional = true }
Expand Down Expand Up @@ -53,6 +52,7 @@ torchvision = { version = ">=0.16.2", optional = true }
vllm = { version = ">=0.4.0", optional = true }
wandb = { version = ">=0.17.0", optional = true }
docstring-parser = "^0.16"
modelscope = "^1.16.0"

[tool.poetry.extras]
full = [
Expand Down
32 changes: 32 additions & 0 deletions scripts/check_submodule_changes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import requests
import os

def get_pr_files(api_url):
headers = {
"Accept": "application/vnd.github.v3+json"
}
response = requests.get(api_url, headers=headers)
if response.status_code != 200:
print(f"Error fetching PR files: {response.status_code}")
return []

return response.json()

def check_submodule_changes(pr_files, submodule_path):
for file in pr_files:
if submodule_path in file['filename']:
return True
return False

if __name__ == "__main__":
repository = os.getenv('GITHUB_REPOSITORY')
pr_number = os.getenv('GITHUB_PR_NUMBER')
api_url = f"https://api.github.com/repos/{repository}/pulls/{pr_number}/files"

pr_files = get_pr_files(api_url)
submodule_path = "LazyLLM-Env"

if check_submodule_changes(pr_files, submodule_path):
print("::set-output name=submodule_updated::true")
else:
print("::set-output name=submodule_updated::false")
Loading