Skip to content

Commit

Permalink
debug href translation #1031
Browse files Browse the repository at this point in the history
  • Loading branch information
bossie committed Feb 3, 2025
1 parent 88b5a32 commit 73e4a6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openeogeotrellis/deploy/batch_job_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,20 @@ def _convert_job_metadatafile_outputs_to_s3_urls(metadata_file: Path):

def _convert_asset_outputs_to_s3_urls(job_metadata: dict):
"""Convert each asset's output_dir value to a URL on S3 in the metadata dictionary."""

def log_asset_hrefs(context: str):
asset_hrefs = {asset_key: asset.get("href") for asset_key, asset in job_metadata.get("assets", {}).items()}
logger.info(f"{context} asset hrefs: {asset_hrefs!r}")

log_asset_hrefs("input")

out_assets = job_metadata.get("assets", {})
for asset in out_assets.values():
if "href" in asset and not asset["href"].startswith("s3://"):
asset["href"] = to_s3_url(asset["href"])

log_asset_hrefs("output")


def _transform_stac_metadata(job_dir: Path):
def relativize(assets: dict) -> dict:
Expand Down

0 comments on commit 73e4a6d

Please sign in to comment.