Closed jsrikish closed 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.
csda-cumulus-kris-sbx7894-provider-7894
files=$(YARN_SILENT=1 yarn generate-test-granule-files)
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:
mock
granule file but with a REAL cmr.json file into the expected directory on the filesystemUpdate - 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)
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
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:
[x] new collection and rule definition files defined in the code base
[x] Run the command make create-data-management-items in the sandbox (dev)
[x] Successful Smoke Test Run in dev Before running the below Create test data command, we need to have
mock
data but with a real CMR.json file.[x] UPDATE: Manually create
mock
granule file for this dataset but with a REAL cmr.json file into the expected directory on the filesystem[x] new collection loaded into UAT
[x] new rule definition(s) defined and loaded into UAT (if collection is "small enough," 1 rule may be sufficient to ingest entire collection, otherwise multiple rules spanning consecutive time periods will be required)
[x] Pull Request for UAT Deployment and merging rules into code base
[x] new collection loaded into CBA Prod
[x] new rule definition(s) defined and loaded into CBA Prod (if collection is "small enough," 1 rule may be sufficient to ingest entire collection, otherwise multiple rules spanning consecutive time periods will be required)