Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v7.1.1 #2243

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
- package-ecosystem: pip
directory: /
schedule:
interval: "daily"
interval: weekly
labels:
- "bumpless"
- package-ecosystem: "github-actions"
directory: "/"
- bumpless
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
interval: weekly
labels:
- "bumpless"
- bumpless
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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).

## [7.1.1]
### Changed
- Reduced `start_execution_manager` batch size from 600 jobs to 500 jobs. Fixes [#2241](https://github.com/ASFHyP3/hyp3/issues/2241).

## [7.1.0]
### Added
- A `hyp3-its-live-test` deployment to [`deploy-enterprise-test.yml`](.github/workflows/deploy-enterprise-test.yml) for ITS_LIVE testing in preparation for some significant ITS_LIVE project development
Expand Down
4 changes: 2 additions & 2 deletions apps/start-execution-manager/src/start_execution_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def lambda_handler(event, context) -> None:
worker_function_arn = os.environ['START_EXECUTION_WORKER_ARN']
logger.info(f'Worker function ARN: {worker_function_arn}')

pending_jobs = dynamo.jobs.get_jobs_waiting_for_execution(limit=600)
pending_jobs = dynamo.jobs.get_jobs_waiting_for_execution(limit=500)
logger.info(f'Got {len(pending_jobs)} pending jobs')

batch_size = 300
batch_size = 250
for i in range(0, len(pending_jobs), batch_size):
jobs = pending_jobs[i:i + batch_size]
logger.info(f'Invoking worker for {len(jobs)} jobs')
Expand Down
24 changes: 12 additions & 12 deletions tests/test_start_execution_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,41 @@ def test_invoke_worker():
)


def test_lambda_handler_600_jobs():
def test_lambda_handler_500_jobs():
with patch('dynamo.jobs.get_jobs_waiting_for_execution') as mock_get_jobs_waiting_for_execution, \
patch('start_execution_manager.invoke_worker') as mock_invoke_worker, \
patch.dict(os.environ, {'START_EXECUTION_WORKER_ARN': 'test-worker-function-arn'}, clear=True):
mock_jobs = list(range(600))
mock_jobs = list(range(500))
mock_get_jobs_waiting_for_execution.return_value = mock_jobs

mock_invoke_worker.return_value = {'StatusCode': None}

start_execution_manager.lambda_handler(None, None)

mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=600)
mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=500)

assert mock_invoke_worker.mock_calls == [
call('test-worker-function-arn', mock_jobs[0:300]),
call('test-worker-function-arn', mock_jobs[300:600]),
call('test-worker-function-arn', mock_jobs[0:250]),
call('test-worker-function-arn', mock_jobs[250:500]),
]


def test_lambda_handler_500_jobs():
def test_lambda_handler_400_jobs():
with patch('dynamo.jobs.get_jobs_waiting_for_execution') as mock_get_jobs_waiting_for_execution, \
patch('start_execution_manager.invoke_worker') as mock_invoke_worker, \
patch.dict(os.environ, {'START_EXECUTION_WORKER_ARN': 'test-worker-function-arn'}, clear=True):
mock_jobs = list(range(500))
mock_jobs = list(range(400))
mock_get_jobs_waiting_for_execution.return_value = mock_jobs

mock_invoke_worker.return_value = {'StatusCode': None}

start_execution_manager.lambda_handler(None, None)

mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=600)
mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=500)

assert mock_invoke_worker.mock_calls == [
call('test-worker-function-arn', mock_jobs[0:300]),
call('test-worker-function-arn', mock_jobs[300:500]),
call('test-worker-function-arn', mock_jobs[0:250]),
call('test-worker-function-arn', mock_jobs[250:400]),
]


Expand All @@ -102,7 +102,7 @@ def test_lambda_handler_50_jobs():

start_execution_manager.lambda_handler(None, None)

mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=600)
mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=500)

assert mock_invoke_worker.mock_calls == [
call('test-worker-function-arn', mock_jobs),
Expand All @@ -117,6 +117,6 @@ def test_lambda_handler_no_jobs():

start_execution_manager.lambda_handler(None, None)

mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=600)
mock_get_jobs_waiting_for_execution.assert_called_once_with(limit=500)

mock_invoke_worker.assert_not_called()
Loading