⚠ Opt-in iteration loop. All PRs must additionally pass
make docker-test(see CONTRIBUTING.md). This page describes a faster local edit-test cycle, not a substitute for the canonical Docker test path.
This workflow lets you iterate on Morphling with a single Docker image
build and incremental rebuilds inside a long-running container. Source
code is bind-mounted into the container, and build output is cached in
a Docker volume. Before opening a PR, verify your change passes
make docker-test against a freshly-built image — the bind-mount
loop is for fast iteration only.
./dev.sh build./dev.sh start./dev.sh shell# If you changed C++ code, rebuild
./scripts/dev_build.sh
# Or rebuild from the host
./dev.sh rebuild
# Run a test workload
python3 scripts/run_devices.py \
--num_devices 4 \
--model_name facebook/opt-125m \
--backend proxy \
--seq_length 128 \
--batch_size 1 \
--cfg config/proxy/svr.ini- Source code is mounted into the container, so edits apply immediately.
- Incremental C++ builds use a Docker volume cache.
- The dev container provides a consistent environment.
| Command | Description |
|---|---|
./dev.sh build |
Build the Docker image |
./dev.sh start |
Start the dev container |
./dev.sh stop |
Stop the container |
./dev.sh restart |
Restart the container |
./dev.sh shell |
Open a shell in the container |
./dev.sh rebuild |
Rebuild inside the container |
./dev.sh run <cmd> |
Run a command in the container |
./dev.sh logs |
View container logs |
./dev.sh clean |
Remove containers and volumes |
- Modify files under
csrc/. - Run
./dev.sh rebuild. - Test with
./dev.sh run python3 scripts/run_devices.py ....
- Modify files under
morphling/. - Run your tests directly. Python changes take effect immediately after the
first
./dev.sh rebuild, which installs the package in editable mode (pip install -e .) against the bind-mounted source.
./dev.sh shell
export SPDLOG_LEVEL=debug
SPDLOG_LEVEL=debug python run_devices.py \
--num_devices 4 \
--model_name facebook/opt-125m \
--backend proxy \
--seq_length 128 \
--batch_size 1 \
--cfg ../config/proxy/svr.ini 2>&1 | tee server.logThese host directories are mounted into the container:
./csrc->/app/csrc./morphling->/app/morphling./scripts->/app/scripts./config->/app/config./logs->/app/logsmorphling_buildvolume ->/app/build
MORPHLING_DEV_MODE=1: enable dev modeSPDLOG_LEVEL=debug: set log verbosity
- The first build can take a while.
- Build output is cached in a Docker volume; deleting the volume clears cache.
- If you hit permission errors, ensure Docker can access the repo.
- Ensure ports 8080, 443, 39000, and 28516 are available.
./dev.sh clean
./dev.sh buildls -la scripts/
chmod +x scripts/*.shlsof -i :28516
# Or update port mappings in dev.sh