swxsoc_reach.historical.s3_upload#

Local CDF upload helper for the historical process orchestrator.

Mirrors the executor Lambda’s _upload_reach_file_to_s3 exactly: sets SWXSOC_MISSION=swxsoc_pipeline, calls swxsoc._reconfigure(), and delegates the upload to sdc_aws_utils.aws.push_science_file().

push_science_file (via sdc_aws_utils.aws.upload_file_to_s3()) hard-codes /tmp/{filename} as the source path because it was written for the Lambda runtime where the CDF already lives in /tmp. For a local historical run the CDF is in --output-dir instead, so this helper stages a copy of the file into /tmp before invoking push_science_file and removes the staged copy afterwards. The original CDF in --output-dir is left untouched.

boto3 and sdc_aws_utils are imported lazily inside the function so the package still imports on dev machines that have not installed the [net] extra.

Functions

upload_cdf_to_s3(cdf_path, *, destination_bucket)

Upload a single CDF file to S3 via sdc_aws_utils.

swxsoc_reach.historical.s3_upload.upload_cdf_to_s3(cdf_path: Path, *, destination_bucket: str) tuple[str, str][source]#

Upload a single CDF file to S3 via sdc_aws_utils.

Parameters:
  • cdf_path (pathlib.Path) – Local path to the CDF file. Must exist on disk.

  • destination_bucket (str) – Target S3 bucket name (no s3:// prefix).

Returns:

tuple[str, str](destination_bucket, s3_key) where s3_key is the value returned by sdc_aws_utils.aws.push_science_file().

Raises:
  • RuntimeError – If boto3 or sdc_aws_utils are not importable. The message includes the install hint.

  • FileNotFoundError – If cdf_path does not exist.