Skip to content

Add sibling-container runtime manager and shell APIs#8

Merged
guilyx merged 11 commits intomainfrom
feat/persistent-shell-session
Mar 1, 2026
Merged

Add sibling-container runtime manager and shell APIs#8
guilyx merged 11 commits intomainfrom
feat/persistent-shell-session

Conversation

@guilyx
Copy link
Contributor

@guilyx guilyx commented Mar 1, 2026

Summary

  • add a Bollard-based sibling container runtime manager in otter-core
  • expose runtime status/start/stop/restart/log and websocket shell endpoints in otter-server
  • route workspace command execution through runtime exec when runtime is enabled, with persistent shell session cwd

Test plan

  • cargo fmt
  • cargo clippy --workspace --all-targets --all-features (blocked locally by existing lockfile v4 toolchain mismatch)
  • run runtime endpoints against docker socket mounted environment
  • enqueue a job and verify runtime_container_ready event with preview URL

guilyx added 11 commits March 2, 2026 01:02
Introduce a Bollard-backed runtime layer for workspace containers, expose runtime lifecycle/log/shell websocket endpoints, and route workspace command execution through runtime exec with persistent shell sessions.
- use ContainerStateStatusEnum enum match instead of as_str()
- pass working_dir as Option<&str> directly to CreateExecOptions
- add output_capacity field to StartExecOptions
- convert body stream to hyper::Body via .into() for build_image
- add hyper workspace dependency
- replace stream::once + into() with direct hyper::Body::from()
- simplifies tar context body construction for Bollard build_image API
Import Body from hyper::body::Body instead of hyper::Body for hyper 1.x compatibility.
Replace hyper Body trait with concrete Full<Bytes> type for Bollard build_image compatibility with hyper 1.x ecosystem.
- Bump bollard 0.18 → 0.20.1 in workspace Cargo.toml
- Drop now-unnecessary http-body-util and hyper workspace deps
- Migrate docker_manager.rs to 0.20.1 API surface:
  - ContainerConfig<T> → ContainerCreateBody (bollard::models)
  - All option structs use query_parameters::*OptionsBuilder
  - StartContainerOptions<String> → StartContainerOptions (no generic)
  - StartExecOptions struct literal → None::<StartExecOptions> (default non-detach)
  - build_image body uses bollard::body_full(Bytes) instead of http_body_util::Full
  - BuildImageOptions struct literal → BuildImageOptionsBuilder
  - Remove platform field from CreateContainerOptions (dropped in 0.20)
- InspectContainerOptions and StartContainerOptions moved to
  bollard::query_parameters — update import paths
- LogsOptionsBuilder::tail() now takes &str — borrow the String
- BuildInfo::error field renamed to error_detail (ErrorDetail struct)
  — unwrap message from error_detail for human-readable error output
axum 0.8 changed Message::Text to wrap Utf8Bytes instead of String.
Add .into() conversions at both send sites and remove the now-unused
SinkExt import.
Add per-job preview URL registration endpoint and include preview_url/is_paused in job models. Introduce queue pause/resume semantics so paused queued jobs stay in queue but are not claimable until resumed, with resume re-enqueue behavior.

Also improve runtime reliability by auto-recovering shell exec on missing/stopped containers and using a Docker client API version floor compatible with newer daemons. Update Otter runtime image to install modern Docker CLI/buildx/compose tooling from Docker's official apt repository.
Document preview URL registration, pause/resume queue controls, and updated execution flow including job callback contract and runtime shell behavior.
Update Cargo.lock to capture the current runtime dependency graph after Bollard upgrade work, and apply clippy/format-driven cleanups in runtime service and docker manager code paths.
@guilyx guilyx merged commit da739c4 into main Mar 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant