Skip to content

4. Setup Lambda Functions

JOHN THORPE edited this page Apr 2, 2021 · 1 revision

Chapter 4. Setup Lambda Functions

Previous page: 3. Prepare Input Dataset | Next page: 5. Run Dorylus | Home: Home

To setup your Lambda functions, you should first create the corresponding function on AWS Lambda cloud console. If your function is accidentally missing on the cloud console, check the "region option" on the upper-right corner of the console. You can only view your services within the correct region.

You can manage your Lambda functions from command line once you created and configured (like memory usage limit per thread) your Lambda function online.

Install Dependencies

You can either manage your functions from your local shell or just on the coordination server. If you'd like to manage them on local shell, you should follow the script gnnman/helpers/coordserver.install to install AWS-SDK & AWS-Lambda-C++ runtime on your local environment as well.

One more dependency issue is about OpenBLAS + CBLAS. You can install them within one command:

Local$ ./funcs/manage-funcs.install

Build & Upload Lambda Functions

Under funcs/ folder, create your lambda function folder just as the existing example forward-prop-josehu. Edit the upload-func script, set the name of your Lambda function to exactly the same as on cloud console. Then build & upload your function by:

Local$ cd funcs/
Local$ ./<FunctionFolder>/upload-func

If the command successfully finishes with a bunch of JSON messages, it means you have successfully uploaded the Lambda Function.

Enable CloudWatch Logs for Your Function

Your Lambda function can only record logs on CloudWatch its execution role has the full permission to CloudWatch. On your function's page, under "Execution role" tag, click "View the ... role", then add "CloudWatchFullAccess" policy for this role.

Then, under "CloudWatch" -- "Log Groups" page, create a log stream with the name /aws/lambda/<YourLambdaFuncName>.

After that, every time this function is issued, its standard output will be logged under "Monitoring" -- "View logs in CloudWatch".

Previous page: 3. Prepare Input Dataset | Next page: 5. Run Dorylus | Home: Home