terra-scientific-pipelines-service("Teaspoons") is a Spring Boot service that runs Terra scientific pipelines users cannot run directly (often due to protected reference data).- Gradle multi-module layout (
settings.gradle):service(runtime API),client(generated Java client),rawls-client(generated Rawls SDK),python-client(generated thin Python client), plus scripts. - API contract lives in
common/openapi.yml; server/client code is generated from it via openapi-generator (service/openapi.gradle,client/openapi.gradle,python-client/teaspoons-client.gradle; the Rawls SDK usesrawls-client/openapi.gradle). The plugin version is centralized insettings.gradlepluginManagement.
- Entry point:
service/src/main/java/bio/terra/pipelines/App.java; component scan pulls in TCL (Stairway, IAM, tracing, migrate) andbio.terra.pipelines. - Pipeline execution is intentionally two-phase:
preparethenstart(PipelineRunsApiController+PipelineRunsService). preparevalidates inputs/quota, checks cloud input access, writespipeline_runs+pipeline_inputs, and may return signed upload URLs.startrequiresPREPARINGstate, then submits a Stairway flight (RunWdlBasedPipelineJobFlightv20260428) that orchestrates Rawls/Cromwell steps (quota run -> input QC -> main workflow -> outputs).- Success path writes outputs + quota to DB; failure path is handled via Stairway hooks/mark-failed logic (
service/IMPLEMENTATION_NOTES.md). - Output delivery is a separate Stairway flight (
DeliverDataToGcsFlightv20260409): create delivery record -> copy outputs -> mark success -> best-effort source cleanup.
- DB schema is Liquibase-managed from
service/src/main/resources/db/changelog.xml; add new changesets, do not rewrite historical ones. PipelineRun(service/src/main/java/bio/terra/pipelines/db/entities/PipelineRun.java) is source of truth for user-visible run status; Stairway job metadata can expire.
- Sam (
service/src/main/java/bio/terra/pipelines/dependencies/sam/SamService.java): authn/authz, admin checks, user pet SA tokens, proxy group lookup. - Rawls (
service/src/main/java/bio/terra/pipelines/dependencies/rawls/RawlsService.java): workspace metadata, method config validation/update, entity writes, submission status polling. - GCS (
service/src/main/java/bio/terra/pipelines/dependencies/gcs/GcsService.java): signed URL generation, IAM permission probes, copy/delete, requester-pays detection. - Notifications (
service/src/main/java/bio/terra/pipelines/notifications/NotificationService.java): publishes Pub/Sub messages for Thurloe-backed emails using templates innotification-templates/.
- Flight versioning is strict: breaking Flight changes require new dated package
vYYYYMMDD; keep old versions until no flights are in progress (service/src/main/java/bio/terra/pipelines/stairway/flights/README.md). - New pipelines must be wired in multiple places:
PipelinesEnum,pipelines-config.yml, DB seed/config rows, andPipelineRunsService.startPipelineRunswitch. - Keep generated sources out of manual edits (
service/build/openapi-code,client/build/openapi-code,rawls-client/build/openapi-code,python-client/generated). Editcommon/openapi.ymlor generator configs instead. - Database interactions use spring framework CRUD repositories (
service/src/main/java/bio/terra/pipelines/db/repositories/); avoid direct JDBC or JPA queries unless necessary for performance or complex transactions.
- Use IDE tools (e.g.
read_file) rather than command linegrepto find usages of classes/methods. - Any change that affects API contract, pipeline definition schema, or runtime behavior must be accompanied by unit/integration tests that validate the new behavior and guard against regressions. We require 80%+ coverage for new code paths.