Skip to content

feat(sdk+cli): Go SDK, Unix socket IPC, scheduler support, client fixes#193

Merged
fgogolli merged 13 commits intomainfrom
fix/orb-go
Apr 8, 2026
Merged

feat(sdk+cli): Go SDK, Unix socket IPC, scheduler support, client fixes#193
fgogolli merged 13 commits intomainfrom
fix/orb-go

Conversation

@fgogolli
Copy link
Copy Markdown
Contributor

@fgogolli fgogolli commented Apr 6, 2026

Description

This PR delivers the Go SDK integration into the monorepo alongside a set of client compatibility fixes, installation improvements, and REST API enhancements.

Go SDK (sdk/go/)

The Go SDK is now part of the monorepo for atomic versioning and automatic sync with the Python API.

  • Unified versioninggo.mod at project root with module github.com/awslabs/open-resource-broker; customers use the same v1.x.y tag for both Python and Go:
    go get github.com/awslabs/open-resource-broker@v1.6.0
    import "github.com/awslabs/open-resource-broker/sdk/go/orb"
    
  • WithScheduler() — configures the scheduler type; appends --scheduler to the managed subprocess args so the ORB server formats responses accordingly
  • WithManagedProcess() via Unix socket — start ORB with --socket-path for clean IPC without port conflicts
  • Scheduler-aware response decoders — HF and default scheduler variants for all affected response types
  • Examplesexamples/basic, examples/managed_process, examples/scheduler
  • ogen integration//go:generate directive for auto-generating the client from openapi.json
  • Semantic release automation — exports openapi.json, updates version.go, tags vX.Y.Z on each release (shared with Python)

CLI fixes

  • --socket-pathorb system serve --socket-path /tmp/orb.sock enables Unix domain socket IPC
  • --scheduler wired to REST server — global flag now applied to the server's DI container
  • ANSI output fixrich_argparse now uses Console(color_system=None) when stderr is not a TTY; removes ANSI gibberish when ORB is run as a subprocess

Client compatibility fixes

  • providerApi default — templates without explicit providerApi now default to EC2Fleet via provider handler defaults (restores old symphony format support)
  • imageId not required with launchTemplateId — validation fixed in both base_handler.py and configuration_manager.py
  • External launch templates not deleted — onmoto test verifying externally-provided LTs are preserved when instances are released

Installation improvements

  • invoke_provider.sh — removed hardcoded USE_LOCAL_DEV=true and LOG_SCRIPTS=true; added ORB_VENV_PATH support
  • Non-root install — falls back to ~/.orb with clear error when /usr/orb is not writable
  • --scripts-dir for orb init — controls where scripts are placed
  • dev-tools/install/install.sh — automated install script with all flags and env var equivalents
  • docs/installation.md — complete env var reference, install scenarios, HF integration guide

REST API

  • Pydantic response models — all routers now have typed response_model= parameters, fixing empty schemas in openapi.json
  • Per-request X-ORB-Scheduler header — clients can specify scheduler format per-request

CI/CD

  • Workflow inline bash eliminated — all release logic moved to make sdk-go-export-spec and make sdk-go-update-version
  • Dependabot Go monitoring — added gomod entry for sdk/go/ dependency tracking
  • Race condition fixed — replaced sleep 5 with health polling loop in semantic-release

Type of Change

  • Bug fix
  • New feature
  • CI/CD or build process changes

How Has This Been Tested?

6500+ Python tests passing. Go SDK 24 tests passing (9 packages). Pyright 0 errors. Ruff clean.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Reviewers

@awslabs/orb-maintainers

@fgogolli fgogolli requested a review from a team as a code owner April 6, 2026 00:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Test Results Summary

6 417 tests  +23   6 332 ✅ +23   9m 14s ⏱️ -7s
    6 suites ± 0      85 💤 ± 0 
    6 files   ± 0       0 ❌ ± 0 

Results for commit b8ae233. ± Comparison against base commit 09c48c8.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

@kirillsc kirillsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fgogolli fgogolli changed the title feat(serve): add --socket-path support for Unix domain socket IPC fix(cli): fix ANSI escape codes in non-TTY output + add --socket-path for Unix socket IPC Apr 6, 2026
@fgogolli fgogolli changed the title fix(cli): fix ANSI escape codes in non-TTY output + add --socket-path for Unix socket IPC feat(sdk): add Go SDK to monorepo + fix --socket-path + fix ANSI output Apr 6, 2026
@fgogolli fgogolli changed the title feat(sdk): add Go SDK to monorepo + fix --socket-path + fix ANSI output fix+feat: Go SDK integration, client fixes, scheduler support, install improvements Apr 7, 2026
…n non-TTY contexts

- serve: add --socket-path argument to 'orb system serve' enabling
  programmatic callers to communicate via Unix domain socket
- serve: wire --scheduler global flag through to REST server DI container
- serve: log startup message before blocking, return 'Server stopped' after
- cli: fix ANSI escape codes leaking into non-TTY output — rich_argparse
  now uses Console(color_system=None) when stderr is not a TTY
- cli: remove StringIO stderr-capture hack that was re-emitting ANSI strings
- cli: wire --no-color flag via sys.argv check at import time
@fgogolli fgogolli changed the title fix+feat: Go SDK integration, client fixes, scheduler support, install improvements feat(sdk+cli): Go SDK, Unix socket IPC, scheduler support, client fixes Apr 7, 2026
fgogolli and others added 3 commits April 7, 2026 15:06
…er tests

- test_client_template_format.py: 12 onmoto tests verifying the client
  template format works correctly — launchTemplateId without imageId,
  no providerApi defaulting to EC2Fleet, field mapping, EC2Fleet spot
  provisioning with external launch template
- test_scheduler_header.py: 10 integration tests documenting the
  per-request X-ORB-Scheduler header feature — dependency-level tests
  verifying get_request_formatter and get_request_scheduler behaviour,
  plus a static analysis test that will fail when routes are wired
fgogolli added 9 commits April 8, 2026 10:44
- Add rich to pyright ignorePackages (fixes reportMissingImports in CI)
- Extract sdk-go-export-spec make target (workflow calls make, not inline bash)
- Fix mixed import style in test_scheduler_header.py (GH code quality bot)
- Replace sleep 5 race condition with health polling loop in semantic-release.yml
- Add error handling to sdk/go tag push step with recovery instructions
- Add gomod dependabot entry for sdk/go to track Go dependency updates
- Move go.mod from sdk/go/ to project root
- Set module name to github.com/awslabs/open-resource-broker
- Update all internal Go imports across sdk/go/
- Remove sdk/go tag step — v{VERSION} tag from python-semantic-release serves both
- Move sdk-go-update-version logic to make target
- Update dependabot gomod directory to /
- Update make targets to run from root (go test/build/generate ./sdk/go/...)

Customers can now use:
  go get github.com/awslabs/open-resource-broker@v1.6.0
  import "github.com/awslabs/open-resource-broker/sdk/go/orb"
After module rename, cross-package imports need sdk/go/ prefix
since source still lives under sdk/go/ in the repo.
@fgogolli fgogolli merged commit c4c4be2 into main Apr 8, 2026
80 checks passed
@fgogolli fgogolli deleted the fix/orb-go branch April 8, 2026 17:48
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.

2 participants