Skip to content

Commit

Permalink
move setup steps from pkgci_shark_ai.yml to actions/pkgci-setup/actio…
Browse files Browse the repository at this point in the history
…n.yml
  • Loading branch information
renxida committed Feb 15, 2025
1 parent 52b1aa0 commit 4989ab9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 33 deletions.
53 changes: 53 additions & 0 deletions .github/actions/pkgci-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Package CI Install'
description: 'Sets up Python environment and installs dependencies'

inputs:
python-version:
description: 'Python version to use'
required: true
artifact-run-id:
description: 'Id for a workflow run that produced dev packages'
required: false
default: ''

runs:
using: "composite"
steps:
- name: "Setting up Python"
id: setup_python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ inputs.python-version }}

- name: Setup UV caching
shell: bash
run: |
CACHE_DIR="${GITHUB_WORKSPACE}/.uv-cache"
echo "UV_CACHE_DIR=${CACHE_DIR}" >> $GITHUB_ENV
mkdir -p "${CACHE_DIR}"
- name: Cache UV packages
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: .uv-cache
key: ${{ runner.os }}-uv-py${{ inputs.python-version }}-${{ hashFiles('requirements-iree-pinned.txt', 'pytorch-cpu-requirements.txt', 'sharktank/requirements.txt', 'sharktank/requirements-tests.txt', 'shortfin/requirements-tests.txt') }}

- name: Download package artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: snapshot-*-linux-x86_64-*
path: ${{ github.workspace }}/.packages
merge-multiple: true

- name: Setup venv
shell: bash
run: |
./build_tools/pkgci/setup_venv.py ${GITHUB_WORKSPACE}/.venv \
--artifact-path=${GITHUB_WORKSPACE}/.packages \
--fetch-gh-workflow=${{ inputs.artifact-run-id }}
- name: Install pinned IREE packages
shell: bash
run: |
source ${GITHUB_WORKSPACE}/.venv/bin/activate
uv pip install -r requirements-iree-pinned.txt
37 changes: 4 additions & 33 deletions .github/workflows/pkgci_shark_ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,12 @@ jobs:
run: rocminfo
- name: "Checkout Code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Setting up Python"
id: setup_python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{matrix.python-version}}

- name: Setup UV caching
run: |
CACHE_DIR="${GITHUB_WORKSPACE}/.uv-cache"
echo "UV_CACHE_DIR=${CACHE_DIR}" >> $GITHUB_ENV
mkdir -p "${CACHE_DIR}"
- name: Cache UV packages
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: .uv-cache
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}-${{ hashFiles('requirements-iree-pinned.txt', 'pytorch-cpu-requirements.txt', 'sharktank/requirements.txt', 'sharktank/requirements-tests.txt', 'shortfin/requirements-tests.txt') }}

- name: Download package artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: "Set up environment and install PkgCI Artifacts"
uses: ./.github/actions/pkgci-install
with:
pattern: snapshot-*-linux-x86_64-*
path: ${{ env.PACKAGE_DOWNLOAD_DIR }}
merge-multiple: true

- name: Setup venv
run: |
./build_tools/pkgci/setup_venv.py ${VENV_DIR} \
--artifact-path=${PACKAGE_DOWNLOAD_DIR} \
--fetch-gh-workflow=${{ inputs.artifact_run_id }}
- name: Install pinned IREE packages
run: |
source ${VENV_DIR}/bin/activate
uv pip install -r requirements-iree-pinned.txt
python-version: ${{matrix.python-version}}
artifact-run-id: ${{ inputs.artifact_run_id }}

- name: Run LLM Smoke Test
run: |
Expand Down

0 comments on commit 4989ab9

Please sign in to comment.