Skip to content
2 changes: 1 addition & 1 deletion scripts/deploy_tinkercloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ fi

# --- 4. in-container setup ---------------------------------------------------
echo "==> [4/6] running in-container setup (profile=$PROFILE)"
EX "PROFILE=$PROFILE bash /tmp/setup_container.sh"
EX "PROFILE=$PROFILE MILES_REPO='${MILES_REPO:-}' MILES_REF='${MILES_REF:-}' bash /tmp/setup_container.sh"

if [ "$RUN_SERVER" = 0 ]; then
# bionemo profile: env only — no Ray, no server (no working evo2 server yet).
Expand Down
22 changes: 21 additions & 1 deletion scripts/lib/setup_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,27 @@ if [ "$PROFILE" = nemo_rl ]; then
PKG=$(python3 -c 'import nemo_rl, os; print(os.path.dirname(nemo_rl.__file__))')
cp -r /tmp/RL/nemo_rl/. "$PKG/"
elif [ "$PROFILE" = miles ]; then
python3 -c 'import miles; print("miles pre-installed OK")'
# Overlay the GMI miles fork onto the image's editable install: the base image's
# baked miles predates the Tinker Ray-orchestration interface (forward_backward_only,
# apply_optimizer_step(learning_rate=), apply_optimizer_step_and_sync). Fork main is
# the maintained branch (PR merges fix_hackathon_rebased -> main).
MILES_REPO="${MILES_REPO:-https://github.com/GavinZhu-GMI/miles.git}"
MILES_REF="${MILES_REF:-main}"
MPKG=$(python3 -c 'import miles, os; print(os.path.dirname(miles.__file__))')
MROOT=$(dirname "$MPKG")
if git -C "$MROOT" rev-parse --git-dir >/dev/null 2>&1; then
# miles is an editable checkout (miles image): update it via git so the
# worktree IS the pinned ref — a bare cp leaves stale files and a dirty
# git status that masquerades as unsaved work.
git -C "$MROOT" fetch -q --depth 1 "$MILES_REPO" "$MILES_REF"
git -C "$MROOT" checkout -qf FETCH_HEAD
git -C "$MROOT" clean -qfd -- miles/
else
rm -rf /tmp/miles_src "$MPKG"
git clone -q --depth 1 --branch "$MILES_REF" "$MILES_REPO" /tmp/miles_src
cp -r /tmp/miles_src/miles "$MPKG"
fi
python3 -c 'import miles; print("miles fork overlaid OK ('"$MILES_REF"')")'
fi

# SDK + cookbook editable installs
Expand Down
Loading