feat(docker): Dockerfile, cloud server support, and parallel release pipeline#174
feat(docker): Dockerfile, cloud server support, and parallel release pipeline#174senamakel merged 6 commits intotinyhumansai:mainfrom
Conversation
Restructure release.yml into parallel build phases: build-desktop (matrix) and build-docker run concurrently after create-release. Docker image is pushed to GHCR and pull instructions are appended to release notes. publish-release now gates on both phases succeeding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds Docker build/runtime support and CI image publishing, a .dockerignore, a Dockerfile, CI workflow changes to build/push images, and server host configuration via CLI flag and environment variable; updates server start path to bind to configurable host and port. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (push tag)
participant GH as GitHub Actions
participant Build as Build Job
participant Docker as Docker daemon
participant GHCR as GHCR (Registry)
participant Release as GitHub Release
Dev->>GH: push tag / create release
GH->>Build: trigger `build-docker` job
Build->>Docker: build image from `Dockerfile`
Docker-->>Build: image (staging:<tag>)
Build->>GHCR: push `staging:<tag>` (with labels)
GHCR-->>Build: ack
GH->>Release: on success, `publish-release` promotes image to `:<tag>` and `:latest`
Release->>GHCR: tag/promo requests
GHCR-->>Release: image available
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Upstream commented out notify-discord; our branch has it as an active job earlier in the file. Drop the commented-out block from upstream. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/core/jsonrpc.rs (1)
426-446: Add debug/trace logging around bind resolution.This new host precedence (CLI vs env vs default) is only visible after a successful bind. A pre-bind debug log with the resolved host/port and source would make startup failures much easier to diagnose.
As per coding guidelines,
src/**/*.rs: Add substantial debug logging on new/changed flows using log/tracing at debug or trace level in Rust.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/jsonrpc.rs` around lines 426 - 446, Add a pre-bind debug/trace log in run_server that reports the resolved host and port and where each value came from (CLI arg, environment, or default) before creating bind_addr and calling TcpListener::bind; use the existing symbols core_port, core_host, host, port, and bind_addr to determine and log the source for each (e.g., host from CLI vs env vs default) at debug/trace level so startup bind resolution is visible prior to attempting the bind.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.env.example:
- Around line 26-27: The .env.example currently hardcodes
OPENHUMAN_CORE_HOST=127.0.0.1 which forces loopback when copied into .env;
update the example so it does not override the container default—either leave
OPENHUMAN_CORE_HOST unset (commented/empty) or set it to 0.0.0.0 and update the
inline comment accordingly; locate the OPENHUMAN_CORE_HOST entry and change the
value and comment so Docker users keep the image's 0.0.0.0 bind or can
explicitly set a host themselves.
In @.github/workflows/release.yml:
- Around line 790-800: The workflow currently pushes both the versioned tag and
latest in the build-docker job via docker/build-push-action, which can publish
images even if later jobs fail; change build-docker to push only a non-promoted
staging tag (e.g., ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
or a staging/${{ needs.prepare-release.outputs.tag }}) using the same
docker/build-push-action, and move the promotion to publish-release where you
retag and push the final versioned tag and latest (or use ghcr API to create the
final tags) after all steps succeed; alternatively, add a failure-path cleanup
step that deletes the GHCR images pushed by build-docker (use ghcr API or gh
cli) so incomplete releases don't leave public images.
In `@src/core/cli.rs`:
- Around line 74-78: The general help output in print_general_help() still shows
the old usage string missing the --host option; update the usage line printed by
print_general_help() to match the run subcommand usage (include "--host <addr>")
so the top-level `openhuman --help` and the `run --help` are consistent—locate
the print_general_help() function and modify its printed usage string to include
the `--host <addr>` token alongside existing `--port`, `--jsonrpc-only`, and
`--verbose`.
In `@src/core/jsonrpc.rs`:
- Around line 433-435: Replace the string join bind with a socket tuple so IPv6
works: stop building bind_addr with format!("{host}:{port}") and call
tokio::net::TcpListener::bind((host.as_str(), port)) (or equivalent) where the
current variables host, port, and listener are used; also add debug logging
before/after resolving host via core_host and before the bind to log the
resolved host and port and log the bind result/error (use the same processLogger
/ tracing logger used elsewhere) to aid diagnosing bind failures.
---
Nitpick comments:
In `@src/core/jsonrpc.rs`:
- Around line 426-446: Add a pre-bind debug/trace log in run_server that reports
the resolved host and port and where each value came from (CLI arg, environment,
or default) before creating bind_addr and calling TcpListener::bind; use the
existing symbols core_port, core_host, host, port, and bind_addr to determine
and log the source for each (e.g., host from CLI vs env vs default) at
debug/trace level so startup bind resolution is visible prior to attempting the
bind.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 816477b1-1b9d-4594-a22a-0ecacda58cf0
📒 Files selected for processing (6)
.dockerignore.env.example.github/workflows/release.ymlDockerfilesrc/core/cli.rssrc/core/jsonrpc.rs
- .env.example: comment out OPENHUMAN_CORE_HOST so Docker's 0.0.0.0 default isn't overridden when users copy the example file - cli.rs: add --host to print_general_help() usage line for consistency - jsonrpc.rs: use tuple bind (host, port) for IPv6 support, add debug logging with source tracking (CLI/env/default) before bind - release.yml: push only staging tag in build-docker, promote to versioned + latest in publish-release after all builds succeed; cleanup-failed-release deletes the staging image on failure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Dockerfilefor runningopenhuman-coreas a standalone JSON-RPC server on cloud devices (leandebian:bookworm-slimruntime image, non-root user, healthcheck)--hostCLI flag andOPENHUMAN_CORE_HOSTenv var so the server can bind to0.0.0.0(required for Docker/cloud — previously hardcoded to127.0.0.1)release.ymlinto parallel build phases:build-desktop(matrix) andbuild-docker(GHCR push) run concurrently aftercreate-release;publish-releasegates on both succeeding.dockerignoreto keep Docker build context smallChanges
Dockerfile.dockerignoresrc/core/cli.rs--host <addr>flag toopenhuman run/servesrc/core/jsonrpc.rsrun_server()accepts host param, falls back toOPENHUMAN_CORE_HOSTenv var.env.exampleOPENHUMAN_CORE_HOST.github/workflows/release.ymlTest plan
cargo checkpasses with host binding changesdocker build -t openhuman-core .completes successfullydocker run -p 7788:7788 openhuman-corestarts and responds on/healthopenhuman-core serve --host 0.0.0.0 --port 8080binds correctlyOPENHUMAN_CORE_HOST=0.0.0.0 openhuman-core servebinds correctly🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores