Skip to content

Commit 59a47cf

Browse files
Merge pull request #2990 from ASFHyP3/develop
Release v10.12.1
2 parents 14ae973 + 8d2a74f commit 59a47cf

File tree

10 files changed

+38
-40
lines changed

10 files changed

+38
-40
lines changed

CHANGELOG.md

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

7+
## [10.12.1]
8+
9+
### Fixed
10+
- Doubled the memory requirement for `INSAR_ISCE_MULTI_BURST` jobs at 20x4 looks and >= 13 burst pairs. As a result, the credit cost for such jobs as also doubled from 5 to 10. Fixes https://github.com/ASFHyP3/hyp3/issues/2933
11+
- ScaleCluster now takes no action when desired vCPUs only marginally exceeds target vCPUs. Fixes https://github.com/ASFHyP3/hyp3/issues/2965
12+
713
## [10.12.0]
814

915
### Added

apps/scale-cluster/src/scale_cluster.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def get_month_to_date_spending(today: date) -> float:
2626

2727
def get_current_desired_vcpus(compute_environment_arn: str) -> int:
2828
response = BATCH.describe_compute_environments(computeEnvironments=[compute_environment_arn])
29-
compute_resources = response['computeEnvironments'][0]['computeResources']
30-
return min(compute_resources['desiredvCpus'], compute_resources['maxvCpus'])
29+
return response['computeEnvironments'][0]['computeResources']['desiredvCpus']
3130

3231

3332
def set_max_vcpus(compute_environment_arn: str, target_max_vcpus: int, current_desired_vcpus: int) -> None:
@@ -39,7 +38,7 @@ def set_max_vcpus(compute_environment_arn: str, target_max_vcpus: int, current_d
3938
computeResources=compute_resources,
4039
state='ENABLED',
4140
)
42-
else:
41+
elif current_desired_vcpus > target_max_vcpus * 1.05:
4342
print(
4443
f'Disabling {compute_environment_arn}. Current desiredvCpus {current_desired_vcpus} is larger than '
4544
f'target maxvCpus {target_max_vcpus}'
@@ -48,6 +47,11 @@ def set_max_vcpus(compute_environment_arn: str, target_max_vcpus: int, current_d
4847
computeEnvironment=compute_environment_arn,
4948
state='DISABLED',
5049
)
50+
else:
51+
print(
52+
f'Doing nothing with {compute_environment_arn}. Current desiredvCpus {current_desired_vcpus} only '
53+
f'marginally exceeds target maxvCpus {target_max_vcpus}'
54+
)
5155

5256

5357
def get_target_max_vcpus(

apps/set-batch-overrides/src/set_batch_overrides.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_insar_isce_burst_memory(job_parameters: dict) -> str:
6666
if bursts < 31:
6767
return INSAR_ISCE_BURST_MEMORY_32G
6868
if looks == '20x4':
69-
if bursts < 16:
69+
if bursts < 13:
7070
return INSAR_ISCE_BURST_MEMORY_8G
7171
if bursts < 31:
7272
return INSAR_ISCE_BURST_MEMORY_16G

job_spec/INSAR_ISCE_MULTI_BURST.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ INSAR_ISCE_MULTI_BURST:
6060
10: 5.0
6161
11: 5.0
6262
12: 5.0
63-
13: 5.0
64-
14: 5.0
65-
15: 5.0
63+
13: 10.0
64+
14: 10.0
65+
15: 10.0
6666
10x2:
6767
1: 1.0
6868
2: 1.0

requirements-all.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
-r requirements-apps-disable-private-dns.txt
66
-r requirements-apps-search-archive.txt
77
-r requirements-apps-update-db.txt
8-
boto3==1.41.2
8+
boto3==1.42.0
99
jinja2==3.1.6
10-
moto[dynamodb]==5.1.17
10+
moto[dynamodb]==5.1.18
1111
pytest==9.0.1
1212
PyYAML==6.0.3
1313
responses==0.25.8
14-
ruff==0.14.6
15-
mypy==1.18.2
14+
ruff==0.14.7
15+
mypy==1.19.0
1616
setuptools==80.9.0
1717
setuptools_scm==9.2.2
1818
openapi-spec-validator==0.7.2
19-
cfn-lint==1.41.0
19+
cfn-lint==1.42.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
boto3==1.41.2
1+
boto3==1.42.0

requirements-apps-get-files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
boto3==1.41.2
1+
boto3==1.42.0
22
./lib/dynamo/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
boto3==1.41.2
1+
boto3==1.42.0
22
./lib/dynamo/
33
./lib/lambda_logging/

tests/test_scale_cluster.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -128,40 +128,28 @@ def test_get_current_desired_vcpus(batch_stubber):
128128
)
129129
assert scale_cluster.get_current_desired_vcpus('foo') == 5
130130

131-
expected_params = {'computeEnvironments': ['bar']}
132-
service_response = {
133-
'computeEnvironments': [
134-
{
135-
'computeEnvironmentName': 'environment name',
136-
'computeEnvironmentArn': 'environment arn',
137-
'ecsClusterArn': 'cluster arn',
138-
'computeResources': {
139-
'type': 'MANAGED',
140-
'desiredvCpus': 8,
141-
'maxvCpus': 7,
142-
'subnets': ['subnet1', 'subnet2'],
143-
},
144-
},
145-
]
146-
}
147-
batch_stubber.add_response(
148-
method='describe_compute_environments', expected_params=expected_params, service_response=service_response
149-
)
150-
assert scale_cluster.get_current_desired_vcpus('bar') == 7
151-
152131

153132
def test_set_max_vcpus(batch_stubber):
154133
expected_params = {'computeEnvironment': 'foo', 'computeResources': {'maxvCpus': 10}, 'state': 'ENABLED'}
155134
batch_stubber.add_response(
156135
method='update_compute_environment', expected_params=expected_params, service_response={}
157136
)
158-
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=10, current_desired_vcpus=10)
137+
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=10, current_desired_vcpus=0)
138+
139+
expected_params = {'computeEnvironment': 'bar', 'computeResources': {'maxvCpus': 10}, 'state': 'ENABLED'}
140+
batch_stubber.add_response(
141+
method='update_compute_environment', expected_params=expected_params, service_response={}
142+
)
143+
scale_cluster.set_max_vcpus(compute_environment_arn='bar', target_max_vcpus=10, current_desired_vcpus=10)
159144

160145
expected_params = {'computeEnvironment': 'foo', 'state': 'DISABLED'}
161146
batch_stubber.add_response(
162147
method='update_compute_environment', expected_params=expected_params, service_response={}
163148
)
164-
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=10, current_desired_vcpus=11)
149+
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=100, current_desired_vcpus=106)
150+
151+
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=100, current_desired_vcpus=101)
152+
scale_cluster.set_max_vcpus(compute_environment_arn='foo', target_max_vcpus=100, current_desired_vcpus=105)
165153

166154

167155
def test_get_month_to_date_spending(cost_explorer_stubber):

tests/test_set_batch_overrides.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_set_batch_overrides_insar_isce_burst_10x2():
126126

127127

128128
def test_set_batch_overrides_insar_isce_burst_20x4():
129-
for n in range(1, 16):
129+
for n in range(1, 13):
130130
assert lambda_handler(mock_insar_isce_burst_job('20x4', bursts=n), None) == {
131131
'ResourceRequirements': [
132132
{
@@ -136,7 +136,7 @@ def test_set_batch_overrides_insar_isce_burst_20x4():
136136
],
137137
'Environment': [{'Name': 'OMP_NUM_THREADS', 'Value': '1'}],
138138
}
139-
for n in range(16, 31):
139+
for n in range(13, 31):
140140
assert lambda_handler(mock_insar_isce_burst_job('20x4', bursts=n), None) == {
141141
'ResourceRequirements': [
142142
{

0 commit comments

Comments
 (0)