Class PipelineJobReporter
java.lang.Object
ubic.gemma.cli.pipeline.PipelineJobReporter
Reports CLI progress to the Gemma pipeline framework when this process was
launched as a child of a pipeline job. Three environment variables wire the
contract:
GEMMA_JOB_ID— Gemma-side job id (thePipelineJob.id); enables reporting when present, no-op when absent.GEMMA_PIPELINE_CALLBACK_URL— base URL of gemma-rest's internal callback endpoint (e.g.https://gemma.example.com/rest/v2/internal/pipeline).GEMMA_PIPELINE_CALLBACK_TOKEN— shared bearer secret for the internal endpoint. Resolve from a secrets store before launching the CLI; never bake into a script.
When GEMMA_JOB_ID is unset the reporter is a no-op singleton
(NOOP) — standalone CLI invocations remain unaffected.
Failures to reach the callback endpoint are logged at WARN but never propagate — the pipeline framework's reconciler poll loop will eventually close gaps from missed pushes, so a transient network failure shouldn't fail the underlying CLI work.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidTerminal success.voidTerminal failure.static PipelineJobReporterfromEnv()Resolve a reporter from the process environment.booleanisActive()voidTerminal cancelled.voidReport a progress sample.voidReport a stage boundary (e.g.
-
Field Details
-
NOOP
-
-
Method Details
-
fromEnv
Resolve a reporter from the process environment. ReturnsNOOPwhenGEMMA_JOB_IDis absent — standalone CLI invocations get a no-op reporter without any conditionals at call sites. -
isActive
public boolean isActive() -
stage
Report a stage boundary (e.g."loading-vectors","running-anova"). Service-side this transitions QUEUED → RUNNING on first arrival. Non-terminal: fire-and-forget. -
progress
-
completed
public void completed()Terminal success. Sync-wait so the event reaches the server before the JVM exits. Caller should not emit any further events after this. -
error
Terminal failure. Sync-wait so the event reaches the server before the JVM exits. Caller should not emit any further events after this. -
killed
Terminal cancelled. Sync-wait so the event reaches the server before the JVM exits. Use when the CLI catches an interrupt + wants to report cooperative shutdown.
-