Skip to content

poetry test

poetry test #12

Workflow file for this run

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:
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
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"