Skip to content

Commit

Permalink
change deprecated modal Stub to App (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian authored Nov 11, 2024
1 parent dc8f905 commit 3931a42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions cicd/multigpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import jinja2
import modal
from jinja2 import select_autoescape
from modal import Image, Stub
from modal import App, Image

cicd_path = pathlib.Path(__file__).parent.resolve()

Expand Down Expand Up @@ -46,7 +46,7 @@
.pip_install("fastapi==0.110.0", "pydantic==2.6.3")
)

stub = Stub("Axolotl CI/CD", secrets=[])
app = App("Axolotl CI/CD", secrets=[])


N_GPUS = int(os.environ.get("N_GPUS", 2))
Expand All @@ -61,7 +61,7 @@ def run_cmd(cmd: str, run_folder: str):
exit(exit_code) # pylint: disable=consider-using-sys-exit


@stub.function(
@app.function(
image=cicd_image,
gpu=GPU_CONFIG,
timeout=60 * 60,
Expand All @@ -72,6 +72,6 @@ def cicd_pytest():
run_cmd("./cicd/multigpu.sh", "/workspace/axolotl")


@stub.local_entrypoint()
@app.local_entrypoint()
def main():
cicd_pytest.remote()
8 changes: 4 additions & 4 deletions cicd/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import jinja2
import modal
from jinja2 import select_autoescape
from modal import Image, Stub
from modal import App, Image

cicd_path = pathlib.Path(__file__).parent.resolve()

Expand Down Expand Up @@ -47,7 +47,7 @@
.pip_install("fastapi==0.110.0", "pydantic==2.6.3")
)

stub = Stub("Axolotl CI/CD", secrets=[])
app = App("Axolotl CI/CD", secrets=[])


N_GPUS = int(os.environ.get("N_GPUS", 1))
Expand All @@ -62,7 +62,7 @@ def run_cmd(cmd: str, run_folder: str):
exit(exit_code) # pylint: disable=consider-using-sys-exit


@stub.function(
@app.function(
image=cicd_image,
gpu=GPU_CONFIG,
timeout=60 * 60,
Expand All @@ -73,6 +73,6 @@ def cicd_pytest():
run_cmd("./cicd/cicd.sh", "/workspace/axolotl")


@stub.local_entrypoint()
@app.local_entrypoint()
def main():
cicd_pytest.remote()

0 comments on commit 3931a42

Please sign in to comment.