Skip to content

feat(sdk): add ContainerProvider and auto-deploy#254

Merged
retr0h merged 4 commits intomainfrom
feat/container-provider-deploy
Mar 12, 2026
Merged

feat(sdk): add ContainerProvider and auto-deploy#254
retr0h merged 4 commits intomainfrom
feat/container-provider-deploy

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Mar 12, 2026

  • ContainerProvider — New typed SDK wrapper (pkg/sdk/orchestrator/container_provider.go) that executes all provider operations (host, mem, load, disk, command, ping, DNS) inside Docker containers via the RuntimeTarget interface. Provides full type safety with Go generics (run[T]/runScalar[T] helpers).
  • Auto-deploy — DockerTarget.Prepare() automatically downloads the osapi binary from GitHub releases into the container on first ExecProvider call using sync.Once. Supports WithOSAPIBinaryURL for custom URLs and WithOSAPIBinarySkip when the binary is pre-baked into the image.
  • Platform detection refactor — Extracted platform detection from internal/agent/factory.go into a shared pkg/sdk/platform package so both the agent and SDK can reuse it.
  • Provider registry refactor — Moved buildProviderRegistry() from cmd/provider_run.go into its own file (cmd/provider_run_registry.go) and made NewParams optional for parameterless providers.
  • Example rewrite — Expanded container-targeting.go to exercise every read-only provider, command exec, error handling, and a deliberately-failing task.

@github-actions
Copy link
Contributor

Thank you for contributing to this project! 😊🕹️

retr0h and others added 3 commits March 12, 2026 10:53
Add typed ContainerProvider that wraps RuntimeTarget to execute
provider operations inside Docker containers with full type
safety. Automatically deploys the osapi binary into containers
from GitHub releases on first use via Prepare/sync.Once.

Also extracts platform detection into pkg/sdk/platform and
refactors the provider registry into its own file.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
JIRA: None
Co-Authored-By: Claude <noreply@anthropic.com>
JIRA: None
Co-Authored-By: Claude <noreply@anthropic.com>
JIRA: None
@retr0h retr0h force-pushed the feat/container-provider-deploy branch from b462701 to fb18455 Compare March 12, 2026 16:53
@retr0h retr0h changed the title Feat/container provider deploy feat(sdk): add ContainerProvider and auto-deploy Mar 12, 2026
Wrap defer resp.Body.Close() to explicitly discard
the error return value, satisfying errcheck linter.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h merged commit 663801e into main Mar 12, 2026
7 checks passed
@retr0h retr0h deleted the feat/container-provider-deploy branch March 12, 2026 19:57
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #254    +/-   ##
========================================
  Coverage   99.94%   99.94%            
========================================
  Files         224      227     +3     
  Lines        9431     9587   +156     
========================================
+ Hits         9426     9582   +156     
  Misses          3        3            
  Partials        2        2            
Files with missing lines Coverage Δ
internal/agent/factory.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/container_provider.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/deploy.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/docker_target.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/options.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/plan.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/plan_in.go 100.00% <100.00%> (ø)
pkg/sdk/platform/platform.go 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9518a4b...6692056. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant