fix(sync): preserve explicit remote path for mesh#88
Merged
Conversation
The initial sync could report "complete" prematurely when the local syncthing folder hadn't finished its first scan. An empty index trivially satisfies "remote has everything local has" (0/0 = 100%), causing okdev up to proceed before files were actually transferred. Add waitForLocalFolderScan() that polls /rest/db/status until the folder state transitions out of "scanning". Called in both runTwoPhaseInitialSync and waitForInitialSync to ensure the index is populated before trusting completion values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous scan-wait fix was insufficient: after local scan completes, the remote might still report needBytes=0 because it hasn't received the local's index yet (doesn't know about any files). Now both runTwoPhaseInitialSync and waitForInitialSync verify that when the local has files (globalFiles > 0), the remote also reports globalFiles > 0 before accepting needBytes=0 as "sync complete". This prevents the race where index exchange hasn't happened yet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When mesh-hello.txt is missing on master or worker, dump the state of both containers' /workspace directories, the sidecar's syncthing config folders, sidecar container logs, local sync log, and okdev status --details. This gives us concrete evidence to diagnose why files aren't landing where expected, rather than a single one-line error message. Made-with: Cursor
… mount
Generated workload manifests (e.g. `okdev init --workload pytorchjob`) keep
Go template actions like `{{ .WorkloadName }}` unrendered until apply time.
`workspaceMountPathFromManifest` parsed the raw file as YAML, which failed
on those placeholders and silently fell back to `/workspace`.
For PyTorchJob sessions where the sync remote is a subdirectory such as
`/workspace/a`, this caused the `pytorch` container to mount the shared
`workspace` emptyDir at `/workspace/a` while the injected `okdev-sidecar`
kept the default `/workspace`. Syncthing therefore wrote files to
`/workspace/a` (sidecar view) which surfaced on the target as
`/workspace/a/a`, so the E2E mesh check never found `mesh-hello.txt`.
Strip Go template placeholders with a safe stub before YAML parsing so
the workspace mount path is derived correctly regardless of the
template variables.
Made-with: Cursor
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
Test Plan