Skip to content

update-nebius-catalog #783

update-nebius-catalog

update-nebius-catalog #783

name: "update-nebius-catalog"
on:
schedule:
- cron: '15 */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 `nebius_catalog.py` need to be updated
# accordingly, if this is changed.
workflow_dispatch:
jobs:
update_nebius_catalog:
runs-on: ubuntu-latest
steps:
- name: Clone SkyPilot repo
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: skypilot-org/skypilot
path: sky
- name: Clone Catalog repo
uses: actions/checkout@v4
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 ~/catalogs-venv
source ~/catalogs-venv/bin/activate
cd sky
uv pip install ".[nebius]"
cd -
- name: Run fetch_nebius
run: |
mkdir -p ~/.nebius
echo '${{ secrets.NEBIUS_CREDENTIALS }}' > ~/.nebius/credentials.json
echo '${{ secrets.NEBIUS_TENANT_ID }}' > ~/.nebius/NEBIUS_TENANT_ID.txt
source ~/catalogs-venv/bin/activate
version=$(python -c 'import sky; print(sky.skylet.constants.CATALOG_SCHEMA_VERSION)')
mkdir -p catalogs/catalogs/$version
cd catalogs/catalogs/$version
python -m sky.catalog.data_fetchers.fetch_nebius
cd -
- name: Commit catalog
run: |
source ~/catalogs-venv/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 Nebius catalog $version (scheduled at $(date))" || { echo "No changes to commit" && exit 0; }
git fetch origin
git rebase origin/master
git push