Skip to content

seasketch/marlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running marlin in AWS Lambda

Lambda-based worker for running the R package marlin and integrating with geoprocessing.

This system relies on Lambda's support for containerized functions using a Dockerfile so that R can be included in the runtime environment, and lambdr which coordinates I/O between R and AWS.

Creates a docker image rlambda which is then hosted on AWS ECR. This image can be used to create a new Lambda function called run_marlin (must match name of function in runtime.R). See marlin reports for an example of using in SeaSketch.

Assumptions

(1) Perfect compliance with MPA no-take designations (2) All no-take MPAs for target species

Structure

Dockerfile: Builds image capable of running R and marlin in AWS lambda environment

runtime.R: Function which is individually called and run in lambda

local.R: Contains all the code to (1) setup required inputs for runtime.R and (2) reproduce plots locally

data: Contains all data inputs necessary for marlin

  • reef_ras.tif: Input reef dataset

  • reef_ras.csv: Generated by reef_ras.tif in local.R and used in runtime.R

  • seagrass_ras.tif: Input seagrass dataset

  • seagrass_ras.csv: Generated by seagrass_ras.tif in local.R and used in runtime.R

  • seagrass_reef_ras.tif: Input seagrass reef dataset

  • seagrass_reef_ras.csv: Generated by seagrass_reef_ras.tif in local.R and used in runtime.R

  • Existing-MPAs.geojson.json: Existing Belize MPA polygons

  • existingMPAs.json: Output of running marlin with Existing-MPAs.geojson.json in local.R, used in comparison plot in SeaSketch

  • noMPA.json: Output of running marlin with no MPAs in local.R, used in comparison plot in SeaSketch

  • sketch.geojson.json: Test proposed MPA polygons, used in running and testing runtime.R and running locally

  • coordinates.json: X and Y coordinates within Belize study area, generated in local.R, used in SeaSketch

Update docker image

docker build --progress=plain -t rlambda .

aws ecr create-repository --repository-name marlin --image-scanning-configuration scanOnPush=true

docker tag rlambda:latest [REPOSITORY_URL]:latest

docker push [REPOSITORY_URL]:latest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published