Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cudo auto updater #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
49 changes: 49 additions & 0 deletions .github/workflows/update-cudo-catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "update-cudo-catalog"
on:
schedule:
- cron: '00 */7 * * *'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase the minutes a bit to make sure all the actions do not conflict with each other.

Suggested change
- cron: '00 */7 * * *'
- cron: '05 */7 * * *'

workflow_dispatch:

jobs:
update_cudo_catalog:
runs-on: ubuntu-latest
steps:
- name: Clone SkyPilot repo
uses: actions/checkout@v3
with:
repository: skypilot-org/skypilot
path: sky
- name: Clone Catalog repo
uses: actions/checkout@v3
with:
fetch-depth: 0
path: catalogs
token: ${{ secrets.GH_ACTION_PAT }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cudo-compute

- name: Run fetch_cudo
run: |
version=$(python -c 'import sky; print(sky.clouds.service_catalog.constants.CATALOG_SCHEMA_VERSION)')
mkdir -p catalogs/catalogs/$version
cd catalogs/catalogs/$version
python -u -m sky.clouds.service_catalog.data_fetchers.fetch_cudo

- name: Commit catalog
run: |
version=$(python -c 'import sky; print(sky.clouds.service_catalog.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 Cudo Compute catalog $version (scheduled at $(date))" || { echo "No changes to commit" && exit 0; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git commit -m"[Bot] Update Cudo Compute catalog $version (scheduled at $(date))" || { echo "No changes to commit" && exit 0; }
git commit -m"[Bot] Update Cudo Compute catalog $version (scheduled at $(date))" || { echo "No changes to commit" && exit 0; }

git fetch origin
git rebase origin/master
git push