fix(examples): use proper image and align with SDK conventions#118
fix(examples): use proper image and align with SDK conventions#118mp-orkes wants to merge 5 commits into
Conversation
…var with SDK The Quick Start in examples/README.md and ~790 docker-compose.yml files referenced orkesio/orkes-conductor-standalone:1.2.3, which is a private Orkes commercial image on GHCR (anonymous pulls return 401). Swap to the public conductoross/conductor:3.22.3 (newest GA on Docker Hub, server + UI bundled, same internal port 5000 for the UI). Rename CONDUCTOR_BASE_URL to CONDUCTOR_SERVER_URL across the helper, run.sh, docker-compose.yml, RUNNING.md and PRODUCTION.md docs so the example env var name matches the Conductor Java SDK convention (ConductorClient.Builder.applyEnvVariables reads CONDUCTOR_SERVER_URL). Users who graduate from the example helper to direct SDK usage no longer trip on a renamed variable. Verified locally by docker-building examples/basics/hello-world and running it end-to-end against conductoross/conductor:3.22.3 — workflow completes, UI reachable on the mapped port. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
…(true) Drop the per-helper CONDUCTOR_SERVER_URL static field across 790 ConductorClientHelper.java files and call .useEnvVariables(true) on the SDK builder instead. The SDK already reads CONDUCTOR_SERVER_URL in ConductorClient.Builder.applyEnvVariables(); duplicating that logic in each example was redundant. Side effects: - The localhost fallback is gone. CONDUCTOR_SERVER_URL must now be set (run.sh and docker-compose.yml already do this in every example). Running the bare jar with no env now throws a clear RuntimeException from the SDK: "env variable CONDUCTOR_SERVER_URL is not set". - examples/basics/docker-setup and examples/task-patterns/chaining-http-tasks exposed a getServerUrl() helper that returned the now-removed constant. Both now return client.getBasePath() (instance method); docker-setup's Example main was reordered to instantiate the helper before the health check probe. - examples/basics/orkes-cloud intentionally left unchanged — its helper has a dual-mode (local + cloud) design with custom auth and explicit serverUrl/keyId/keySecret constructor. Verified by docker-building and running hello-world, docker-setup, and chaining-http-tasks end-to-end against conductoross/conductor:3.22.3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch from the latest GA (3.22.3) to the newest 3.30.0 release candidate. Smoke-tested locally: container healthy, UI bundled on internal port 5000 unchanged, hello-world end-to-end completes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace bare 'mvn package' in every example's run.sh with a one-shot 'docker run ... maven:3.9-eclipse-temurin-21 mvn ...' invocation that bind-mounts the example directory and ~/.m2 for the dep cache. Docker was already a stated prerequisite (RUNNING.md:9); host Maven no longer needs to be installed at all. No mvnw wrapper artifacts added to the repo. Verified locally: hello-world builds in ~2s with a warm ~/.m2 cache and runs end-to-end against conductoross/conductor:3.30.0.rc12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| public class ConductorClientHelper { | ||
|
|
||
| private static final String CONDUCTOR_SERVER_URL = | ||
| System.getenv("CONDUCTOR_BASE_URL") != null |
There was a problem hiding this comment.
Not the env var name our SDKs use. Aligning on CONDUCTOR_SERVER_URL to follow the SDK convention
| public ConductorClientHelper() { | ||
| this.client = ConductorClient.builder() | ||
| .basePath(CONDUCTOR_SERVER_URL) | ||
| .useEnvVariables(true) |
There was a problem hiding this comment.
Reads the server URL (and Orkes auth keys, if present) from the SDK's standard env vars: CONDUCTOR_SERVER_URL.
This was shown in several examples.
| @@ -1,6 +1,6 @@ | |||
| services: | |||
| conductor: | |||
| image: orkesio/orkes-conductor-standalone:1.2.3 | |||
There was a problem hiding this comment.
:1.2.3 tag doesn't exist in our private registry. It was made up. So this was broken for everyone
| echo "Conductor is running at $CONDUCTOR_SERVER_URL" | ||
| echo "Building and running the example..." | ||
| echo "" | ||
| mvn -q package -DskipTests 2>/dev/null || mvn package -DskipTests |
There was a problem hiding this comment.
Requiring a Maven install adds friction. That's exactly why build-tool wrappers (Gradle's gradlew, Maven's mvnw) exist.
Side question: What was the motivation to use Maven? (we've been using Gradle in most of our projects)
| echo "" | ||
| mvn -q package -DskipTests 2>/dev/null || mvn package -DskipTests | ||
| CONDUCTOR_BASE_URL="$CONDUCTOR_BASE_URL" java -jar target/aggregator-pattern-1.0.0.jar "$@" | ||
| docker run --rm -v "$PWD":/work -v "$HOME/.m2":/root/.m2 -w /work maven:3.9-eclipse-temurin-21 mvn -q package -DskipTests 2>/dev/null || docker run --rm -v "$PWD":/work -v "$HOME/.m2":/root/.m2 -w /work maven:3.9-eclipse-temurin-21 mvn package -DskipTests |
There was a problem hiding this comment.
Building via Docker since it's already required by the examples anyway.
Flagging that this contradicts our previous decision to keep Docker out of our examples. Assuming that's no longer our stance.
Switch from a pinned 3.30.0.rc12 to the floating :latest tag for all example image references (READMEs, RUNNING.md, docker-compose files, helper console output). Production code should pin a digest or version, but examples follow whatever GA the upstream image currently points :latest at, which keeps demos current without periodic PR churn. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
What
orkesio/orkes-conductor-standalone:1.2.3(doesn't exist) withconductoross/conductor:latest. Pinning to a fixed version would be the best practice, but since these are examples I'm using:latestso demos stay current without periodic PRs.CONDUCTOR_BASE_URL→CONDUCTOR_SERVER_URLeverywhere (helper,run.sh,docker-compose.yml,RUNNING.md,PRODUCTION.mddocs). Matches the SDK convention.ConductorClientHelper.javano longer carries a staticCONDUCTOR_SERVER_URLfield with its own ternary fallback. The builder calls.useEnvVariables(true), which the SDK already implements inConductorClient.Builder.applyEnvVariables()— that method readsCONDUCTOR_SERVER_URLfrom the environment.run.sh:run.shnow invokes Maven inside amaven:3.9-eclipse-temurin-21container (bind-mounting the example directory and~/.m2) instead of calling hostmvn. Nomvnwfiles added to the repo.Why
examples/README.mdanddocker runinexamples/RUNNING.mdreferenced an image that doesn't exist.Behavior changes
CONDUCTOR_SERVER_URLis now required when running the bare jar. The old helper fell back tohttp://localhost:8080/api; the SDK throwsRuntimeException("env variable CONDUCTOR_SERVER_URL is not set")instead.run.shand everydocker-compose.ymlalready set the var, so the documented happy paths are unaffected.examples/basics/docker-setupandexamples/task-patterns/chaining-http-tasksexposed agetServerUrl()helper that returned the now-deleted constant. Both now returnclient.getBasePath()(instance method); thedocker-setupExample main was reordered to instantiate the helper before the health-check probe.examples/basics/orkes-cloudleft untouched — its helper has a dual-mode (local + cloud) design with custom header-supplier auth and explicit(serverUrl, keyId, keySecret)constructor that doesn't fit theuseEnvVariablespattern.How to test