Skip to content

Conversation

@kecunning
Copy link

@kecunning kecunning commented Jan 7, 2026

Jira Issue ID

TRADE-738

Description

These are the updates for deploying CASPER service in UAT Harmony environment. Included are the addition of the CASPER services and 4 CASPER service chains: sambah-casper, hoss-casper, l2-subsetter-casper, l2-subsetter-consice-casper. The chains are detailed in the attached word [doc.](CASPER chain Descriptions.docx)

Local Test Steps

Submit harmony requests for sambah, hoss, l2-subsetter and l2-subsetter-consice, and add "format = 'text/csv'" as a parameter in the request like:
request = Request(
collection=collection,
spatial = BBox(-114.42214, 29.72474,-62.2058, 40.6032),
max_results = 2,
extend = "mirror_step",
concatenate = True,
format = 'text/csv',
)

The addition of format = 'text/csv' selects a CASPER chain.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested (if changes made to microservices or new dependencies added)

Summary by CodeRabbit

  • New Features

    • Added a Casper-based public service and integrated Casper into L2/subsetter chains to produce CSV outputs on demand.
  • Documentation

    • Updated chain and public-facing docs to note conditional Casper usage when CSV output is requested.
  • Chores

    • Added Casper runtime configuration (image, resources, invocation args, queue) and registered the service; added default timeout for Casper.
  • Tests

    • Updated version checks to include the new Casper service.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

Adds a new public Casper-backed service asdc/casper, injects conditional CASPER processing into existing chains for text/csv outputs, adds Casper environment defaults and queue URL, updates a default timeout for the work-failer, and updates a test to include the new service.

Changes

Cohort / File(s) Summary
Public service config
config/services-uat.yml
Added public service asdc/casper (name asdc/casper, data_operation_version 0.22.0, STAGING_PATH public/harmony/asdc/casper) and appended conditional CASPER_IMAGE step to l2-subsetter-batchee-stitchee-concise; updated output_formats to include text/csv and updated chain documentation.
Environment defaults
packages/util/env-defaults, services/harmony/env-defaults
Added Casper environment variables: CASPER_IMAGE, CASPER_REQUESTS_MEMORY, CASPER_LIMITS_MEMORY, CASPER_INVOCATION_ARGS, and CASPER_SERVICE_QUEUE_URLS.
Service/runtime behavior
services/work-failer/app/workers/failer.ts
Added default timeout mapping entry for casper (900 seconds).
Service model/runtime validation
services/harmony/app/models/services/base-service.ts, services/harmony/app/models/services/index.ts
Defensive handling for potentially undefined operation.outputFormat in stepRequired; skip empty-string conditional formats in validateServiceConfigSteps.
Tests
services/harmony/test/versions.ts
Updated test expectation to include asdc/casper in returned service names.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant Harmony as Harmony
  participant CMR as QUERY_CMR_IMAGE
  participant Provider as Provider_Image
  participant Casper as CASPER_IMAGE
  participant Storage as Storage

  Client->>Harmony: Submit job (service: asdc/casper or request output_format=text/csv)
  Harmony->>CMR: QUERY_CMR_IMAGE (discover inputs)
  CMR-->>Harmony: image list / metadata
  Harmony->>Provider: Invoke provider image(s) processing
  Provider-->>Harmony: produce artifact(s)
  alt output_format == text/csv
    Harmony->>Casper: Invoke CASPER_IMAGE (NetCDF → CSV conversion/concat)
    Casper-->>Storage: write final CSV
  else other formats
    Harmony->>Storage: write final artifact(s)
  end
  Storage-->>Client: deliver/notify completed output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • indiejames
  • ygliuvt

🐰 Casper hops into the queue with cheer,
NetCDF to CSV — I nibble near,
Steps stitched, configs set just right,
A tidy file through day and night,
I twitch my nose: the output's clear!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: deploying CASPER service to UAT environment with specific configuration updates.
Description check ✅ Passed The description includes all required template sections with substantive content: Jira ID, clear description of CASPER deployment, detailed local test steps, and PR acceptance checklist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @config/services-uat.yml:
- Around line 302-304: The service description for l2-subsetter-concise-casper
contains typos; update the description string (the value for the description key
in the l2-subsetter-concise-casper service block) to read "Service that converts
a NetCDF file to one or more CSV files." so "and" → "a" and "CVS" → "CSV".
- Around line 225-227: Fix the typos in the service description for the entry
with name "l2-subsetter-casper": update the description field to read "Service
that converts a NetCDF file to one or more CSV files." so "and NetCDF" becomes
"a NetCDF" and "CVS files" becomes "CSV files."
- Around line 51-75: The asdc-casper service is incomplete: update the
description to "Service that converts a NetCDF file to one or more CVS files",
bump data_operation_version from '0.18.0' to '0.22.0', and add the missing
CASPER step to the steps list by appending an entry invoking ${CASPER_IMAGE}
(e.g., a step with image: !Env ${CASPER_IMAGE} and is_sequential: true) after
the existing QUERY_CMR_IMAGE step so the service matches other -casper chains.
🧹 Nitpick comments (2)
config/services-uat.yml (2)

572-574: Consider adding a more descriptive service description.

The description "HOSS-casper" is minimal compared to other services. Consider adding a description similar to sds/HOSS-geographic but noting the CSV output capability, e.g., "A service chain combining HOSS geographic subsetting with CASPER CSV conversion."


757-759: Consider adding a more descriptive service description.

Similar to HOSS-casper, the description "sambah-casper" is minimal. Consider referencing the full SAMBAH chain description or noting that this is the SAMBAH chain with CSV output via CASPER.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c88deaa and d914afd.

