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

Refactors SCHISM FIM workflow to use AWS Batch w/EC2 compute environment rather than Lambda to save costs #722

Merged
merged 5 commits into from
May 16, 2024

Conversation

shawncrawley
Copy link
Contributor

The SCHISM FIM processing was previously designed to multi-process across Lambda functions. This was amounting to the single most costly line item in HydroVIS. Thus, we looked into different options and settled on switching to using AWS Batch to distribute the processing across a few EC2 machines.

At a high level, this PR does the following:

  • Removes the Terraform code that created the SCHISM FIM Lambda (hv-vpp-*-viz-schism-fim-processing)
  • Adds Terraform code to create AWS Batch resources for SCHISM FIM processing, which includes:
    • Batch compute environment
    • Batch job queue
    • Batch job definition
  • Modifies the Terraform code that creates the SCHISM FIM Step Function workflow to:
    • Replace "Get Domain Tile Basenames" Lambda step with two separate service steps:
      • A "DB Prep" (using the pre-existing vpp-*-viz-postprocess-sql) Lambda step that truncates and prepares the appropriate SCHISM FIM database table
      • A call to "S3: ListObjectsV2" to get the relevant list of tiles to be processed
    • Replace the "Process FIM By Tile" (hv-vpp-*-viz-schism-fim-processing) Lambda with a "Batch: SubmitJob" using the new SCHISM FIM batch job definition/queue/environment
    • Add a "DB Finalize" (using the pre-existing vpp-*-viz-postprocess-sql) Lambda step to create an index on the appropriate SCHISM FIM database table and add the reference_time column.

@shawncrawley
Copy link
Contributor Author

shawncrawley commented May 7, 2024

@nickchadwick-noaa I submitted this as a draft because I believe there are a few touch-ups still required to get this fully working, which I'll point out in in-line comments.

@nickchadwick-noaa nickchadwick-noaa marked this pull request as ready for review May 16, 2024 16:02
@nickchadwick-noaa nickchadwick-noaa merged commit 1389862 into ti May 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants