diff --git a/.github/actions/deploy-hyp3/action.yml b/.github/actions/deploy-hyp3/action.yml index 4f7817f10..946b9faa3 100644 --- a/.github/actions/deploy-hyp3/action.yml +++ b/.github/actions/deploy-hyp3/action.yml @@ -68,6 +68,9 @@ inputs: DISTRIBUTION_URL: description: "CloudFront Distribution URL for Earthdata Cloud environments" required: true + AUTH_PUBLIC_KEY: + description: "Public key for jwt auth provider" + required: true runs: using: "composite" @@ -111,6 +114,7 @@ runs: SecretArn='${{ inputs.SECRET_ARN }}' \ ImageTag='${{ inputs.IMAGE_TAG }}' \ ProductLifetimeInDays='${{ inputs.PRODUCT_LIFETIME }}' \ + AuthPublicKey='${{ inputs.AUTH_PUBLIC_KEY }}' \ $DOMAIN_NAME \ $CERTIFICATE_ARN \ $ORIGIN_ACCESS_IDENTITY_ID \ diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 656e4a540..e08085da6 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -13,6 +13,6 @@ on: jobs: call-changelog-check-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.8.2 secrets: USER_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/create-jira-issue.yml b/.github/workflows/create-jira-issue.yml index a2ee3bb1a..3615af153 100644 --- a/.github/workflows/create-jira-issue.yml +++ b/.github/workflows/create-jira-issue.yml @@ -6,7 +6,7 @@ on: jobs: call-create-jira-issue-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.8.2 secrets: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} diff --git a/.github/workflows/deploy-daac.yml b/.github/workflows/deploy-daac.yml index 49c46e5b7..91e3894b4 100644 --- a/.github/workflows/deploy-daac.yml +++ b/.github/workflows/deploy-daac.yml @@ -29,7 +29,7 @@ jobs: expanded_max_vcpus: 3000 required_surplus: 3000 security_environment: EDC - ami_id: image_id_ecs_amz2 + ami_id: image_id_s1_ecs_amz2 distribution_url: 'https://d3gm2hf49xd6jj.cloudfront.net' - environment: hyp3-edc-uat @@ -52,7 +52,7 @@ jobs: expanded_max_vcpus: 3000 required_surplus: 3000 security_environment: EDC - ami_id: image_id_ecs_amz2 + ami_id: image_id_s1_ecs_amz2 distribution_url: 'https://d1riv60tezqha9.cloudfront.net' environment: @@ -60,9 +60,9 @@ jobs: url: https://${{ matrix.domain }} steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - - uses: aws-actions/configure-aws-credentials@v2 + - uses: aws-actions/configure-aws-credentials@v3 with: aws-access-key-id: ${{ secrets.V2_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.V2_AWS_SECRET_ACCESS_KEY }} @@ -98,10 +98,11 @@ jobs: AMI_ID: ${{ matrix.ami_id }} INSTANCE_TYPES: ${{ matrix.instance_types }} DISTRIBUTION_URL: ${{ matrix.distribution_url }} + AUTH_PUBLIC_KEY: ${{ secrets.AUTH_PUBLIC_KEY }} call-bump-version-workflow: if: github.ref == 'refs/heads/main' needs: deploy - uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.8.2 secrets: USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }} diff --git a/.github/workflows/deploy-enterprise-test.yml b/.github/workflows/deploy-enterprise-test.yml index 12af19354..dd91da8f7 100644 --- a/.github/workflows/deploy-enterprise-test.yml +++ b/.github/workflows/deploy-enterprise-test.yml @@ -45,9 +45,9 @@ jobs: url: https://${{ matrix.domain }} steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - - uses: aws-actions/configure-aws-credentials@v2 + - uses: aws-actions/configure-aws-credentials@v3 with: aws-access-key-id: ${{ secrets.V2_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.V2_AWS_SECRET_ACCESS_KEY }} @@ -82,3 +82,4 @@ jobs: AMI_ID: ${{ matrix.ami_id }} INSTANCE_TYPES: ${{ matrix.instance_types }} DISTRIBUTION_URL: ${{ matrix.distribution_url }} + AUTH_PUBLIC_KEY: ${{ secrets.AUTH_PUBLIC_KEY }} diff --git a/.github/workflows/deploy-enterprise.yml b/.github/workflows/deploy-enterprise.yml index 380fb7f34..22f8b9f62 100644 --- a/.github/workflows/deploy-enterprise.yml +++ b/.github/workflows/deploy-enterprise.yml @@ -39,9 +39,9 @@ jobs: product_lifetime_in_days: 180 quota: 0 job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml - instance_types: c6id.xlarge - default_max_vcpus: 1600 - expanded_max_vcpus: 1600 + instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge + default_max_vcpus: 10000 + expanded_max_vcpus: 10000 required_surplus: 0 security_environment: JPL-public ami_id: /aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id @@ -51,12 +51,12 @@ jobs: domain: hyp3-tibet-jpl.asf.alaska.edu template_bucket: cf-templates-1or0efwqffkgd-us-west-2 image_tag: latest - product_lifetime_in_days: 14 + product_lifetime_in_days: 60 quota: 0 job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge - default_max_vcpus: 1600 - expanded_max_vcpus: 1600 + default_max_vcpus: 0 + expanded_max_vcpus: 0 required_surplus: 0 security_environment: JPL-public ami_id: /aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id @@ -69,7 +69,7 @@ jobs: product_lifetime_in_days: 14 quota: 0 job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml - instance_types: c6id.xlarge + instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge default_max_vcpus: 1600 expanded_max_vcpus: 1600 required_surplus: 0 @@ -204,9 +204,9 @@ jobs: url: https://${{ matrix.domain }} steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - - uses: aws-actions/configure-aws-credentials@v2 + - uses: aws-actions/configure-aws-credentials@v3 with: aws-access-key-id: ${{ secrets.V2_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.V2_AWS_SECRET_ACCESS_KEY }} @@ -241,3 +241,4 @@ jobs: AMI_ID: ${{ matrix.ami_id }} INSTANCE_TYPES: ${{ matrix.instance_types }} DISTRIBUTION_URL: ${{ matrix.distribution_url }} + AUTH_PUBLIC_KEY: ${{ secrets.AUTH_PUBLIC_KEY }} diff --git a/.github/workflows/labeled-pr.yml b/.github/workflows/labeled-pr.yml index c00df6335..ee8a5f5ea 100644 --- a/.github/workflows/labeled-pr.yml +++ b/.github/workflows/labeled-pr.yml @@ -12,4 +12,4 @@ on: jobs: call-labeled-pr-check-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.8.2 diff --git a/.github/workflows/release-template-comment.yml b/.github/workflows/release-template-comment.yml index 67c003cd8..866ce1af4 100644 --- a/.github/workflows/release-template-comment.yml +++ b/.github/workflows/release-template-comment.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest name: Add a comment with the release template steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - name: Comment PR uses: thollander/actions-comment-pull-request@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c1c240e6..e83e1a127 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: call-release-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.8.2 with: release_prefix: HyP3 secrets: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index bbb8c73cc..69fbf3dcc 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,7 +6,7 @@ jobs: flake8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: actions/setup-python@v4 with: python-version: 3.9 @@ -23,7 +23,7 @@ jobs: matrix: security_environment: [ASF, EDC, JPL, JPL-public] steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: actions/setup-python@v4 with: python-version: 3.9 @@ -37,7 +37,7 @@ jobs: openapi-spec-validator: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: actions/setup-python@v4 with: python-version: 3.9 @@ -50,7 +50,7 @@ jobs: statelint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 @@ -70,7 +70,7 @@ jobs: snyk: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: snyk/actions/setup@0.4.0 - uses: actions/setup-python@v4 with: @@ -87,4 +87,4 @@ jobs: snyk iac test --severity-threshold=high call-secrets-analysis-workflow: - uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.1 + uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b7c1850d..917398c6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3.6.0 - uses: actions/setup-python@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 007e6dc94..c9857392c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,40 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.10.10] +### Changed +- Reduced vCPU limits for `hyp3-tibet-jpl` to 0 from 10,000. + +## [3.10.9] +### Changed +- The public key for the JWT auth provider is now specified as a GitHub Secret. Fixes https://github.com/ASFHyP3/hyp3/issues/1765 + +## [3.10.8] +### Changed +- HyP3 deployments at JPL now use On Demand instances instead of Spot instances to prevent `INSAR_ISCE` jobs from being interrupted. + This *should* be a temporary change. + +## [3.10.7] +### Changed +- The `INSAR_ISCE_BURST` job type now validates that polarizations and burst ids are the same. + +## [3.10.6] +### Changed +- Increased vCPU limits for `hyp3-a19-jpl` and `hyp3-tibet-jpl` from 1,600 to 10,000. + +## [3.10.5] +### Changed +- Updated INSAR_ISCE job specification for [DockerizedTopsApp](https://github.com/ACCESS-Cloud-Based-InSAR/DockerizedTopsApp) v0.2.4 +- Added larger `c6id` instance types to hyp3-a19-jpl and hyp3-nisar-jpl deployments + +## [3.10.4] +### Changed +- The `hyp3-edc-uat` and `hyp3-edc-prod` deployments now uses the latest Earthdata Cloud AMI with additional software installed. + +## [3.10.3] +### Changed +- Increased product lifetime for hyp3-tibet-jpl deployment from 14 days to 60 days. + ## [3.10.2] ### Deprecated - The Subscriptions feature has been deprecated and will be removed as early as `2023-09-05` (September 5, 2023). diff --git a/apps/api/src/hyp3_api/validation.py b/apps/api/src/hyp3_api/validation.py index 01b087066..8a6b2507b 100644 --- a/apps/api/src/hyp3_api/validation.py +++ b/apps/api/src/hyp3_api/validation.py @@ -86,6 +86,24 @@ def check_dem_coverage(job, granule_metadata): raise GranuleValidationError(f'Some requested scenes do not have DEM coverage: {", ".join(bad_granules)}') +def check_same_burst_ids(job, granule_metadata): + ref_burst_id, sec_burst_id = [granule['name'].split('_')[1] for granule in granule_metadata] + if ref_burst_id != sec_burst_id: + raise GranuleValidationError( + f'The requested scenes do not have the same burst ID: {ref_burst_id} and {sec_burst_id}' + ) + + +def check_valid_polarizations(job, granule_metadata): + ref_polarization, sec_polarization = [granule['name'].split('_')[4] for granule in granule_metadata] + if ref_polarization != sec_polarization: + raise GranuleValidationError( + f'The requested scenes do not have the same polarization: {ref_polarization} and {sec_polarization}' + ) + if ref_polarization != 'VV' and ref_polarization != 'HH': + raise GranuleValidationError(f'Only VV and HH polarizations are currently supported, got: {ref_polarization}') + + def format_points(point_string): converted_to_float = [float(x) for x in point_string.split(' ')] points = [list(t) for t in zip(converted_to_float[1::2], converted_to_float[::2])] diff --git a/apps/compute-cf.yml.j2 b/apps/compute-cf.yml.j2 index ae04fbb60..48721a7f4 100644 --- a/apps/compute-cf.yml.j2 +++ b/apps/compute-cf.yml.j2 @@ -68,8 +68,13 @@ Resources: ServiceRole: !GetAtt BatchServiceRole.Arn Type: MANAGED ComputeResources: + {% if security_environment in ('JPL', 'JPL-public') %} + Type: EC2 + AllocationStrategy: BEST_FIT_PROGRESSIVE + {% else %} Type: SPOT AllocationStrategy: SPOT_CAPACITY_OPTIMIZED + {% endif %} MinvCpus: 0 MaxvCpus: !Ref MaxvCpus InstanceTypes: !Ref InstanceTypes diff --git a/apps/main-cf.yml.j2 b/apps/main-cf.yml.j2 index 5b169d273..e23f47cf9 100644 --- a/apps/main-cf.yml.j2 +++ b/apps/main-cf.yml.j2 @@ -23,9 +23,8 @@ Parameters: Default: 14 AuthPublicKey: - Description: Public key for jwt auth provider, if using https://auth.asf.alaska.edu then keep default. + Description: Public key for jwt auth provider Type: String - Default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCnUEi9E+KNwH2hq0OXR4YyuVPQoNy6CtxQZv3VNXE+TRkmlo7nZbZXQp3JVQAvVaq+ixwNeSvCDI979UGA+SlUpryWy+XFJNAMDlIz9kBVYkTQdT8uFA8IN/fjN1jioOfgpbDJnSaKbb1/NsiTp9cesQQB0qiW5iUsGUfi3Y2x6r446KFt9oJqDzpR2MumKwmHX8tSe1AFUQG+5P4ncoZKS/2EPwfgTuiLW5f/9Duz4vt3peA/wJzBUWd5k9pOz44e2vAbwwLym2APpa7m740Ftyo2lXAZZkejg5MUUza1das5PjN7srt7jJwkBVqd27e1eKHAM4kzAMxcny3SBW2FC6pg6q04NZmPWN6A7y7GzLYJCBuqBwu4OWEzcc4KVkFyTVV+HGUlLX9n2iM4O5RML6+qx+DuK4Ml1kvEBObJ5ce7s4XaNFcg9XmymYiRpZUQmawD1/E5D1l1JNoXNNv8VlJ21c4QYWfmHIhKUF8/dwaRxl6GYd5CrdseEMZtjss88ncmml2cm+7tcpHHJi9Q/wsvAfV7RjFV5JW1PR2UPrATUpJxL+M9dFiGd0KROpqVQ4r6OLAnQQiOrWUquw/38a6JRPW4Y8MH3+JNJMm6MdhB8lFjEKzPic5qBzLJ4yQkOo8K/k0h0K88kT39tRIKVl4Upxvw3iPoVTDGWbkK1w== douglassorensen@FBK-3CGMD6R.local\n AuthAlgorithm: Description: Algorithm for jwt auth provider, if using https://auth.asf.alaska.edu then keep default. diff --git a/job_spec/INSAR_ISCE.yml b/job_spec/INSAR_ISCE.yml index cf8ee7832..2e7c254c8 100644 --- a/job_spec/INSAR_ISCE.yml +++ b/job_spec/INSAR_ISCE.yml @@ -27,6 +27,28 @@ INSAR_ISCE: minLength: 67 maxLength: 67 example: S1B_IW_SLC__1SDV_20210711T014947_20210711T015013_027740_034F80_D404 + esd_coherence_threshold: + api_schema: + description: Coherence threshold value for determining which points to include when performing ESD. Must be any value between 0 and 1 (inclusive), or -1 for no ESD correction. + default: -1.0 + type: number + minimum: -1.0 + maximum: 1.0 + estimate_ionosphere_delay: + api_schema: + description: Whether to apply ionosphere correction to the ARIA-S1-GUNW as an additional layer. + default: false + type: boolean + frame_id: + api_schema: + description: Subset GUNW products to this frame. The default is `-1` with no subsetting of the products. + default: -1 + type: integer + compute_solid_earth_tide: + api_schema: + default: false + type: boolean + description: "Whether to compute a solid earth tide correction layer for ARIA-S1-GUNW products" weather_model: api_schema: description: Weather model used to generate tropospheric delay estimations @@ -34,9 +56,11 @@ INSAR_ISCE: type: string enum: - None + - ERA5 + - ERA5T + - GMAO - HRES - HRRR - - GMAO bucket_prefix: default: '""' validators: [] @@ -44,6 +68,8 @@ INSAR_ISCE: - name: '' image: ghcr.io/access-cloud-based-insar/dockerizedtopsapp command: + - ++omp-num-threads + - '4' - --bucket - '!Ref Bucket' - --bucket-prefix @@ -52,7 +78,15 @@ INSAR_ISCE: - Ref::granules - --secondary-scenes - Ref::secondary_granules - timeout: 10800 + - --esd-coherence-threshold + - Ref::esd_coherence_threshold + - --estimate-ionosphere-delay + - Ref::estimate_ionosphere_delay + - --frame-id + - Ref::frame_id + - --compute-solid-earth-tide + - Ref::compute_solid_earth_tide + timeout: 21600 vcpu: 1 memory: 7500 secrets: @@ -75,4 +109,8 @@ INSAR_ISCE: secrets: - EARTHDATA_USERNAME - EARTHDATA_PASSWORD - + - RAIDER_ECMWF_ERA5_UID + - RAIDER_ECMWF_ERA5_API_KEY + - RAIDER_HRES_EMAIL + - RAIDER_HRES_API_KEY + - RAIDER_HRES_URL diff --git a/job_spec/INSAR_ISCE_BURST.yml b/job_spec/INSAR_ISCE_BURST.yml index 10b69b8f4..854849278 100644 --- a/job_spec/INSAR_ISCE_BURST.yml +++ b/job_spec/INSAR_ISCE_BURST.yml @@ -36,6 +36,8 @@ INSAR_ISCE_BURST: - 5x1 validators: - check_dem_coverage + - check_valid_polarizations + - check_same_burst_ids tasks: - name: '' image: ghcr.io/asfhyp3/hyp3-isce2 diff --git a/requirements-all.txt b/requirements-all.txt index ce0ec1ce9..a4aae6bce 100644 --- a/requirements-all.txt +++ b/requirements-all.txt @@ -4,9 +4,9 @@ -r requirements-apps-start-execution-manager.txt -r requirements-apps-start-execution-worker.txt -r requirements-apps-update-db.txt -boto3==1.28.26 +boto3==1.28.39 jinja2==3.1.2 -moto[dynamodb]==4.1.14 +moto[dynamodb]==4.2.0 pytest==7.4.0 PyYAML==6.0.1 responses==0.23.3 @@ -14,6 +14,6 @@ flake8==6.1.0 flake8-import-order==0.18.2 flake8-blind-except==0.2.1 flake8-builtins==2.1.0 -setuptools==68.0.0 +setuptools==68.1.2 openapi-spec-validator==0.4.0 -cfn-lint==0.79.7 +cfn-lint==0.79.8 diff --git a/requirements-apps-start-execution-manager.txt b/requirements-apps-start-execution-manager.txt index 4257d57ca..cfcd43d64 100644 --- a/requirements-apps-start-execution-manager.txt +++ b/requirements-apps-start-execution-manager.txt @@ -1,3 +1,3 @@ -boto3==1.28.26 +boto3==1.28.39 ./lib/dynamo/ ./lib/lambda_logging/ diff --git a/requirements-apps-start-execution-worker.txt b/requirements-apps-start-execution-worker.txt index f6830cdf9..c1a7cfb59 100644 --- a/requirements-apps-start-execution-worker.txt +++ b/requirements-apps-start-execution-worker.txt @@ -1,2 +1,2 @@ -boto3==1.28.26 +boto3==1.28.39 ./lib/lambda_logging/ diff --git a/tests/test_api/test_validation.py b/tests/test_api/test_validation.py index fad1887ce..1349c6dfd 100644 --- a/tests/test_api/test_validation.py +++ b/tests/test_api/test_validation.py @@ -142,6 +142,62 @@ def test_check_dem_coverage(): validation.check_dem_coverage(job, [neither]) +def test_check_same_burst_ids(): + valid_case = [ + { + 'name': 'S1_136231_IW2_20200604T022312_VV_7C85-BURST' + }, + { + 'name': 'S1_136231_IW2_20200616T022313_VV_5D11-BURST' + } + ] + invalid_case = [ + { + 'name': 'S1_136231_IW2_20200604T022312_VV_7C85-BURST' + }, + { + 'name': 'S1_136232_IW2_20200616T022313_HH_5D11-BURST' + } + ] + + validation.check_same_burst_ids(None, valid_case) + with raises(validation.GranuleValidationError, match=r'.*do not have the same burst ID.*'): + validation.check_same_burst_ids(None, invalid_case) + + +def test_check_valid_polarizations(): + valid_case = [ + { + 'name': 'S1_136231_IW2_20200604T022312_VV_7C85-BURST' + }, + { + 'name': 'S1_136231_IW2_20200616T022313_VV_5D11-BURST' + } + ] + different_polarizations = [ + { + 'name': 'S1_136231_IW2_20200604T022312_VV_7C85-BURST' + }, + { + 'name': 'S1_136231_IW2_20200616T022313_HH_5D11-BURST' + } + ] + unsupported_polarizations = [ + { + 'name': 'S1_136231_IW2_20200604T022312_VH_7C85-BURST' + }, + { + 'name': 'S1_136231_IW2_20200616T022313_VH_5D11-BURST' + } + ] + + validation.check_valid_polarizations(None, valid_case) + with raises(validation.GranuleValidationError, match=r'.*do not have the same polarization.*'): + validation.check_valid_polarizations(None, different_polarizations) + with raises(validation.GranuleValidationError, match=r'.*Only VV and HH.*'): + validation.check_valid_polarizations(None, unsupported_polarizations) + + def test_check_granules_exist(): granule_metadata = [ {