📒 Files selected for processing (4)
  • config/services-uat.yml
  • packages/util/env-defaults
  • services/harmony/env-defaults
  • services/harmony/test/versions.ts
🔇 Additional comments (3)
services/harmony/test/versions.ts (1)

27-48: LGTM!

The test expectations correctly include all five new Casper service variants that are defined in config/services-uat.yml. The service names match exactly and their positions in the array reflect the order defined in the YAML configuration.

services/harmony/env-defaults (1)

570-574: Verify image source and consider adding CPU resource limits.

Two observations:

  1. The image is sourced from a personal GitHub account (ghcr.io/kecunning/casper) rather than an organization like ghcr.io/nasa/ or ghcr.io/podaac/. Is this intentional for UAT testing, or should it be moved to an official repository before deployment?

  2. Most other backend services define *_REQUESTS_CPU and *_LIMITS_CPU variables (e.g., HYBIG_REQUESTS_CPU, HYBIG_LIMITS_CPU). Consider adding these for CASPER for consistency and to ensure proper resource allocation in Kubernetes.

Suggested additions for CPU resources
 CASPER_IMAGE=ghcr.io/kecunning/casper:0.1.0
+CASPER_REQUESTS_CPU=128m
+CASPER_LIMITS_CPU=128m
 CASPER_REQUESTS_MEMORY=1Gi
 CASPER_LIMITS_MEMORY=5Gi
 CASPER_INVOCATION_ARGS='./docker-entrypoint.sh'
packages/util/env-defaults (1)

132-132: LGTM!

The CASPER_SERVICE_QUEUE_URLS follows the established pattern for service queue URL definitions. The image reference and FIFO queue naming convention are consistent with other services in this file.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @config/services-uat.yml:
- Around line 572-574: The service entry for "HOSS-casper" has a too-brief
description; replace the current description value with a short paragraph that
explains what HOSS-casper does (e.g., conversions/transformations performed),
the expected input and output formats and data types, and its key capabilities
(supported collections, subsetting types, and operations). Use the existing
"HOSS-geographic" entry as a model: mention supported collections or sources,
primary processing steps, accepted input schemas and output formats, and any
notable limitations or implementation details so the description is actionable
for operators and integrators.
- Around line 757-759: Replace the minimal description for the service named
"sambah-casper" with a detailed multi-sentence description that: outlines the
full SAMBAH service chain (L2-subsetter → Batchee → STITCHEE → CONCISE →
CASPER), briefly explains the purpose of each component (e.g., L2-subsetter
filters inputs, Batchee groups/segments, STITCHEE stitches/aligns, CONCISE
compresses/summarizes, CASPER performs final processing/validation), specifies
expected input and output formats for this service (schemas, file types, or
payload structure), and lists key capabilities and supported operations (batch
sizes, transforms, validation rules, and error behaviors) so readers can
understand how "sambah-casper" fits into and interacts with the parent service
"l2-subsetter-batchee-stitchee-concise".
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d914afd and 7812b03.

📒 Files selected for processing (1)
  • config/services-uat.yml

Copy link
Contributor

@chris-durbin chris-durbin left a comment

Choose a reason for hiding this comment

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

It's probably worth having a discussion on whether we want to just add a conditional CASPER step to existing chains instead of creating several new chains.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@config/services-uat.yml`:
- Around line 612-615: Update the ASDC CASPER service description in
config/services-uat.yml to correct two typos: change "outputing" to "outputting"
in the sentence describing conversion to CSV, and change "Outputs csv" to
"Outputs CSV" to match capitalization/consistency; locate and edit the ASDC
CASPER service block where those phrases appear.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7812b03 and e182d67.

📒 Files selected for processing (2)
  • config/services-uat.yml
  • services/harmony/test/versions.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/harmony/test/versions.ts
🔇 Additional comments (4)
config/services-uat.yml (4)

51-78: LGTM! Previous review issues have been addressed.

The service now correctly includes the CASPER step, uses the updated data_operation_version: '0.22.0', and the description typos have been fixed.

Minor observation: The conditional format: ['text/csv'] on the CASPER step (lines 76-77) is technically redundant since text/csv is the only supported output format. This is harmless but could be simplified.


227-227: No concerns with whitespace changes.


663-666: Verify if always_wait_for_prior_step is needed for the CASPER step.

The previous review raised a question about whether CASPER is an aggregation service. If CASPER is intended to convert the final concatenated output from CONCISE to CSV, it may need always_wait_for_prior_step: true to ensure it receives the fully concatenated file rather than intermediate outputs.

If CASPER operates on individual files independently (not aggregating), then the current configuration without always_wait_for_prior_step is correct.

Could you clarify CASPER's processing model? If it should only process the final concatenated output when concatenation is requested, consider:

       - image: !Env ${CASPER_IMAGE}
+        always_wait_for_prior_step: true
         conditional:
           format: ['text/csv']

637-637: LGTM! Output format addition enables CASPER chain selection.

Adding text/csv to output_formats correctly advertises this capability and allows users to trigger the CASPER step by requesting CSV output.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

…ult. In the SAMBAH chain do not call concise first before casper - only call concise for netcdf4 output requests and casper for csv outputs.
Copy link
Contributor

@chris-durbin chris-durbin left a comment

Choose a reason for hiding this comment

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

Tested successfully in a harmony sandbox environment.

@chris-durbin chris-durbin merged commit ce3cd37 into nasa:main Jan 21, 2026
5 checks passed
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.

5 participants