feat: add remote coasts infrastructure (Phase 0)#168
Draft
VAIBHAVSING wants to merge 10 commits intocoast-guard:mainfrom
Draft
feat: add remote coasts infrastructure (Phase 0)#168VAIBHAVSING wants to merge 10 commits intocoast-guard:mainfrom
VAIBHAVSING wants to merge 10 commits intocoast-guard:mainfrom
Conversation
… protocol, handlers
Contributor
|
@VAIBHAVSING I'll play around with this tomorrow. I have an idea for a coast-client and coast-server module. That I want to write down and make sure this hooks into nicely. |
Add complete Mutagen-based file synchronization for Remote Coasts: Core Implementation: - MutagenManager for sync session lifecycle (create, pause, resume, flush, terminate) - One-way sync (local → remote) with 'one-way-safe' mode - Session naming: coast-<project>-<branch>-<remote> - Remote workspace path: ~/coast-workspaces/<project>/<branch>/ - Support for .coastignore patterns (node_modules, .git, *.log) - State persistence in sync_sessions table CLI Commands: - coast sync create <project> <remote> --local-path <path> --branch <branch> - coast sync status [project] - list active sync sessions - coast sync pause/resume <project> - control sync - coast sync flush <project> - force immediate sync - coast sync terminate <project> - stop and remove session Protocol: - SyncCreateRequest/Response with local_path, branch, remote - SyncStatusRequest/Response with session info - SyncPauseRequest/Response, SyncResumeRequest/Response - SyncFlushRequest/Response, SyncTerminateRequest/Response Testing: - Comprehensive test scripts (test_sync_simple.sh, test_sync_quick.sh) - Setup automation (setup_test.sh, install_mutagen.sh) - Detailed testing guides (QUICK_TEST.md, TEST_SYNC.md) - Tests: initial sync, real-time updates, ignore patterns, pause/resume Technical Details: - Mutagen ~100MB on local, ~10MB agent on remote (auto-installed) - Uses SSH for transport with optional key configuration - Sync status tracking: Initial, Syncing, Paused, Error - Handler integration in handlers/remote.rs - Analytics support for all sync operations Phase 2 complete - workspace sync fully functional. Next: Phase 3 (remote build/run), Phase 4 (remote exec/logs)
- Installs Docker, Docker Compose, and Mutagen on remote VM - Builds coastd-dev binary on remote (avoids glibc mismatch) - Starts daemon and creates workspace directories - Supports manual remote development environment setup
Add remote daemon client and request forwarding infrastructure: - Create RemoteDaemonClient for communicating with remote daemons over SSH tunnels (coast-daemon/src/remote/client.rs) - Add get_remote_route() to check project mode and tunnel status - Add ensure_synced() to flush Mutagen before remote operations - Add forward_streaming_to_remote() for proxying streaming responses - Modify handle_build_streaming() to route to remote when configured - Modify handle_run_streaming() to route to remote when configured Flow: CLI -> Local Daemon -> Check Mode -> Sync Flush -> Forward via SSH Tunnel -> Remote Daemon -> Proxy responses back Also includes Phase 2 fixes: - Fix get_sync_session method name in handlers - Fix truncate_str test assertion - Clean up unused imports
Add remote_name field to CoastInstance to track which remote an instance is running on. This enables routing exec and logs requests to the correct remote daemon based on instance location. Key changes: - Add remote_name: Option<String> to CoastInstance struct - Add DB migration for remote_name column in instances table - Add get_instance_remote_route() to look up instance's remote location - Add forward_to_remote() for non-streaming requests (exec, logs) - Add forward_logs_streaming_to_remote() for streaming logs - Modify handle_connection to route exec/logs based on instance location - Update forward_run_to_remote to create shadow instance records locally with remote_name set, enabling future exec/logs routing - Fix all test files to include remote_name: None field Phase 4 routes based on instance location (remote_name field), unlike Phase 3 which routes based on project mode.
feat: implement workspace sync with Mutagen (Phase 2)
Contributor
Author
|
for local testing https://github.com/VAIBHAVSING/coasts/blob/feat/remote-coasts-phase0/REMOTE_COAST_TEST.md but ubuntu vm is must as of now |
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.
No description provided.