Skip to content

Commit 63bfb31

Browse files
authored
Merge pull request #43 from asfadmin/test
Release v0.2.0
2 parents 2ef81cc + 47f6b51 commit 63bfb31

17 files changed

+110
-23
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "daily"
12+
ignore:
13+
- dependency-name: "elasticsearch"
1214
labels:
1315
- "bumpless"
1416
- package-ecosystem: "github-actions"

.github/workflows/deploy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- prod
77
- test
88

9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
911
jobs:
1012
deploy:
1113
runs-on: ubuntu-latest
@@ -41,10 +43,7 @@ jobs:
4143
- name: install dependencies
4244
if: github.ref == matrix.deploy_ref
4345
shell: bash
44-
run: |
45-
python -m pip install --upgrade pip
46-
python -m pip install -r log-parse/requirements.txt -t log-parse/src/
47-
python -m pip install -r ems-report/requirements.txt -t ems-report/src/
46+
run: make install-lambda-deps
4847
- name: package and deploy
4948
if: github.ref == matrix.deploy_ref
5049
shell: bash

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Test with pytest
2+
3+
on: push
4+
5+
jobs:
6+
pytest:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: mamba-org/provision-with-micromamba@v16
13+
14+
- shell: bash -l {0}
15+
run: |
16+
make pytest

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
77
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [0.2.0]
10+
11+
### Changed
12+
- For products with version >= `v3`:
13+
- Browse image downloads are reported under the `ARIA_S1_GUNW_BROWSE` collection.
14+
- All other product downloads are reported under the `ARIA_S1_GUNW` collection.
15+
- For older products:
16+
- Browse image downloads are reported under the `SENTINEL-1_INTERFEROGRAMS_BROWSE` collection.
17+
- All other product downloads are reported under the `SENTINEL-1_INTERFEROGRAMS` collection.
18+
- Upgraded lambda functions to Python 3.12 from Python 3.8.
19+
- Upgraded Elasticsearch to 7.10 from 7.4.
20+
- Upgraded instance type for Elasticsearch domain to `t3.small.elasticsearch` from `t2.small.elasticsearch`.
21+
22+
### Removed
23+
- Downloads of `.unw_geo.zip` products are no longer reported under the `SENTINEL-1_INSAR_UNWRAPPED_INTERFEROGRAM_AND_COHERENCE_MAP` collection. This collection was removed within the last year.
24+
925
## [0.1.0]
1026

1127
This is the initial release after replacing the AWS CodePipeline workflow with a GitHub Actions deployment workflow.

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
EMS_REPORT = ${PWD}/ems-report/src/
2+
LOG_PARSE = ${PWD}/log-parse/src/
3+
export PYTHONPATH = ${EMS_REPORT}:${LOG_PARSE}
4+
5+
install:
6+
python -m pip install --upgrade pip && \
7+
python -m pip install -r requirements-all.txt
8+
9+
install-lambda-deps:
10+
python -m pip install --upgrade pip && \
11+
python -m pip install -r requirements-ems-report.txt -t ems-report/src/ && \
12+
python -m pip install -r requirements-log-parse.txt -t log-parse/src/
13+
14+
test_file ?= tests/
15+
pytest:
16+
pytest $(test_file)

cloudformation.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ Resources:
2727

2828
Domain:
2929
Type: AWS::Elasticsearch::Domain
30+
UpdatePolicy:
31+
EnableVersionUpgrade: true
3032
Properties:
3133
DomainName: !Ref AWS::StackName
32-
ElasticsearchVersion: 7.4
34+
ElasticsearchVersion: "7.10"
3335
AccessPolicies: !Sub |-
3436
{
3537
"Version": "2012-10-17",
@@ -58,7 +60,7 @@ Resources:
5860
ElasticsearchClusterConfig:
5961
DedicatedMasterEnabled: false
6062
InstanceCount: 1
61-
InstanceType: t2.small.elasticsearch
63+
InstanceType: t3.small.elasticsearch
6264
ZoneAwarenessEnabled: false
6365
EBSOptions:
6466
EBSEnabled: true

ems-report/cloudformation.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ Resources:
6363
Resource: !Sub "arn:aws:s3:::${OutputBucket}/${OutputPrefix}*"
6464
- Effect: Allow
6565
Action:
66-
- es:ESHttpGet
66+
- es:ESHttpPost
6767
Resource: !Sub "${DomainArn}/${IndexName}/_search*"
6868
- Effect: Allow
6969
Action:
70-
- es:ESHttpGet
70+
- es:ESHttpPost
7171
- es:ESHttpDelete
7272
Resource: !Sub "${DomainArn}/_search/scroll*"
7373

@@ -91,10 +91,10 @@ Resources:
9191
"prefix": "${OutputPrefix}"
9292
}
9393
}
94-
Handler: main.lambda_handler
94+
Handler: ems_report.lambda_handler
9595
MemorySize: 1024
9696
Role: !GetAtt Role.Arn
97-
Runtime: python3.8
97+
Runtime: python3.12
9898
Timeout: 900
9999

100100
Schedule:

ems-report/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

ems-report/src/main.py renamed to ems-report/src/ems_report.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ def get_elasticsearch_connection(host):
3535
return es
3636

3737

38-
def get_category(file_name):
38+
def get_category(file_name: str) -> str:
39+
version = file_name.split('-')[-1].split('.')[0]
40+
if version < 'v3':
41+
if file_name.endswith('.png'):
42+
return 'SENTINEL-1_INTERFEROGRAMS_BROWSE'
43+
return 'SENTINEL-1_INTERFEROGRAMS'
44+
3945
if file_name.endswith('.png'):
40-
category = 'SENTINEL-1_INTERFEROGRAMS_BROWSE'
41-
elif file_name.endswith('.unw_geo.zip'):
42-
category = 'SENTINEL-1_INSAR_UNWRAPPED_INTERFEROGRAM_AND_COHERENCE_MAP'
43-
else:
44-
category = 'SENTINEL-1_INTERFEROGRAMS'
45-
return category
46+
return 'ARIA_S1_GUNW_BROWSE'
47+
return 'ARIA_S1_GUNW'
4648

4749

4850
def get_records(report_date, config):

environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: grfn-logging
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- python=3.12
7+
- pip
8+
- pip:
9+
- -r requirements-all.txt

0 commit comments

Comments
 (0)