[RPD-277] [BUG] Fix setup.sh
for the recommendation example
#115
Workflow file for this run
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: LLM Example CI | |
on: | |
workflow_call: | |
pull_request: | |
paths: | |
- llm/** | |
branches: | |
- main | |
push: | |
paths: | |
- llm/** | |
branches: | |
- main | |
jobs: | |
ci-tests: | |
name: Pytest CI | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.10"] | |
timeout-minutes: 15 | |
# disable zenml analytics logging for ci | |
env: | |
ZENML_ANALYTICS_OPT_IN: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load cached venv | |
id: python_cache | |
uses: actions/cache@v3 | |
with: | |
path: venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('llm/requirements.txt') }} | |
# Install dependencies if cache does not exist | |
- name: Install dependencies | |
if: steps.python_cache.outputs.cache-hit != 'true' | |
run: | | |
sed 'zenmld' recommendation/requirements.txt > recommendation/requirements2.txt | |
mv recommendation/requirements2.txt recommendation/requirements.txt | |
if [ -d "venv" ]; then rm -rf venv; fi | |
python3 -m venv venv | |
venv/bin/python3 -m pip install -r llm/requirements.txt | |
# Install zenml separately due to pyyaml bug : https://github.com/yaml/pyyaml/issues/724 | |
- name: Install additional dependencies | |
run: | | |
source .venv/bin/activate | |
pip install "cython<3" wheel && pip install --no-build-isolation "pyyaml==5.4.1" | |
pip install "zenml==0.36.1" | |
- name: Setup ZenML | |
run: | | |
source venv/bin/activate | |
zenml integration install huggingface pytorch -y | |
zenml stack register llm_stack -a default -o default --set | |
- name: Run tests with pytest | |
run: | | |
source venv/bin/activate | |
cd llm | |
python -m pytest tests/ |