Skip to content

Commit

Permalink
Merge pull request #65 from unity-sds/develop
Browse files Browse the repository at this point in the history
fix: l1A granule id is `<collection-id>___<collection-version>:<granule-id>` not to duplicate re-runs
  • Loading branch information
wphyojpl authored Jul 28, 2022
2 parents 96a9434 + e744311 commit a39446d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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).

## [1.6.17] - 2022-07-28
### Added
### Fixed
- l1A granule id is `<collection-id>___<collection-version>:<granule-id>` not to duplicate re-runs

## [1.6.16] - 2022-07-25
### Added
- Added: use username & password to login to cognito to get the token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __sort_granules(self):
def __upload_granules(self, granule_assets: dict, granule_id: str):
for data_type, href_dict in granule_assets.items():
LOGGER.debug(f'uploading {href_dict}')
s3_url = self.__s3.upload(href_dict['href'], self.__staging_bucket, granule_id, self.__delete_files)
s3_url = self.__s3.upload(href_dict['href'], self.__staging_bucket, f'{self.__collection_id}:{granule_id}', self.__delete_files)
href_dict['href'] = s3_url
return self

Expand All @@ -108,7 +108,7 @@ def start(self):
for granule_id, granule_hrefs in on_disk_granules.items():
self.__upload_granules(granule_hrefs, granule_id)
dapa_body_granules.append({
'id': granule_id,
'id': f'{self.__collection_id}:{granule_id}',
'collection': self.__collection_id,
'assets': granule_hrefs,
})
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="cumulus_lambda_functions",
version="1.6.16",
version="1.6.17",
packages=find_packages(),
install_requires=install_requires,
tests_require=['mock', 'nose', 'sphinx', 'sphinx_rtd_theme', 'coverage'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import os


os.environ['DAPA_API'] = 'https://k3a3qmarxh.execute-api.us-west-2.amazonaws.com/dev/am-uds-dapa'
os.environ['UNITY_BEARER_TOKEN'] = 'abcd.abcd.abcd-abcd-abcd'
os.environ['COLLECTION_ID'] = 'SNDR_SNPP_ATMS_L1A___1'
os.environ['DAPA_API'] = 'https://k3a3qmarxh.execute-api.us-west-2.amazonaws.com/dev'
os.environ['USERNAME'] = '/unity/uds/user/wphyo/username'
os.environ['PASSWORD'] = '/unity/uds/user/wphyo/dwssap'
os.environ['PASSWORD_TYPE'] = 'PARAM_STORE'
os.environ['CLIENT_ID'] = '7a1fglm2d54eoggj13lccivp25'
os.environ['COGNITO_URL'] = 'https://cognito-idp.us-west-2.amazonaws.com'

os.environ['COLLECTION_ID'] = 'SNDR_SNPP_ATMS_L1A_NGA___1'
os.environ['PROVIDER_ID'] = 'SNPP'
os.environ['UPLOAD_DIR'] = '/tmp/snpp_upload_test_1'
os.environ['STAGING_BUCKET'] = 'am-uds-dev-cumulus-staging'
Expand Down

0 comments on commit a39446d

Please sign in to comment.