Giter Site home page Giter Site logo

klayers's Introduction

Keith's Layers (Klayers)

๐Ÿ A collection of Python Packages as AWS Lambda(ฮป) Layers ๐Ÿ

Python 3.8 Language grade: Python Code style: black

Layer List

List of all layer version arns are available by region here

There might be multiple versions for a single package, as we publish a new layer version if the package dependencies (requirements.txt) has been updated. Refer to Layer expiry for more data.

Note: We have deprecated layers for python3.6 and python 3.7, please use these newer versions that are built for python 3.8 going forward.

Python Packages

Just some examples of the ~70 packages we build every week, for a full list click here:

  • aws-lambda-powertools
  • aws-xray-sdk
  • bcrypt
  • beautifulsoup4
  • boto3
  • dynamodb-encryption-sdk
  • idna
  • lambda-cache
  • nltk
  • numpy
  • opencv-python-headless
  • openpyxl
  • pandas
  • parliament
  • Pillow
  • pulp
  • pycryptodome
  • PyJWT
  • PyMUPDF
  • pyqldb
  • pytesseract
  • pytz
  • PyYAML
  • requests
  • slackclient
  • spacy
  • ...

Status of layers

Click here to see specific dependencies of all the latest builds. Layers are built with the latest package version at 2am UTC every Sunday.

Using the Layers

You can use the layers anyway you see fit, here are 3 proposed options:

Option 1: Set ARN as layer

Click links below for your preferred version of python, and then select your region of choice, you will see a full list of layer version ARNs to use.

Once selected, you can add the arn directly from the console, by selecting Layers->Add a Layer->Specify an Arn:

Screenshot

Option 2: Download copy of layer

Use the Get Layer Version by ARN in python or aws-cli command which will provide an S3 location to download the layer as a zip.

Note: You can only get layers from the specific region your client is configured for, otherwise you'll get a AccessDeniedException error.

Option 3: Using Serverless Framework

You can include layers in your deployments, by utilizing the layers property at the function level, and setting it to the arn of your choice. You must use layers from the same region as your function:

check:
  handler: 02_pipeline/check.main
  description: Checks for package on PyPi via the API
  runtime: python3.8
  timeout: 30
  memorySize: 256
  layers:
  - arn:aws:lambda:${self:provider.region}:113088814899:layer:Klayers-python37-packaging:1
  - arn:aws:lambda:${self:provider.region}:113088814899:layer:Klayers-python38-aws-lambda-powertools:23

Layer expiry

Some layer versions will have a expiry_date field. This is the date for when the layers will be deleted.

In general, layers are scheduled for deletion 60 days after a new layer version has been published for that package. If you use that latest version of a layer, you're guaranteed at least 60 days before the layer is deleted.

All functions deployed with a layer will still work indefinitely, but you won't be able to deploy new functions referencing a deleted layer version.

Binaries

Special hand-crafted binaries for layers. These layers are not automatically built, and hence slower update cycles, and will only work with python3.7 functions as the underlying OS is Amazon Linux 1.

Package ARN Version
pip arn:aws:lambda:<region>:113088814899:layer:Klayers-python37-pip:2 19.2.1 1
en_core_web_sm arn:aws:lambda:<region>:770693421928:layer:Klayers-python38-spacy_model_en_small:1 2.2.5 2
es_core_news_sm arn:aws:lambda:<region>:770693421928:layer:Klayers-python38-spacy_model_es_small:1 2.3.1 2

1 Python3.8 layers already have new version of pip, use only if on Python3.7

2 Spacy en_core_web_sm model, for use with the spacy layer refer here for more info.

Architecture Diagram

Screenshot

API (beta)

We've recently added an API under beta. All API calls are http-based, and work only with https (TLS1.2 and above). The API is heavily cached, so there could be minor delays in updates.

Get latest ARN for specific package in region

Returns data on the latest layer for a specific {package} in a specific {region}

https://api.klayers.cloud/api/v1/layers/latest/{region}/{package}

example:

Get all ARNs for specific package in region

Returns data on the all layers (latest and deprecated) for a specific {package} in a specific {region}

https://api.klayers.cloud/api/v1/layers/{region}/{package}

example:

Get list of all built packages

Returns list of all packages currently being built, including dependencies and build date.

https://api.klayers.cloud/api/v1/builds/latest

example:

Special Thanks

Asking for additional layers

If you would like a new package to be made a layer, raise a pull request modifying the pipeline/config/Klayers-prodp38 file.

klayers's People

Contributors

keithrozario avatar klayersbot avatar adriaanbd avatar rommellayco avatar shwetajoshi601 avatar

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.