nasa/harmony

Harmony only returns a link for one asset when a backend service produces multiple

frankinspace opened this issue · 1 comments

Environment
Harmony-in-a-box, Harmony UAT, Harmony OPS

Steps to Reproduce
In UAT

  1. http://{{harmony_host}}/C1238621141-POCLOUD/ogc-api-coverages/1.0.0/collections/analysed_sst/coverage/rangeset?width=36000&height=17999&format=image/png&granuleId=G1240564967-POCLOUD&forceAsync=true&turbo=true
  2. Wait for job to complete
  3. http://{{harmony_host}}/jobs/{{job_id}}

Expected Result

Job result should contain at least two links: one for the png file and one for the wld file.

Actual Result

Job result only contains link to png file.

Details

The asfgdal service has been updated to stage a wld file and return it as an additional asset in the item entry for a granule:
https://github.com/asfadmin/asf-harmony-gdal/blob/ea28edd81ad64f0e1a3edabed693120ab9a79113/gdal_subsetter/transform.py#L216-L228

There is a unit test that verifies the catalog returned from the service contains two items:
https://github.com/asfadmin/asf-harmony-gdal/blob/ea28edd81ad64f0e1a3edabed693120ab9a79113/tests/test_transform_no_download.py#L68-L70

When running harmony locally, I was able to extract the item.json produced as output from the harmony adapter itself, which also shows the two assets:

{
    "type": "Feature",
    "stac_version": "1.0.0-beta.2",
    "id": "d9874dac-59e5-424e-b346-9a6a62d2627c",
    "properties": {
        "start_datetime": "2021-04-29T21:00:00.000Z",
        "end_datetime": "2021-04-30T21:00:00.000Z",
        "datetime": null
    },
    "geometry": {"type":"Polygon","coordinates":[[[-179.9950055,-89.9949985],[-179.9950055,89.9949979],[-179.9949983,89.9949979],[-179.9949983,-89.9949985],[-179.9950055,-89.9949985]]]    },
    "links": [
        {
            "rel": "root",
            "href": "../catalog.json",
            "type": "application/json"
        },
        {
            "rel": "parent",
            "href": "../catalog.json",
            "type": "application/json"
        }
    ],
    "assets": {
        "data": {
            "href": "s3://local-staging-bucket/public/asfdataservices/gdal-subsetter/e07cb268-1cef-4bd1-90db-25bcab327506/20210430090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1_analysed_sst_regridded.png",
            "type": "image/png",
            "title": "20210430090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1_analysed_sst_regridded.png",
            "roles": ["data"]
        },
        "metadata": {
            "href": "s3://local-staging-bucket/public/asfdataservices/gdal-subsetter/e07cb268-1cef-4bd1-90db-25bcab327506/20210430090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1_analysed_sst_regridded.wld",
            "type": "text/plain",
            "title": "20210430090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1_analysed_sst_regridded.wld",
            "roles": ["metadata"]
        }
    },
    "bbox": [-179.9950055,-89.9949985,-179.9949983,89.9949979],
    "stac_extensions": []
}