test: [RLOS2023] Add new e2e test framework for vw (#4644) #10
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
name: Backward Model checks | |
# This file is for checking that models generated from the current VW master do not cause crashes when loaded into newer VW code | |
# Generate a model using the latest vw master branch and load the same model using the latest wheel | |
on: | |
push: | |
branches: | |
- master | |
- 'releases/**' | |
pull_request: | |
branches: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
python-build: | |
name: Build previous master python wheel | |
container: | |
image: vowpalwabbit/manylinux2010-build:latest | |
runs-on: ubuntu-latest | |
steps: | |
# v1 must be used because newer versions require a node.js version that will not run on this old image. | |
- uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- name: Build wheel | |
shell: bash | |
run: | | |
git clone --recursive https://github.com/VowpalWabbit/vowpal_wabbit.git | |
cd vowpal_wabbit | |
/opt/python/cp310-cp310/bin/pip wheel . -w wheel_last_commit/ --global-option --cmake-options="-DSTATIC_LINK_VW_JAVA=On;-DPython_INCLUDE_DIR='/opt/python/cp310-cp310/include/python3.10/'" --verbose | |
cd .. | |
auditwheel repair vowpal_wabbit/wheel_last_commit/*whl -w audit_last_commit/ | |
- name: Upload built wheel | |
uses: actions/upload-artifact@v1 | |
with: | |
name: test_manylinux_amd64_3.10 | |
path: audit_last_commit/ | |
generate-latest-model: | |
name: Generate model using previous python wheel | |
needs: python-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Download artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: test_manylinux_amd64_3.10 | |
path: built_wheel | |
- name: Build recent-models | |
shell: bash | |
run: | | |
pip install built_wheel/*.whl | |
python ./test/run_tests_model_gen_and_load.py --generate_models --skip_missing_args --skip_pr_tests "${{ github.event.pull_request.title }}" | |
- name: Upload generated file | |
uses: actions/upload-artifact@v2 | |
with: | |
name: vw_generated_models | |
path: ~/.vw_runtests_model_gen_working_dir/* | |
if-no-files-found: error | |
test-latest-model: | |
name: Test previous master model with newest wheel | |
container: | |
image: vowpalwabbit/manylinux2010-build:latest | |
needs: generate-latest-model | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- uses: actions/download-artifact@v1 | |
with: | |
name: vw_generated_models | |
path: .vw_runtests_model_gen_working_dir | |
- name: Test loading model with current master | |
shell: bash | |
run: | | |
mv .vw_runtests_model_gen_working_dir ~ | |
/opt/python/cp310-cp310/bin/pip wheel . -w wheel_output/ --global-option --cmake-options="-DSTATIC_LINK_VW_JAVA=On;-DPython_INCLUDE_DIR='/opt/python/cp310-cp310/include/python3.10/'" --verbose | |
auditwheel repair wheel_output/*whl -w audit_output/ | |
/opt/python/cp310-cp310/bin/python3.10 -m pip install wheel_output/*.whl | |
/opt/python/cp310-cp310/bin/python3.10 ./test/run_tests_model_gen_and_load.py --load_models --skip_pr_tests "${{ github.event.pull_request.title }}" |