• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tk3369/aws-lambda-container-julia: An example of running Julia program as AWS La ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

tk3369/aws-lambda-container-julia

开源软件地址:

https://github.com/tk3369/aws-lambda-container-julia

开源编程语言:

Julia 61.5%

开源软件介绍:

aws-lambda-container-julia

As of December 2020, AWS supports running Lambda functions from any container image. This is an example of deploying Julia program as AWS lambda.

How it works

The Dockerfile uses an AWS provided base image. It is more convenient because their base image already includes the Runtime Interface Emulator (RIE). It would be possible to use a different base image but then the RIE has to be installed separately. Julia is downloaded and installed from the official julialang.org web site.

Project content are copied to the standard deployment directory /var/task. By setting JULIA_DEPOT_PATH environment variable, the precompiled files will be stored in a known location.

Note that AWS Lambda provides a read-only file system. If needed, the JULIA_DEPOT_PATH can be reset to include /tmp/.julia for additional precompilation during runtime. See AWS FAQ for container images for more information.

As required, Lambda functions must support the Lambda Runtime API. The main.jl file implements the general workflow of this API, which involves fetching lambda invocation requests, calling the handle_event function, and reporting results back to the Lambda execution environment. This runtime is normally provided by AWS for the officially supported languages. For Julia, we're just rolling our own.

This main program delegates lambda requests to the underlying module. In this case, it's called JuliaLambdaExample. The module must define a function called handle_event and the function must accept two arguments - event_data and headers. The return value of this function is then passed back to the lambda environment.

How to use this repo

To build your own AWS Lambda function, you can copy this repo and rename the JuliaLambdaExample to whatever you want. Just make sure that all references are renamed properly.

There is a convenient shell script in scripts/deploy.sh that can be used to quickly build/tag/push a Docker image and deploy the function on AWS.

For example:

sh scripts/deploy.sh julia-lambda latest

The script does not deploy the lambda function unless it is already created. Hence, just for the first time, you must create the lambda function using your preferred approach (web interface, cloud formation, CDK, etc.)

Contributions welcome!

Feel free to raise an issue or PR if you would like to contribute to this repo.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
JuliaGPU/CLBLAS.jl: CLBLAS integration for Julia发布时间:2022-07-09
下一篇:
JuliaData/RData.jl: Read R data files from Julia发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap