Skip to content

Commit 911c82e

Browse files
authored
Add rebuild to CI (#415)
## Summary <!--- This is a required section; please describe the main purpose of this proposed code change. ---> <!--- ## Details This is an optional section; is there anything specific that reviewers should be aware of? ---> The current modal image always uses cache, so it does not run with the latest dependencies. 1. We `force_build` every night, and it pulls the latest dependencies 2. For CI and main commit, it uses the cache so it is faster ## Testing Done <!--- This is a required section; please describe how this change was tested. ---> <!-- Replace BLANK with your device type. For example, A100-80G-PCIe Complete the following tasks before sending your PR, and replace `[ ]` with `[x]` to indicate you have done them. --> - Hardware Type: <BLANK> - [x] run `make test` to ensure correctness - [x] run `make checkstyle` to ensure code style - [x] run `make test-convergence` to ensure convergence
1 parent 0137757 commit 911c82e

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ on:
1313
paths:
1414
- "src/**"
1515
- "test/**"
16+
schedule:
17+
# Runs at 00:00 UTC daily
18+
- cron: '0 0 * * *'
19+
workflow_dispatch: # Enables manual trigger
1620

1721
concurrency:
18-
# This causes it to cancel previous in-progress actions on the same PR / branch,
1922
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2023
cancel-in-progress: true
2124

@@ -46,6 +49,7 @@ jobs:
4649
env:
4750
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
4851
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
52+
REBUILD_IMAGE: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
4953

5054
steps:
5155
- name: Checkout code
@@ -71,6 +75,7 @@ jobs:
7175
env:
7276
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
7377
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
78+
REBUILD_IMAGE: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
7479

7580
steps:
7681
- name: Checkout code

dev/modal/tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44

55
ROOT_PATH = Path(__file__).parent.parent.parent
66

7+
# REBUILD_IMAGE is an environment variable that is set to "true" in the nightly build
8+
REBUILD_IMAGE = modal.env("REBUILD_IMAGE", default=False)
9+
710
image = modal.Image.debian_slim().pip_install_from_pyproject(
8-
ROOT_PATH / "pyproject.toml", optional_dependencies=["dev"]
11+
ROOT_PATH / "pyproject.toml",
12+
optional_dependencies=["dev"],
13+
force_build=REBUILD_IMAGE,
914
)
1015

1116
app = modal.App("liger_tests", image=image)

dev/modal/tests_bwd.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
ROOT_PATH = Path(__file__).parent.parent.parent
66

7+
# REBUILD_IMAGE is an environment variable that is set to "true" in the nightly build
8+
REBUILD_IMAGE = modal.env("REBUILD_IMAGE", default=False)
9+
710
# tests_bwd is to ensure the backward compatibility of liger with older transformers
811
image = (
912
modal.Image.debian_slim()
1013
.pip_install_from_pyproject(
11-
ROOT_PATH / "pyproject.toml", optional_dependencies=["dev"]
14+
ROOT_PATH / "pyproject.toml",
15+
optional_dependencies=["dev"],
16+
force_build=REBUILD_IMAGE,
1217
)
13-
.pip_install("transformers==4.44.2")
18+
.pip_install("transformers==4.44.2", force_build=REBUILD_IMAGE)
1419
)
1520

1621
app = modal.App("liger_tests", image=image)

0 commit comments

Comments
 (0)