NASA-IMPACT / csdap-cumulus

SmallSat Cumulus Deployment
Other
1 stars 0 forks source link

Define Data Management items for WV02_Pan_L1B Maxar collection #348

Closed jsrikish closed 1 month ago

jsrikish commented 3 months ago

Obtain the collection short name for the WV02_Pan_L1B Maxar collection and define the corresponding Cumulus Data Management Items according to the instructions in the section "Defining Cumulus Data Management Items" in docs/OPERATING.md.

Acceptance criteria:

DOTENV=.env.prod make create-data-management-items
krisstanton commented 1 month ago

I worked on what looks like a bug for a while today but may not be. Here is the error message when reproducing.

➜  csdap-cumulus git:(iss358__cumulus_core_upgrade_to_18_2_0) ✗ DOTENV=.env.sandbox make create-test-data
sha256:123456789
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Determining provider bucket..."csda-cumulus-kris-sbx7894-provider-7894"
Generating dummy granule files based on cmr.json files...done
New or updated files: []
Syncing dummy files to provider bucket "csda-cumulus-kris-sbx7894-provider-7894"...fatal error: Parameter validation failed:
Invalid bucket name ""csda-cumulus-kris-sbx7894-provider-7894"": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$" or be an ARN matching the regex "^arn:(aws).*:(s3|s3-object-lambda):[a-z\-0-9]*:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-.]{1,63}$|^arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:][a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63}$"
make: *** [create-test-data] Error 1

This script: create-test-data.sh

# // Script Contents

#!/usr/bin/env bash

set -euo pipefail

declare provider_bucket
declare files
declare output

echo -n "Determining provider bucket..."
provider_bucket="$(
  echo 'var.buckets["provider"]["name"]' |
    terraspace console cumulus 2>/dev/null |
    grep "${CUMULUS_PREFIX}"
)"
echo "${provider_bucket}"

echo -n "Generating dummy granule files based on cmr.json files..."
files=$(YARN_SILENT=1 yarn generate-test-granule-files)
echo "done"
echo "New or updated files: ${files}"

echo -n "Syncing dummy files to provider bucket ${provider_bucket}..."
output=$(aws s3 sync app/stacks/cumulus/resources/granules "s3://${provider_bucket}" --delete)
echo "done"
echo "${output}"

Does the following.

I think the problem we are having is that the script did not find any new or updated files New or updated files: [] AND the step right after that where we call the AWS sync command can't handle a blank value from the last step, so it looks like an error but it is not really. The cause may be not yet having the mock granule files in the local filesystem. That step should have been listed in the ticket earlier. I'm going to go back add it now and we can try again.

Change to the above ticket:

krisstanton commented 1 month ago

Update - we found that the files actually did copy on the first create-test-data run, and after that it was showing empty because it was already copied (and the script detects changes)

krisstanton commented 1 week ago

Update - If the create-test-data script still fails when it should not fail. This work around will work. Example:

// Replace the profile with your correct profile.
// Replace the sandbox provider bucket name to your correct bucket name
aws s3 sync app/stacks/cumulus/resources/granules s3://csda-cumulus-jayanthi-cba-provider-7894 --profile csda-cumulus-cba-7894