Skip to content

feat(config): assemble components through backend definitions - #424

Merged
BobbyZhouZijian merged 11 commits into
mainfrom
feat/automatic-training-services
Sep 12, 2026
Merged

BobbyZhouZijian merged 11 commits into
mainfrom
feat/automatic-training-services

Conversation

@BobbyZhouZijian

@BobbyZhouZijian BobbyZhouZijian commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Versioned deployments still expose HTTP process commands and training bridge wiring in YAML. This implements #414's contributor-directed boundary: users configure components, Reef assembles native inference/training, and recipes consume independently deployed method services through endpoints. The broader RFC remains proposed, so this PR remains a draft.

Changes

  • Remove service, services and execution.services from v2 configuration. HTTP settings and canonical flags use reef.*, including --reef.port and --reef.token. CLI and YAML use the same selected-component parser with CLI precedence.
  • Assemble provider/local inference or a declared serving runtime automatically. Weight Recipes select a training deployment definition; Slime remains the compatibility default. Its integration owns the driver, Ray bridge and training-owned inference connection.
  • Select training.backend through a built-in name, installed reef.training_backends entry point, or dotted TrainingDeployment class. Each definition owns process preparation and HTTP runtime configuration. Backend selection and service assembly share reef/service/deploy/training.py; extension contracts live in reef/train/deployment.py. InProcessTrainingDeployment starts only HTTP and uses its RuntimeFactory to validate options and create a TrainingRuntime. Missing backends fail without falling back to Slime.
  • Keep Slime native validation, model binding, Ray roles, command/environment and readiness inside its integration. Move shared reference/argv utilities below the service layer to preserve package dependency direction.
  • Organize deployment code by ownership: CLI syntax in cli.py, the ServiceConfig value and service_config_from_mapping() conversion in service_config.py, DeploymentConfig defaults, selected schemas and public layout in deployment_config.py. Keep YAML loading and interpolation in config_utils.py, move process validation to execution.py, and consolidate provider/local inference plus model preparation in inference.py. Remove forwarding-only argument modules and update imports and the codebase guide.
  • Weight Recipes use the generic RuntimeTrainingBackend; the old SlimeTrainingBackend import remains an alias. CPU contracts prove an installed in-process backend works without importing Slime/Ray/SGLang/Torch/MLX.
  • Keep PRM and user-model services entirely outside Reef. OpenClawRL declares PRM endpoint/tokenizer fields; its example Compose owns auxiliary startup, health checks and GPU assignments. Reef has no Recipe process-registration hook and neither probes nor stops these services. The example allocates GPU 1 to PRM, GPU 2 to the user model, and GPUs 3–7 to Reef/Slime (four actor plus one rollout GPU).
  • Migrate all maintained deployment YAML, tutorial/profile imports, packaging smoke configuration, examples, CLI help and documentation. Move repeated Slime CUDA/NCCL environment defaults into its integration.

Compatibility and operational impact

This intentionally revises the initial v2 layout from #417: move service fields to reef, use --reef.* instead of --service.*, and remove explicit process lists. Method-specific services are independently deployed. OpenClawRL uses recipe.config.prm-url and recipe.config.prm-tokenizer-path; it exposes no auxiliary launch settings. In the example, use docker compose down to stop all three containers; shutting down Reef alone leaves the auxiliary services running. External Ray clusters must exclude PRM/user-model GPUs. Unversioned legacy files retain explicit stacks and their existing override/command semantics.

Managed Slime launches ignore ambient SLIME_ARGS_FILE and use training.options. Existing Ray clusters remain externally owned. Slime's default environment sets CUDA_DEVICE_MAX_CONNECTIONS=1 and NCCL_NVLS_ENABLE=0, honoring operator overrides; this preserves the former TTTD/CORAL/OpenClawRL YAML defaults and also applies them to SAO. Migrated examples preserve their separate HTTP/driver readiness deadlines. Experiment metadata now names RuntimeTrainingBackend and the actual runtime class instead of labeling all weight training as Slime. Launch and app-assembly entrypoints in reef.service.deploy remain available. The Python configuration type and converter are now ServiceConfig and service_config_from_mapping(); callers using ServiceSettings or service_settings_from_config() must update those names. Internal imports from deploy.config, settings, components, layout, options, arguments and provider must use their new owning modules; repository callers are updated. No HTTP wire, persistence or numerical algorithm changes.

