Repository navigation
Split yeto/launcher.py into the yeto/launch/ package - #260
Merged
Merged
Conversation
Pure structural refactor, no behavior change. launcher.py (8338 lines) is cut mechanically into 25 modules under yeto/launch/; launcher.py keeps run(), dry_run_plan() and island-task assembly (959 lines) and re-exports every name used by callers and tests. Tests: monkeypatch targets move to the module where the call happens; source-scanning tests now scan launcher.py + yeto/launch/*.py; new tests/test_launch_layout.py checks yeto/launch never imports yeto.launcher and the package import graph is acyclic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Structural refactor of
yeto/launcher.py. No behavior change. The file was 8338 lines; it is now 959 lines plus a new packageyeto/launch/(25 modules, 7836 lines). The split was generated mechanically by a name-to-module map: code and comments are kept verbatim, only imports change.Where responsibilities went
launch/__init__.pyREPO_ROOT(single definition)launch/rl_backend.pylaunch/remote_setup.pylaunch/topology.pylaunch/syncer.pylaunch/loss.pylaunch/credentials.pylaunch/storage.pylaunch/island_tasks.py--rl-island-tasksplan, checks, distributionlaunch/rl_ports.pylaunch/rl_args.py_prepare_rl_args, SAO streaming / dense full-sweep preprocessinglaunch/args.pyprepare_launch_args,check_cloud_prerequisiteslaunch/images.pyparse_image_spec, Miles source installlaunch/in_vm_docker.pylaunch/codex.pylaunch/rl_island_task.pymake_miles_island_tasklaunch/learner_task.pymake_learner_task(non-RL)launch/diffusion_sample.pyrun_diffusion_samplelaunch/sky_ops.pySkySDKOps, cluster naming, sky log_taillaunch/tapes.pylaunch/modal_islands.pylaunch/fleet.pyFleetController, island state, exit codes and failure kindslaunch/local_syncer.pyLocalSyncerlaunch/teardown.pylaunch/verda.pylaunch/manifest.pylauncher.pyrun(),dry_run_plan(),warn_if_model_wont_fit,GPU_MEM_GB, island task assembly helpers; re-exportsDependency direction (acyclic, bottom to top)
__init__,rl_backend,remote_setup,island_tasks,loss,credentials,verdatopology,syncer,storage,in_vm_docker,images,codex,teardownrl_portsrl_args->argssky_ops->fleet->local_syncer,modal_islands,tapesrl_island_task,learner_task,diffusion_sample,manifestlauncher(imports all)yeto/launch/*never importsyeto.launcher.tests/test_launch_layout.pyenforces this and checks the package import graph has no cycle.Compatibility
launcher.pyre-exports, via explicitfrom .launch.x import (...), every name that in-repo callers and tests use (195 names). No duplicate implementations.yeto/cli.py,island_overrides,memory_estimate,shape/*,sky_patches,dashboard/sources,rl/ssh_harness,cloud/modal_eval_island) are unchanged.REPO_ROOTnow usesparents[2](same value).Mock path changes (tests)
Patches now target the module where the lookup happens, using string paths:
REPO_ROOT->yeto.launch.loss,yeto.launch.args,yeto.launch.diffusion_sample(test_provenance)tcp_probe,build_syncer_binary->yeto.launch.syncerremote_sky_api_server->yeto.launch.verdaterminate_and_verify->yeto.launch.teardown_list_modal_apps,MODAL_STOP_VERIFY_DELAY_S->yeto.launch.modal_islandscodex_harness_launch->yeto.launch.codex_sky_docker_login_config->yeto.launch.credentials_miles_overlay_manifest->yeto.launch.manifestIN_VM_DOCKER_CLOUDS->yeto.launch.rl_island_taskPatches whose lookup still happens in
launcher.run()/dry_run_plan()or viacli.py'slauncher.Xstay onlauncher(e.g.prepare_launch_args,make_syncer_task,FleetController,SkySDKOps,LocalSyncer,_tail,_write_run_manifest,prepare_verda_islands).Source-scanning tests (
test_rl_mixed_island_placement,test_run_flags) now scanlauncher.py+yeto/launch/*.pywith unchanged assertions;test_import_boundariesaddsyeto/launchto the cloud-layer dirs.Verification
import yeto.launcherandpython -m yeto.cli --help/launch --help/rl --help/sample-diffusion --helpexit 0 on this branch.Risks
yeto.launcher.<name>not in the re-export list will getAttributeError.__module__changes (e.g.yeto.launch.fleet.FleetController). Nothing in the repo pickles these by module path.launcher.pywill conflict heavily. Recommended: regenerate the split from theirlauncher.pywith the split tooling instead of hand-merging.monkeypatch.setattr(launcher, "X", ...)in other branches silently stops working ifX's caller moved; check the lookup module when merging._sky_docker_login_confighas no in-repo caller (likely dead code); left as is.🤖 Generated with Claude Code