Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
29 changes: 12 additions & 17 deletions .azure-pipelines/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
matrix:
PyTorch_latest:
image: speediedan/interpretune:py3.12-pt2.9.0-azpl-init
image: speediedan/interpretune:py3.12-pt2.9.1-azpl-init
scope: ""
timeoutInMinutes: 100
cancelTimeoutInMinutes: 2
Expand Down Expand Up @@ -146,31 +146,26 @@ jobs:
displayName: 'Maybe reset HF cache'

- bash: |
. /tmp/venvs/it_dev/bin/activate
python -m pip install --upgrade pip setuptools setuptools-scm wheel build
python -m pip install -r requirements/ci/requirements.txt -r requirements/ci/platform_dependent.txt --no-warn-script-location
python -m pip install -e '.[test,examples,lightning]' --no-warn-script-location
if ([ "${APPLY_POST_UPGRADES:-}" = "1" ] || [ "${APPLY_POST_UPGRADES:-}" = "true" ]) && [ -s requirements/ci/post_upgrades.txt ]; then
echo "Applying post-upgrades (requirements/ci/post_upgrades.txt)..."
python -m pip install --upgrade -r requirements/ci/post_upgrades.txt --cache-dir "$PIP_CACHE_DIR"
else
echo "Skipping post-upgrades (either disabled or file empty)."
fi
python -m pip list
source /tmp/venvs/it_dev/bin/activate
echo "Installing interpretune in editable mode with any git url dependencies..."
uv pip install -e . --group git-deps
echo "Installing locked CI requirements..."
uv pip install -r requirements/ci/requirements.txt
uv pip list
displayName: 'Install dependencies'

- bash: |
. /tmp/venvs/it_dev/bin/activate
source /tmp/venvs/it_dev/bin/activate
python requirements/utils/collect_env_details.py
displayName: 'Env details and package versions'

- bash: |
. /tmp/venvs/it_dev/bin/activate
source /tmp/venvs/it_dev/bin/activate
python -m coverage run --append --source src/interpretune -m pytest src/interpretune tests -v --junitxml=$(Build.Repository.LocalPath)/test-results.xml --durations=50
displayName: 'Testing: standard'

- bash: |
. /tmp/venvs/it_dev/bin/activate
source /tmp/venvs/it_dev/bin/activate
export HF_GATED_PUBLIC_REPO_AUTH_KEY=$HF_GATED_PUBLIC_REPO_AUTH_KEY
export HF_TOKEN=$HF_TOKEN
bash ./tests/special_tests.sh --mark_type=standalone
Expand All @@ -180,12 +175,12 @@ jobs:
HF_TOKEN: $(HF_TOKEN)

- bash: |
. /tmp/venvs/it_dev/bin/activate
source /tmp/venvs/it_dev/bin/activate
bash ./tests/special_tests.sh --mark_type=profile_ci
displayName: 'Testing: CI Profiling'

- bash: |
. /tmp/venvs/it_dev/bin/activate
source /tmp/venvs/it_dev/bin/activate
python -m coverage report
python -m coverage xml
python -m coverage html
Expand Down
62 changes: 22 additions & 40 deletions .github/actions/install-ci-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,38 @@
name: "Install CI Dependencies"
description: "Install Python dependencies for CI workflows including platform-dependent packages and post-upgrades"
description: "Install Python dependencies for CI workflows"

inputs:
python_version:
description: "Python version to use"
required: false
default: "3.12"
show_pip_list:
description: "Whether to show pip list output after installations"
description: "Whether to show package list output after installations"
required: false
default: "false"
apply_post_upgrades:
description: "Whether to apply post-upgrade packages"
required: false
default: "true"