Verification

  • Final full suite: NO_PROXY='*' no_proxy='*' GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null .venv/bin/python -m pytest tests -n 4 --dist loadfile --cov=reef --cov-report=term -q --tb=short: 3341 passed, 48 skipped, 88.24% coverage.
  • Focused endpoint, lifecycle, OpenClawRL and example configuration suites: 76 passed; training startup suite: 25 passed. These cover CLI > YAML, rejecting auxiliary launch options, CPU-only discovery, and real external HTTP process survival after Reef shutdown/startup failure.
  • REEF_TEST_RAY=1 ... pytest tests/reef_service/test_openclawrl_gpu_pool.py -k openclawrl: 8 passed, covering local/external Ray and OpenClawRL's five logical model GPUs. No GPU kernels were run.
  • pre-commit run --all-files: passed; after the final test-fixture update, its focused hooks also passed. Mypy with lint CI dependencies: 264 source files passed.
  • Docs on Node 22: npm run check:docs, npm run lint, npm run build passed; dependencies were already installed with npm ci earlier in this PR.
  • OpenClawRL docker compose ... config --quiet and bash -n .../run.sh: passed. The three-container GPU stack was not started locally.
  • Before module reorganization, an installed CPU wheel outside the checkout passed 165 tests, including in-process HTTP startup/shutdown via an installed backend entry point; current package CI repeats this coverage.
  • GitHub CI has been triggered for 81cc9c9; its results are separate from the completed local checks above.

This supplies the deployment extension boundary for #325, without merging its MLX numerical implementation. Real MLX/Metal and Slime/Megatron/SGLang training runs were not performed. CPU tests verify configuration, runtime construction and process lifecycle, not numerical or GPU acceptance.

AI assistance

OpenAI Codex implemented the contributor-directed change, added tests, updated documentation and ran verification. The human contributor remains responsible for reviewing and understanding the implementation and results.

Checklist

  • The change is focused and contains no unrelated cleanup.
  • Tests cover behavior changes, or this pull request does not change behavior.
  • Public interface changes include contract tests, or no public interface changes are present.
  • Affected user and developer documentation is updated, or no documentation update is required.
  • Root README changes update both languages and README.i18n.yaml, or do not affect README content.
  • An accepted RFC is linked, or this change does not require an RFC.
  • Relevant pre-commit and test checks pass.
  • Non-trivial AI assistance is disclosed above, or none was used.

Review and merge

Draft follow-up to #414 and merged #417. RFC acceptance and GPU validation remain outstanding.

@github-actions github-actions Bot added area: docs User and developer documentation area: examples Examples, recipes, and reference deployments area: harness Harness integration, recipes, and evolution surfaces area: service Service APIs, deployment, and command-line interfaces area: training Training execution, runtimes, algorithms, and pipeline reliability labels Sep 12, 2026
@github-actions

Copy link
Copy Markdown

Merge Oncall: @BobbyZhouZijian

The merge oncall will route reviews and keep this pull request moving toward a clear decision.

@BobbyZhouZijian BobbyZhouZijian changed the title feat(serve): assemble Slime training without services YAML feat(config): assemble components without service sections Sep 12, 2026
@github-actions github-actions Bot added the area: core Core contracts and scenario lifecycle label Sep 12, 2026
@BobbyZhouZijian BobbyZhouZijian changed the title feat(config): assemble components without service sections feat(config): assemble components through backend definitions Sep 12, 2026
@BobbyZhouZijian
BobbyZhouZijian marked this pull request as ready for review September 12, 2026 18:13
@BobbyZhouZijian
BobbyZhouZijian merged commit 5465a8e into main Sep 12, 2026
12 checks passed
MikeZheng777 added a commit that referenced this pull request Sep 12, 2026
Resolve the catalog files against #424 and #427: add Reefine to the
catalog, keep CORAL TTT in the beta section, and align the benchmark
lists with the README matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core contracts and scenario lifecycle area: docs User and developer documentation area: examples Examples, recipes, and reference deployments area: harness Harness integration, recipes, and evolution surfaces area: service Service APIs, deployment, and command-line interfaces area: training Training execution, runtimes, algorithms, and pipeline reliability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant