Skip to content

Commit 9408f4d

Browse files
committed
Upgrade Modal
1 parent ddc6bb7 commit 9408f4d

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

.github/workflows/run-tests-on-modal.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install build dependencies
4040
run: |
4141
python -m pip install --upgrade pip
42-
pip install modal==0.73.32
42+
pip install modal==1.1.0
4343
4444
- name: Run tests
4545
run: |
@@ -74,7 +74,7 @@ jobs:
7474
- name: Install build dependencies
7575
run: |
7676
python -m pip install --upgrade pip
77-
pip install modal==0.73.32
77+
pip install modal==1.1.0
7878
7979
- name: Measure and upload coverage
8080
run: |
@@ -105,7 +105,7 @@ jobs:
105105
- name: Install build dependencies
106106
run: |
107107
python -m pip install --upgrade pip
108-
pip install modal==0.73.32
108+
pip install modal==1.1.0
109109
110110
- name: Run p2pd tests
111111
run: |

modal_ci.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
"cd bitsandbytes && cmake -DCOMPUTE_BACKEND=cpu -S . && make && pip --no-cache install . ",
1616
]
1717
)
18-
.add_local_dir("hivemind", remote_path="/root/hivemind/hivemind")
19-
.add_local_file("requirements.txt", remote_path="/root/hivemind/requirements.txt")
20-
.add_local_file("requirements-dev.txt", remote_path="/root/hivemind/requirements-dev.txt")
21-
.add_local_file("requirements-docs.txt", remote_path="/root/hivemind/requirements-docs.txt")
22-
.add_local_file("setup.py", remote_path="/root/hivemind/setup.py")
23-
.add_local_file("pyproject.toml", remote_path="/root/hivemind/pyproject.toml")
24-
.add_local_dir("tests", remote_path="/root/hivemind/tests")
2518
)
2619

2720
# Create an image with golang and other system dependencies
@@ -41,13 +34,6 @@
4134
"cd bitsandbytes && cmake -DCOMPUTE_BACKEND=cpu -S . && make && pip --no-cache install . ",
4235
]
4336
)
44-
.add_local_dir("hivemind", remote_path="/root/hivemind/hivemind")
45-
.add_local_file("requirements.txt", remote_path="/root/hivemind/requirements.txt")
46-
.add_local_file("requirements-dev.txt", remote_path="/root/hivemind/requirements-dev.txt")
47-
.add_local_file("requirements-docs.txt", remote_path="/root/hivemind/requirements-docs.txt")
48-
.add_local_file("setup.py", remote_path="/root/hivemind/setup.py")
49-
.add_local_file("pyproject.toml", remote_path="/root/hivemind/pyproject.toml")
50-
.add_local_dir("tests", remote_path="/root/hivemind/tests")
5137
)
5238

5339

@@ -85,7 +71,12 @@ def setup_environment(*, build_p2pd=False):
8571
return environment
8672

8773

88-
@app.function(image=image, timeout=600, cpu=8, memory=8192)
74+
@app.function(
75+
image=image.add_local_dir(".", remote_path="/root/hivemind"),
76+
timeout=1200,
77+
cpu=8,
78+
memory=8192,
79+
)
8980
def run_tests():
9081
environment = setup_environment(build_p2pd=False)
9182

@@ -104,7 +95,13 @@ def run_tests():
10495
)
10596

10697

107-
@app.function(image=image, timeout=900, cpu=8, memory=8192, secrets=[codecov_secret])
98+
@app.function(
99+
image=image.add_local_dir(".", remote_path="/root/hivemind"),
100+
timeout=900,
101+
cpu=8,
102+
memory=8192,
103+
secrets=[codecov_secret],
104+
)
108105
def run_codecov():
109106
environment = setup_environment(build_p2pd=False)
110107

@@ -145,7 +142,12 @@ def run_codecov():
145142
)
146143

147144

148-
@app.function(image=image_with_golang, timeout=600, cpu=1, memory=4096)
145+
@app.function(
146+
image=image_with_golang.add_local_dir(".", remote_path="/root/hivemind"),
147+
timeout=600,
148+
cpu=1,
149+
memory=4096,
150+
)
149151
def build_and_test_p2pd():
150152
environment = setup_environment(build_p2pd=True)
151153

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from setuptools import setup
1212
from setuptools.command.build_py import build_py
1313
from setuptools.command.develop import develop
14+
from setuptools.command.egg_info import egg_info
1415

1516
P2PD_VERSION = "v0.5.0.hivemind1"
1617

@@ -126,7 +127,7 @@ def finalize_options(self):
126127
super().finalize_options()
127128
# Convert string to boolean if needed
128129
if isinstance(self.buildgo, str):
129-
self.buildgo = self.buildgo.lower() in ('true', '1', 'yes', 'on')
130+
self.buildgo = self.buildgo.lower() in ("true", "1", "yes", "on")
130131

131132
def run(self):
132133
if self.buildgo:
@@ -146,6 +147,13 @@ def run(self):
146147
super().run()
147148

148149

150+
class EggInfo(egg_info):
151+
def run(self):
152+
# Generate protobuf files early in the build process
153+
proto_compile(os.path.join(here, "hivemind", "proto"))
154+
super().run()
155+
156+
149157
setup(
150-
cmdclass={"build_py": BuildPy, "develop": Develop},
158+
cmdclass={"build_py": BuildPy, "develop": Develop, "egg_info": EggInfo},
151159
)

0 commit comments

Comments
 (0)