Code Monkey home page Code Monkey logo

aws-lambda-test's Introduction

AWS Lambda Sample

This project contains a sample of an AWS Lambda function that performs a simple transfomration of MARC21-encoded files to MARC-In-JSON.

The purpose of this project is to provide a means of estimating the cost of using AWS services to perform "burst-style" processing in order to get a sense of the cost-effectiveness of the approach.

How It Works

An AWS Lambda function is a single function call that can be invoked by a number of different triggers. When the trigger is fired, AWS instantiates a server, sets up the environment, and invokes the function on that server, then shuts down after the function call is complete. In principle, this allows users to pay for only the amount of processing they actually use.

In this partciular instance, the Lambda function edu.ncsu.lib.aws.handlers.MARCHandler.handleRequest is designed to receive notifications that files have been deposited in a particular Amazon S3 bucket, transform them, and deposit the results into a different bucket. This is proof-of-concept code, and so for simplicity's sake the inputs are MARC21 encoded files and the outputs are those inputs converted to MARC-in-JSON format. To a certain extent, this mimics one part of the workflow of maintaining a shared index:

  • an institution uploads files in "Format X"
  • without further intervention from the uploader, processing is done on those files to transform the records into files that can be ingested by Solr.

A complete description of the setup in AWS for all of this is beyond the scope of this README.

Building

The only requirement on the build system is a Java 8 JDK. To build, invoke ./gradlew shadowJar (or ./gradlew.bat shadowJar on Windows); this will download a suitable version of gradle and build the output. The result will be stored in build/libs/aws-lambda-test-all.jar -- this is a complete jar file containing all dependencies for the function, and can be uploaded directly to AWS via the console. I have not taken the time to set up uploading via the tools provided by AWS.

N.B. As of initial commit, the unit tests do not successfully complete, but the function has been run successfully on AWS multiple times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.