Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4173ca5
Convert existing register-job to cwltool executor repo
sujen1412 Apr 14, 2025
cf1ba55
Add github workflow to build and push docker image
sujen1412 Apr 14, 2025
9781a9f
Remove extra argument from docker login action
sujen1412 Apr 14, 2025
c299a0c
Lowercase repo name
sujen1412 Apr 14, 2025
0f22347
Lowercase namespace
sujen1412 Apr 14, 2025
8c2d426
Lowercase namespace
sujen1412 Apr 15, 2025
5c44418
Import and use docker buildx action
sujen1412 Apr 15, 2025
f94865c
Install docker cli in cwl image
sujen1412 Apr 15, 2025
29dd403
Add workflow_dispatch trigger
sujen1412 Apr 15, 2025
07ec803
Update Dockerfile to install PyYAML
sujen1412 Apr 17, 2025
2cb1371
Install awscli and copy remote CWL file
sujen1412 Apr 17, 2025
163e535
Add code to stage in assets from an item json file
sujen1412 Apr 29, 2025
30d6663
Update create inputs to stage in assets and create workflow inputs
sujen1412 Apr 29, 2025
2bf933e
Correctly create the URI for input file
sujen1412 Apr 29, 2025
e5dc73d
Download the CWL file before creating inputs
sujen1412 Apr 29, 2025
ff774a4
COPY all files from context to /app
sujen1412 Apr 29, 2025
90bc718
Fix permissions
sujen1412 Apr 30, 2025
279f4bd
Load the item json from url dont depend on osaka
sujen1412 Apr 30, 2025
a215892
Correctly call the create inputs function
sujen1412 Apr 30, 2025
b0d8381
Update typo in multi-line call
sujen1412 Apr 30, 2025
039a773
Use relative paths in asset href
sujen1412 Apr 30, 2025
68ed016
Correct asset download path
sujen1412 May 6, 2025
645cd90
Disable color on cwl output
sujen1412 Aug 17, 2025
2c7fef5
Add new deps
sujen1412 Aug 17, 2025
14612f4
Preserve MAAP_API_HOST in cwltool command
sujen1412 Dec 5, 2025
9888a61
Resolve merge conflict: keep remote cwltool options
sujen1412 Dec 16, 2025
938f579
fix: correct CWL input type mapping for primitive types
sujen1412 Jan 29, 2026
44b29fa
Use an optimized docker image
sujen1412 Jan 29, 2026
e301a4b
disable colored output
sujen1412 Jan 29, 2026
c7507a9
feat: CWL stage out
wphyojpl Feb 25, 2026
a948e71
Remove --no-match-user to run as same user as host
sujen1412 Feb 25, 2026
70ebf33
feat: Add FeatureCollection (STAC Collection) support to stage_in
sujen1412 Feb 26, 2026
7f2d32f
Save last 20 lines from stderr
sujen1412 Mar 5, 2026
8931f23
feat: Use cwltool --write-summary for smart output parsing
sujen1412 Mar 11, 2026
a47af38
feat: Use CWL output ID and compact timestamp for dataset names
sujen1412 Mar 11, 2026
e3d0143
fix: Use ISO 8601 timestamp in metadata for ES compatibility
sujen1412 Mar 11, 2026
f695cec
test: Add comprehensive tests for stage_in.py STAC asset downloading …
sujen1412 Apr 30, 2026
da20df4
Preserve STAC metadata (extra_fields, extensions) during asset stagin…
sujen1412 Apr 30, 2026
de42e17
feat(stage_in): Add intelligent asset routing for S3 and DAAC downloads
sujen1412 May 5, 2026
096baf1
feat: Use cwl_summary listing to resolve stale STAC asset hrefs
sujen1412 May 5, 2026
1092cf2
refactor: Rename walk_stac_catalog_2 to extract_stac_catalog_metadata
sujen1412 May 5, 2026
92878f5
fix(stage_out): fix NameErrors and bare except in extract_stac_catalo…
sujen1412 May 5, 2026
9f5ce92
fix(stage_in): download each asset into its own asset_key subdirectory
sujen1412 May 8, 2026
6e76144
fix(stage_in): set self_href to item JSON file path so asset hrefs ar…
sujen1412 May 9, 2026
478c7b7
refactor(dps_wrapper): organize cwltool temporary files and improve l…
sujen1412 May 13, 2026
2ce4ed3
Update cwltool command to leave temporary directory
sujen1412 May 14, 2026
2027b35
feat(create_inputs): support s3:// URIs in load_json_from_uri and doc…
sujen1412 Jun 16, 2026
335347c
Merge origin/main into develop, keeping develop changes
sujen1412 Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions create_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import urllib.parse
import stage_in
import requests
import boto3
from botocore.exceptions import BotoCoreError, ClientError


def get_id_from_uri(uri):
Expand Down Expand Up @@ -92,9 +94,26 @@ def convert_value_to_cwl_type(value, cwl_type_str):


def load_json_from_uri(uri):
parsed = urllib.parse.urlparse(uri)

if parsed.scheme == "s3":
bucket = parsed.netloc
key = parsed.path.lstrip("/")
try:
s3 = boto3.client("s3")
response = s3.get_object(Bucket=bucket, Key=key)
return json.loads(response["Body"].read())
except (BotoCoreError, ClientError) as e:
print(f"S3 error: {e}")
return None
except ValueError as e:
print(f"Failed to parse JSON: {e}")
return None

# http / https
try:
response = requests.get(uri)
response.raise_for_status() # Raise error for bad status codes
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Request error: {e}")
Expand Down Expand Up @@ -178,7 +197,11 @@ def map_inputs_from_context(job_inputs: dict, cwl_inputs: [CommandInputParameter

if base_type == "Directory":
print("Encountered STAC input, localizing assets.")
# STAC input can be either a Feature (STAC Item) or FeatureCollection (STAC Collection)
# Load STAC JSON directly from the URI rather than using the HySDS-localized copy.
# HySDS caches localized files by URI path — if the JSON content changes at the same
# URI, HySDS serves the stale cached version. Fetching from the URI at runtime
# guarantees we always get the current content.
# TODO: Update the HySDS spec builder to not map this input as a localize field.
stac_json = load_json_from_uri(job_inputs.get(input_name))
output_dir = str(pathlib.Path(input_name).resolve())
stage_in.download_stac_assets_from_json(stac_json, output_dir)
Expand Down
2 changes: 1 addition & 1 deletion dps_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CWL_FILE=$(basename "$CWL_FILE")
python /app/create_inputs.py $CWL_FILE
CWLTOOL_TMP_DIR="$PWD/cwltool_tmp"
mkdir -p $CWLTOOL_TMP_DIR
cwltool --quiet --disable-color --no-read-only --timestamps \
cwltool --quiet --disable-color --no-read-only --timestamps --leave-tmpdir \
--preserve-environment MAAP_PGT --preserve-environment MAAP_API_HOST \
--cidfile-dir $PWD --tmpdir-prefix $CWLTOOL_TMP_DIR --log-dir ${PWD} \
--write-summary ${PWD}/cwl_summary.json \
Expand Down
Loading