-
Notifications
You must be signed in to change notification settings - Fork 71
106 lines (95 loc) · 2.83 KB
/
poetry_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Poetry Test
on:
workflow_dispatch:
pull_request:
branches:
- main
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:
Check:
runs-on: ubuntu-latest
outputs:
submodule_updated: ${{ steps.check_submodule.outputs.submodule_updated }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Check if submodules are updated
id: check_submodule
run: |
python -m pip install requests
python scripts/check_submodule_changes.py
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
Clone:
runs-on: tps_sco_nv
needs: [Check]
# if: needs.Check.outputs.submodule_updated == 'true'
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: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
cp LazyLLM-Env/poetry.lock . && poetry install
- name: RunTests
run: |
set -ex
cd ${{ env.CI_PATH }}
source deactivate
poetry shell
realpath .
env | grep '^SCC'
export LAZYLLM_SCO_ENV_NAME=lazyllm
export LAZYLLM_DEFAULT_LAUNCHER=sco
export LAZYLLM_SLURM_PART=a100
export PYTHONPATH=$PWD:$PYTHONPATH
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
poetry run python -m pytest tests/basic_tests/
poetry run python -m pytest tests/advanced_tests/
- 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"