File tree Expand file tree Collapse file tree 4 files changed +47
-8
lines changed Expand file tree Collapse file tree 4 files changed +47
-8
lines changed Original file line number Diff line number Diff line change 1111from hydra .core .config_store import ConfigStore
1212from commit0 .configs .config_class import Commit0Config
1313from commit0 .harness .constants import COMMANDS , SPLIT
14+ from omegaconf import OmegaConf
1415
1516
1617def main () -> None :
@@ -24,9 +25,15 @@ def main() -> None:
2425 cs .store (name = "user" , group = "Commit0Config" , node = Commit0Config )
2526 # have hydra to ignore all command-line arguments
2627 sys_argv = copy .deepcopy (sys .argv )
27- sys . argv = [ sys . argv [ 0 ]]
28+ cfg_arg = next (( arg for arg in sys_argv if arg . startswith ( "--cfg=" )), None )
2829 hydra .initialize (version_base = None , config_path = "configs" )
2930 config = hydra .compose (config_name = "user" )
31+
32+ if cfg_arg :
33+ config_name = cfg_arg .split ("=" )[1 ]
34+ user_config = OmegaConf .load (config_name )
35+ config = OmegaConf .merge (config , user_config )
36+
3037 # after hydra gets all configs, put command-line arguments back
3138 sys .argv = sys_argv
3239 # repo_split: split from command line has a higher priority than split in hydra
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ repo_split: all
1313num_workers : 8
1414
1515# test related
16+ <<<<<<< HEAD
1617backend : local
18+ =======
19+ backend : modal
20+ branch : ai
21+ >>>>>>> 22d3049 (update)
1722timeout : 1_800
1823num_cpus : 1
1924
Original file line number Diff line number Diff line change 1+ # Distributed
2+
3+ One of the main advantages of ` commit0 ` is that it can run
4+ a range of unit tests in distributed environments.
5+
6+ By default, the library is configured to work with [ modal] ( https://modal.com/ ) .
7+
8+ ``` bash
9+ pip install modal
10+ modal token new
11+ ```
12+
13+ ## Modal Setup
14+
15+ To enable distributed run, first
16+ create a file called ` distributed.yaml `
17+
18+ ``` yaml
19+ backend : modal
20+ base_dir : repos.dist/
21+ branch : master
22+ ` ` `
23+
24+ You can pass this configuration file as an argumnet to clone.
25+
26+ ` ` ` bash
27+ commit0 clone lite --cfg=distributed.yaml
28+ ```
29+
30+ Next run
31+
32+ ``` bash
33+ commit0 build lite --cfg=distributed.yaml
34+ ```
Original file line number Diff line number Diff line change @@ -104,10 +104,3 @@ functions in one file of the minitorch library.
104104
105105For a full example baseline system that tries to solve
106106all the tests in the library see the [ baseline] ( baseline ) documentation.
107-
108-
109-
110- ## Distributed Environments
111-
112-
113- ...
You can’t perform that action at this time.
0 commit comments