Skip to content

Commit 08910f8

Browse files
authored
Merge pull request #545 from unity-sds/develop
release/9.8.1
2 parents f2fa8f2 + bff8b70 commit 08910f8

33 files changed

+552
-250
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [9.8.1] - 2025-02-19
9+
### Fixed
10+
- [#535](https://github.com/unity-sds/unity-data-services/pull/535) fix: sorting key order was not kept previously
11+
12+
## [9.8.0] - 2025-02-10
13+
### Changed
14+
- [#532](https://github.com/unity-sds/unity-data-services/pull/532) feat: granules sort by time or other properties
15+
16+
## [9.7.0] - 2025-02-10
17+
### Changed
18+
- [#521](https://github.com/unity-sds/unity-data-services/pull/521) feat: gemx branch
19+
820
## [9.6.0] - 2025-02-03
921
### Changed
1022
- [#517](https://github.com/unity-sds/unity-data-services/pull/517) feat: stac browser oidc cookie

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Questions about our project? Please see our: [FAQ]([INSERT LINK TO FAQ / DISCUSS
111111
1. Question 1
112112
- Answer to question 1.
113113
2. Question 2
114-
- Answer to question 2
114+
- Answer to question 2.
115115
-->
116116

117117
<!-- example FAQ inline with no questions yet>

cumulus_lambda_functions/cumulus_es_setup/es_setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def __init__(self):
1616
required_env = ['ES_URL']
1717
if not all([k in os.environ for k in required_env]):
1818
raise EnvironmentError(f'one or more missing env: {required_env}')
19-
self.__es: ESAbstract = ESFactory().get_instance('AWS',
19+
self.__es: ESAbstract = ESFactory().get_instance(os.getenv('ES_TYPE', 'AWS'),
2020
index=DBConstants.collections_index,
2121
base_url=os.getenv('ES_URL'),
22+
use_ssl=os.getenv('ES_USE_SSL', 'TRUE').strip() is True,
2223
port=int(os.getenv('ES_PORT', '443'))
2324
)
2425

cumulus_lambda_functions/cumulus_wrapper/query_granules.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,40 @@ def query_direct_to_private_api(self, private_api_prefix: str, transform=True):
132132
return {'server_error': f'error while invoking:{str(e)}'}
133133
return {'results': stac_list}
134134

135+
def add_entry(self, private_api_prefix: str, new_granule: dict):
136+
raise NotImplementedError(f'Please implement adding granules to Cumulus')
137+
# https://nasa.github.io/cumulus-api/v18.4.0/#create-granule
138+
# payload = {
139+
# 'httpMethod': 'POST',
140+
# 'resource': '/{proxy+}',
141+
# 'path': f'/{self.__collections_key}',
142+
# 'headers': {
143+
# 'Content-Type': 'application/json',
144+
# },
145+
# 'body': json.dumps(new_granule)
146+
# }
147+
# LOGGER.debug(f'payload: {payload}')
148+
# try:
149+
# query_result = self._invoke_api(payload, private_api_prefix)
150+
# """
151+
# {'statusCode': 500, 'body': '', 'headers': {}}
152+
# """
153+
# if query_result['statusCode'] >= 500:
154+
# LOGGER.error(f'server error status code: {query_result["statusCode"]}. details: {query_result}')
155+
# return {'server_error': query_result}
156+
# if query_result['statusCode'] >= 400:
157+
# LOGGER.error(f'client error status code: {query_result["statusCode"]}. details: {query_result}')
158+
# return {'client_error': query_result}
159+
# query_result = json.loads(query_result['body'])
160+
# LOGGER.debug(f'json query_result: {query_result}')
161+
# if 'message' not in query_result:
162+
# return {'server_error': f'invalid response: {query_result}'}
163+
# except Exception as e:
164+
# LOGGER.exception('error while invoking')
165+
# return {'server_error': f'error while invoking:{str(e)}'}
166+
# return {'status': query_result['message']}
167+
return
168+
135169
def delete_entry(self, private_api_prefix: str, granule_id: str):
136170
payload = {
137171
'httpMethod': 'DELETE',

cumulus_lambda_functions/daac_archiver/daac_archiver_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class DaacArchiverLogic:
2424
def __init__(self):
2525
self.__es_url, self.__es_port = os.getenv('ES_URL'), int(os.getenv('ES_PORT', '443'))
26-
self.__archive_index_logic = UdsArchiveConfigIndex(self.__es_url, self.__es_port)
26+
self.__archive_index_logic = UdsArchiveConfigIndex(self.__es_url, self.__es_port, os.getenv('ES_TYPE', 'AWS'), os.getenv('ES_USE_SSL', 'TRUE').strip() is True)
2727
self.__granules_index = GranulesDbIndex()
2828
self.__sns = AwsSns()
2929
self.__s3 = AwsS3()

cumulus_lambda_functions/granules_cnm_ingester/granules_cnm_ingester_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self):
4040
if 'UNITY_DEFAULT_PROVIDER' not in os.environ:
4141
raise ValueError(f'missing UNITY_DEFAULT_PROVIDER')
4242
self.__default_provider = os.environ.get('UNITY_DEFAULT_PROVIDER')
43-
self.__uds_collection = UdsCollections(es_url=os.getenv('ES_URL'), es_port=int(os.getenv('ES_PORT', '443')))
43+
self.__uds_collection = UdsCollections(es_url=os.getenv('ES_URL'), es_port=int(os.getenv('ES_PORT', '443')), es_type=os.getenv('ES_TYPE', 'AWS'))
4444

4545
@property
4646
def successful_features_json(self):

cumulus_lambda_functions/lib/authorization/uds_authorizer_es_identity_pool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
class UDSAuthorizorEsIdentityPool(UDSAuthorizorAbstract):
1414

15-
def __init__(self, es_url: str, es_port=443) -> None:
15+
def __init__(self, es_url: str, es_port=443, es_type='AWS', use_ssl=True) -> None:
1616
super().__init__()
17-
self.__es: ESAbstract = ESFactory().get_instance('AWS',
17+
self.__es: ESAbstract = ESFactory().get_instance(es_type,
1818
index=DBConstants.authorization_index,
1919
base_url=es_url,
20+
use_ssl=use_ssl,
2021
port=es_port)
2122

2223
def add_authorized_group(self, action: [str], resource: [str], tenant: str, venue: str, ldap_group_name: str):
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
import os
2+
13
from mdps_ds_lib.lib.utils.factory_abstract import FactoryAbstract
24

35

46
class UDSAuthorizerFactory(FactoryAbstract):
57
cognito = 'COGNITO'
68

79
def get_instance(self, class_type, **kwargs):
10+
if 'use_ssl' not in kwargs:
11+
kwargs['use_ssl'] = os.getenv('ES_USE_SSL', 'TRUE').strip() is True
12+
if 'es_type' not in kwargs:
13+
kwargs['es_type'] = os.getenv('ES_TYPE', 'AWS')
814
if class_type == self.cognito:
915
from cumulus_lambda_functions.lib.authorization.uds_authorizer_es_identity_pool import \
1016
UDSAuthorizorEsIdentityPool
11-
return UDSAuthorizorEsIdentityPool(kwargs['es_url'], kwargs['es_port'])
17+
return UDSAuthorizorEsIdentityPool(kwargs['es_url'], kwargs['es_port'], kwargs['es_type'], kwargs['use_ssl'])
1218
raise ValueError(f'class_type: {class_type} not implemented')

cumulus_lambda_functions/lib/uds_db/archive_index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ class UdsArchiveConfigIndex:
2525
'archiving_types': {'type': 'array', 'items': {'type': 'object'}},
2626
}
2727
}
28-
def __init__(self, es_url, es_port=443):
29-
self.__es: ESAbstract = ESFactory().get_instance('AWS',
28+
29+
def __init__(self, es_url, es_port=443, es_type='AWS', use_ssl=True):
30+
self.__es: ESAbstract = ESFactory().get_instance(es_type,
3031
index='TODO',
3132
base_url=es_url,
33+
use_ssl=use_ssl,
3234
port=es_port)
3335
self.__tenant, self.__venue = '', ''
3436

cumulus_lambda_functions/lib/uds_db/granules_db_index.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ def __init__(self):
1919
required_env = ['ES_URL']
2020
if not all([k in os.environ for k in required_env]):
2121
raise EnvironmentError(f'one or more missing env: {required_env}')
22-
self.__es: ESAbstract = ESFactory().get_instance('AWS',
22+
self.__es: ESAbstract = ESFactory().get_instance(os.getenv('ES_TYPE', 'AWS'),
2323
index=DBConstants.collections_index,
2424
base_url=os.getenv('ES_URL'),
25-
port=int(os.getenv('ES_PORT', '443'))
25+
port=int(os.getenv('ES_PORT', '443')),
26+
use_ssl=os.getenv('ES_USE_SSL', 'TRUE').strip() is True,
2627
)
2728
# self.__default_fields = {
2829
# "granule_id": {"type": "keyword"},
@@ -36,8 +37,11 @@ def __init__(self):
3637
def to_es_bbox(bbox_array):
3738
# lon = x, lat = y
3839
# lon, lat, lon, lat
40+
# -180, -90, 180, 90
3941
# x can be 170 to -170
4042
# 170, 0, -170, 10
43+
# latitude must be between -90.0 and 90.0
44+
# longitude must be between -180.0 and 180.0
4145
minX, minY, maxX, maxY = bbox_array
4246

4347
# Ensure the values are properly sorted

0 commit comments

Comments
 (0)