runs:
using: "composite"
steps:
- name: Set up venv and install ci dependencies
shell: bash
run: |
python -m pip install --upgrade pip setuptools setuptools-scm wheel build --cache-dir "$PIP_CACHE_DIR"
# Prefer CI pinned requirements if present
if [ -f requirements/ci/requirements.txt ]; then
pip install -r requirements/ci/requirements.txt --cache-dir "$PIP_CACHE_DIR"
python -m pip install -e '.[test,examples,lightning]' --cache-dir "$PIP_CACHE_DIR"
else
python -m pip install -e '.[test,examples,lightning]' --cache-dir "$PIP_CACHE_DIR"
fi
if [ "${{ inputs.show_pip_list }}" = "true" ]; then
pip list
fi
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ inputs.python_version }}
activate-environment: true
enable-cache: true

- name: Install platform-dependent packages
- name: Install project dependencies
shell: bash
run: |
# Install platform-dependent packages with flexible constraints to allow platform-specific resolution
if [ -f requirements/ci/platform_dependent.txt ] && [ -s requirements/ci/platform_dependent.txt ]; then
echo "Installing platform-dependent packages from requirements/ci/platform_dependent.txt..."
python -m pip install -r requirements/ci/platform_dependent.txt --cache-dir "$PIP_CACHE_DIR" || echo "Some platform-dependent packages may not be available on this platform, continuing..."
else
echo "No platform-dependent packages to install."
fi
# interpretune editable with git-deps group (uv doesn't currently support url deps in locked reqs)
echo "Installing interpretune in editable mode with any git url dependencies..."
uv pip install -e . --group git-deps
echo "Installing locked CI requirements..."
uv pip install -r requirements/ci/requirements.txt


- name: Optional post-upgrades (datasets/fsspec etc)
- name: Show package list
if: inputs.show_pip_list == 'true'
shell: bash
env:
APPLY_POST_UPGRADES: ${{ inputs.apply_post_upgrades }}
run: |
if ([ "${APPLY_POST_UPGRADES}" = "1" ] || [ "${APPLY_POST_UPGRADES}" = "true" ]) && [ -s requirements/ci/post_upgrades.txt ]; then
echo "Applying post-upgrades (requirements/ci/post_upgrades.txt)..."
python -m pip install --upgrade -r requirements/ci/post_upgrades.txt --cache-dir "$PIP_CACHE_DIR"
if [ "${{ inputs.show_pip_list }}" = "true" ]; then
pip list
fi
else
echo "Skipping post-upgrades (either disabled or file empty)."
fi
uv pip list
17 changes: 6 additions & 11 deletions .github/actions/regen-ci-reqs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,24 @@ inputs:
compare_paths:
description: Space-separated list of files/paths to compare with git diff
required: false
default: "requirements/ci/requirements.txt requirements/ci/post_upgrades.txt requirements/ci/platform_dependent.txt"
default: "requirements/ci/requirements.txt"
patch_path:
description: Path to write the patch file
required: false
default: regen_diff.patch
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Install regen deps
- name: Install uv
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install pip-tools toml
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Run regen (pip-compile)
- name: Run lock regeneration
shell: bash
run: |
python requirements/utils/regen_reqfiles.py --mode pip-compile --ci-output-dir=${{ inputs.ci_output_dir }}
bash requirements/utils/lock_ci_requirements.sh

- id: check
name: Check for diffs and write patch
Expand Down
1 change: 0 additions & 1 deletion .github/actions/run-pytest-instrumented/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ runs:
PYTHONPATH: ${{ inputs.workspace }}/src
PYTEST_ADDOPTS: "--log-cli-level=${{ inputs.it_ci_log_level }} --log-cli-format='%(asctime)s [%(levelname)8s] %(name)s: %(message)s' --capture=no"
PYTEST_FILTER_PATTERN: ${{ inputs.pytest_filter_pattern }}
PIP_CACHE_DIR: ${{ inputs.pip_cache_dir }}
run: |
if [ -n "$PYTEST_FILTER_PATTERN" ]; then
echo "PYTEST_FILTER_PATTERN is set to '$PYTEST_FILTER_PATTERN'. Disabling coverage collection and running filtered tests only."
Expand Down
Loading
Loading