Skip to content

update-accelerators #1346

update-accelerators

update-accelerators #1346

name: "update-accelerators"
on:
schedule:
- cron: '30 */7 * * *' # Every 7 hours (coprimes with 24)
# The frequency can be tuned for the trade-off between
# freshness of the price and github action cost/user downloading
# overhead of the update.
# _UPDATE_FREQUENCY_HOURS in `aws_catalog.py` need to be updated
# accordingly, if this is changed.
workflow_dispatch:
jobs:
update_accelerators:
runs-on: ubuntu-latest
steps:
- name: Clone SkyPilot repo
uses: actions/checkout@v3
with:
repository: skypilot-org/skypilot
path: skypilot
- name: Clone Catalog repo
uses: actions/checkout@v3
with:
fetch-depth: 0
path: catalogs
token: ${{ secrets.GH_ACTION_PAT }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
python-version: "3.10"
- name: Install dependencies
run: |
uv venv --seed ~/test-env
source ~/test-env/bin/activate
cd skypilot
uv pip install --prerelease allow azure-cli
uv pip install .[all]
- name: Run accelerators aggregations
run: |
source ~/test-env/bin/activate
version=$(python -c 'import sky; print(sky.skylet.constants.CATALOG_SCHEMA_VERSION)')
cd catalogs
mkdir -p catalogs/$version/common
mkdir -p ~/.sky/catalogs
cp -r catalogs/$version ~/.sky/catalogs/
cd catalogs/$version
python -u ../../.github/scripts/aggregate_accelerators.py
- name: Commit catalog
run: |
source ~/test-env/bin/activate
version=$(python -c 'import sky; print(sky.skylet.constants.CATALOG_SCHEMA_VERSION)')
cd catalogs
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m"[Bot] Update accelerators (scheduled at $(date))" || { echo "No changes to commit" && exit 0; }
git fetch origin
git rebase origin/master
git push