Coder Social home page Coder Social logo

amazon-archives / aws-lambda-container-image-converter Goto Github PK

View Code? Open in Web Editor NEW
1.3K 28.0 72.0 74.48 MB

The AWS Lambda container image converter tool (img2lambda) repackages container images (such as Docker images) into AWS Lambda function deployment packages and Lambda layers.

License: MIT No Attribution

Dockerfile 4.67% Makefile 6.07% PHP 3.91% Go 75.65% Shell 9.71%

aws-lambda-container-image-converter's Introduction

Note: this project is now archived! AWS Lambda now natively supports packaging your function code as a container image and providing the image directly to Lambda. https://aws.amazon.com/about-aws/whats-new/2020/12/aws-lambda-now-supports-container-images-as-a-packaging-format/

AWS Lambda Container Image Converter

This container image converter tool (img2lambda) extracts an AWS Lambda function deployment package from a container image (such as a Docker image). It also extracts AWS Lambda layers from a container image, and publishes them as new layer versions to Lambda.

img2lambda Demo

To extract a Lambda function deployment package, the tool copies all files under '/var/task' in the container image into a deployment package zip file.

To extract Lambda layers, the tool copies all files under '/opt' in the container image, repackaging the individual container image layers as individual Lambda layer zip files. The published layer ARNs are stored in a file 'output/layers.json', which can be used as input when creating Lambda functions. Each layer is named using a "namespace" prefix (like 'img2lambda' or 'my-docker-image') and the SHA256 digest of the container image layer, in order to provide a way of tracking the provenance of the Lambda layer back to the container image that created it. If a layer is already published to Lambda (same layer name, SHA256 digest, and size), it will not be published again. Instead the existing layer version ARN will be written to the output file.

Table of Contents

Usage

USAGE:
   img2lambda [options]

GLOBAL OPTIONS:
   --image value, -i value                 Name or path of the source container image. For example, 'my-docker-image:latest' or './my-oci-image-archive'. The image must be pulled locally already.
   --image-type value, -t value            Type of the source container image. Valid values: 'docker' (Docker image from the local Docker daemon), 'oci' (OCI image archive at the given path and optional tag) (default: "docker")
   --region value, -r value                AWS region (default: "us-east-1")
   --profile value, -p value               AWS credentials profile. Credentials will default to the same chain as the AWS CLI: environment variables, default profile, container credentials, EC2 instance credentials
   --output-directory value, -o value      Destination directory for output: function deployment package (function.zip) and list of published layers (layers.json, layers.yaml) (default: "./output")
   --layer-namespace value, -n value       Prefix for the layers published to Lambda (default: "img2lambda")
   --dry-run, -d                           Conduct a dry-run: Repackage the image, but only write the Lambda layers to local disk (do not publish to Lambda)
   --description value, --desc value       The description of this layer version (default: "created by img2lambda from image <name of the image>")
   --license-info value, -l value          The layer's software license. It can be an SPDX license identifier, the URL of the license hosted on the internet, or the full text of the license (default: no license)
   --compatible-runtime value, --cr value  An AWS Lambda function runtime compatible with the image layers. To specify multiple runtimes, repeat the option: --cr provided --cr python2.7 (default: "provided")
   --help, -h                              show help
   --version, -v                           print the version

Note: To avoid any sensitive information being packaged into a Lambda function deployment package or Lambda layer, do not store any sensitive information like credentials in the source container image's /opt or /var/task directories.

Install

Binaries

Download pre-built binaries from the Releases Page.

From Source

With go 1.11+:

$ git clone https://github.com/awslabs/aws-lambda-container-image-converter
$ cd aws-lambda-container-image-converter
$ make
$ ./bin/local/img2lambda --help

Permissions

No credentials are required for dry-runs of the img2lambda tool. When publishing layers to Lambda, img2lambda will look for credentials in the following order (using the default provider chain in the AWS SDK for Go).

  1. Environment variables.
  2. Shared credentials file.
  3. If running on Amazon ECS (with task role) or AWS CodeBuild, IAM role from the container credentials endpoint.
  4. If running on an Amazon EC2 instance, IAM role for Amazon EC2.

The credentials must have the following permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "MinimalPermissions",
            "Effect": "Allow",
            "Action": [
                "lambda:GetLayerVersion",
                "lambda:ListLayerVersions",
                "lambda:PublishLayerVersion"
            ],
            "Resource": [
                "arn:aws:lambda:<REGION>:<ACCOUNT ID>:layer:<LAYER NAMESPACE>-sha256-*",
                "arn:aws:lambda:<REGION>:<ACCOUNT ID>:layer:<LAYER NAMESPACE>-sha256-*:*"
            ]
        }
    ]
}

For example:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "MinimalPermissions",
            "Effect": "Allow",
            "Action": [
                "lambda:GetLayerVersion",
                "lambda:ListLayerVersions",
                "lambda:PublishLayerVersion"
            ],
            "Resource": [
                "arn:aws:lambda:us-east-1:123456789012:layer:img2lambda-sha256-*",
                "arn:aws:lambda:us-east-1:123456789012:layer:img2lambda-sha256-*:*"
            ]
        }
    ]
}

Examples

Docker Example

Build the example Docker image to create a PHP Lambda custom runtime and Hello World PHP function:

cd example

docker build -t lambda-php .

The Hello World function can be invoked locally by running the Docker image:

docker run lambda-php hello '{"name": "World"}'

docker run lambda-php goodbye '{"name": "World"}'

Run the tool to both create a Lambda deployment package that contains the Hello World PHP function, and to create and publish Lambda layers that contain the PHP custom runtime:

../bin/local/img2lambda -i lambda-php:latest -r us-east-1 -o ./output

OCI Example

Create an OCI image from the example Dockerfile:

cd example

podman build --format oci -t lambda-php .

podman push lambda-php oci-archive:./lambda-php-oci

Run the tool to both create a Lambda deployment package that contains the Hello World PHP function, and to create and publish Lambda layers that contain the PHP custom runtime:

../bin/local/img2lambda -i ./lambda-php-oci -t oci -r us-east-1 -o ./output

Deploy Manually

Create a PHP function that uses the layers and deployment package extracted from the container image:

aws lambda create-function \
    --function-name php-example-hello \
    --handler hello \
    --zip-file fileb://./output/function.zip \
    --runtime provided \
    --role "arn:aws:iam::XXXXXXXXXXXX:role/service-role/LambdaPhpExample" \
    --region us-east-1 \
    --layers file://./output/layers.json

Finally, invoke the function:

aws lambda invoke \
    --function-name php-example-hello \
    --region us-east-1 \
    --log-type Tail \
    --query 'LogResult' \
    --output text \
    --payload '{"name": "World"}' hello-output.txt | base64 --decode

cat hello-output.txt

Deploy with AWS Serverless Application Model (SAM)

See the sample template.yaml and the sample template.json.

Insert the layers ARNs into the function definition:

cd example/deploy

sed -i 's/^- /      - /' ../output/layers.yaml && \
    sed -e "/LAYERS_PLACEHOLDER/r ../output/layers.yaml" -e "s///" template.yaml > template-with-layers.yaml

OR

cd example/deploy

sed -e "/\"LAYERS_PLACEHOLDER\"/r ../output/layers.json" -e "s///" template.json | jq . > template-with-layers.json

Deploy the function:

sam package --template-file template-with-layers.yaml \
            --output-template-file packaged.yaml \
            --region us-east-1 \
            --s3-bucket <bucket name>

sam deploy --template-file packaged.yaml \
           --capabilities CAPABILITY_IAM  \
           --region us-east-1 \
           --stack-name img2lambda-php-example

OR

sam package --template-file template-with-layers.json \
            --output-template-file packaged.json \
            --region us-east-1 \
            --s3-bucket <bucket name>

sam deploy --template-file packaged.json \
           --capabilities CAPABILITY_IAM  \
           --region us-east-1 \
           --stack-name img2lambda-php-example

Invoke the function:

aws lambda invoke \
    --function-name sam-php-example-hello \
    --region us-east-1 \
    --log-type Tail \
    --query 'LogResult' \
    --output text \
    --payload '{"name": "World"}' hello-output.txt | base64 --decode

cat hello-output.txt

Deploy with Serverless Framework

See the sample serverless.yml for how to use the img2lambda-generated layers in your Serverless function.

Deploy the function:

cd example/deploy

serverless deploy -v

Invoke the function:

serverless invoke -f hello -l -d '{"name": "World"}'

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

Security Disclosures

If you would like to report a potential security issue in this project, please do not create a GitHub issue. Instead, please follow the instructions here or email AWS security directly.

aws-lambda-container-image-converter's People

Contributors

arashilmg avatar asahasrabuddhe avatar cjensenius avatar clareliguori avatar dbramwell avatar dependabot-preview[bot] avatar dependabot[bot] avatar devokun avatar gliptak avatar matthewpoer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-lambda-container-image-converter's Issues

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /img2lambda/Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

fail to run in wsl

While running the tool under wsl (Windows Subsystem for Linux), it shows the following error -

Error loading image from docker engine: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I can run and build the docker images using the docker command.

Will you be able to change the local socket dependency ? docker info result is below

Containers: 3
Running: 0
Paused: 0
Stopped: 3
Images: 11
Server Version: 18.09.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 96ec2177ae841256168fcf76954f7177af9446eb
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.837GiB
Name: linuxkit-00155df88701
ID: 43BH:53TT:6MAF:XAIP:MHPN:KSQU:42NS:YEPJ:HWOL:SLZ2:MHJU:3FMH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 22
Goroutines: 47
System Time: 2019-01-24T06:18:10.6113087Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Provide option for daemon on Windows 7

Windows 7 Issue

If you could provide a flag/option on the build to point the daemon at a different port, this would resolve the issue.

When DockerToolbox installs, it points the daemon to 2376 on Windows 7. Windows 10 (Docker desktop) provides an option to bind to port 2375.

Expected output

Lambda layer deployed to AWS

Actual output

2019/06/21 16:36:55 Parsing the image docker-daemon:af:latest 2019/06/21 16:36:55 Error loading image from docker engine: error during connect: Get https://%2F%2F.%2Fpipe%2Fdocker_engine/v1.22/images/get?names=af%3Alatest: dial tcp: lookup //./pipe/docker_engine: no such host

help with installation

Hi all, thanks for this, very cool. Apologies if this is too newbie of a question but I'm trying to utilize the darwin binaries on my mac, preferring not to build from source. I downloaded and attempted to run via targeting from bash but darwin-amd64-img2lamba is not recognized

sensei:~ *******$ sudo /Downloads/darwin-amd64-img2lambda --version
Password:
sudo: /Users/elcapitano/Downloads/darwin-amd64-img2lambda: command not found
sensei:
*******$

Should I be able to use the darwin-amd64-img2lambda on mac out of the box, anything I'm missing on how to utilize the binary?

Thanks!

Feature: Support AWS Batch

It would be amazing to be able to deploy the same code to AWS Lambda and AWS Batch with an initial queue size of zero for longer running jobs. It would compile to a lambda trigger that kicked off the batch job.

Happy to write a PR myself, but I need a little direction on the best workflow. Would it be as easy as calling the existing https://github.com/aws/aws-parallelcluster scripts?

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /img2lambda/Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Using assumed role profile puts layer in wrong account

Hi I'm using an assumed role profile as follows:

img2lambda -i built-image:latest --profile otheraccount

and it is uploading the layer to the account for my default profile rather than the otheraccount profile. Seems like this should be using the account id for otheraccount based on the docs so I'm thinking its a configuration issue but all other aws cli stuff works so I'm a bit stuck.

My aws configs look like this:

~/.aws/config

[default]
region = us-east-1
output = json

[profile otheraccount]
role_arn = arn:aws:iam::<other-account-id>:role/AccountAccessRole
source_profile = default

~/.aws/credentials

[default]
aws_access_key_id=<key>
aws_secret_access_key=<secret>

[otheraccount]
role_arn = arn:aws:iam::<other-account-id>:role/AccountAccessRole
source_profile = default
region = us-east-1

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /img2lambda/Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Layer creation error

Hey, I have a container where I build vips and then copy it to the /opt directory with

RUN cp -r /lib/*.so.* /opt/lib/
RUN cp -r /lib64/*.so.* /opt/lib/

Now when trying to run the script, it fails at the relevant image with the error

2019/11/28 13:25:16 could not read layer with tar nor tar.gz: walking libvips-cpp.so.42 in layer tar: lib/libvips-cpp.so.42: readlink: readlink lib/libvips-cpp.so.42: no such file or directory, opening next file in layer tar: archive/tar:
 invalid tar header                        

Do you know what the problem here is?

Size error when creating large layers

I received an

RequestEntityTooLargeException: Request must be smaller than 69905067 bytes for the PublishLayerVersion operation
        status code: 413, request id: e1d98462-c8e8-42de-92ed-3b93928acc8e

error when trying to publish a layer which is bigger than 50mb. With Serverless, it's possible to upload layer which are larger, because it first uploads it to S3 and then uses the uploaded zip file as source for the layer.

Permission error when running script

Hey, I am trying to run your script on a container, but I get the permisison error

2019/11/28 12:49:46 error creating temp directory: error untarring file "/var/tmp/oci121211700": lchown /var/tmp/oci121211700/blobs: operation not permitted

Is there a simple way to solve this except for running the script as super user?

Feature: De-dupe Lambda layers

Currently, running the img2lambda tool multiple always updates the published layers to a new version number, even if the content hasn't change.

De-dupe Lambda layers before publishing them: compare local file's SHA256 to published layer versions with the same name

Uses Default AWS Profile with no option to change

I work on several projects that leverage different AWS profiles and I notice that when building a lambda runtime using this tool, the output/layers.json file produced references the account id of my default profile. I have no way to specify the desired profile name and so the layers are built in the wrong AWS account.

To work-around this, I have to shift around my ~/.aws/credentials file so that the account I want to use is [default], then shift it back after using img2lambda.

It would be helpful if img2lambda accepted a --profile argument similar to awscli.

SAM Deployment?

Is it possible to have this workflow be a part of SAM / Cloudformation?

Feature: Extract function deployment packages

Docker build is useful for building function code too! Support a mode that extracts files from /var/task/src (for function deployment package) instead of /opt (used for layers).

Error loading image from docker engine: error during connect: (Windows 10 Pro)

Hi.

I use it in windows 10.

$ img2lambda -i lambda-tesseract-ocr_tesseract:latest -r ap-northeast-1 -o 
./output
2019/10/16 10:24:00 Parsing the docker image docker-daemon:lambda-tesseract-ocr_tesseract:latest
2019/10/16 10:24:00 Error loading image from docker engine: error during connect: Get https://%2F%2F.%2Fpipe%2Fdocker_engine/v1.22/images/get?names=lambda-tesseract-ocr_tesseract%3Alatest: dial tcp: lookup //./pipe/docker_engine: no such host

Docker TLS check is enabled
WS000000

And the environment variable sets the value.

$ echo %DOCKER_HOST% 
tcp://localhost:2375

How can I verify the validity of the tcp://localhost:2375 ?

thanks.

Feature: Support OCI images

The image library used supports reading OCI images, with the format "oci:path:tag"

For extracting each layer's blob, OCI images can be either tar or tar.gz, based on the layer's media type.

Bug: no relevant files found

Hi I run your commands but encounter this issue

./bin/local/img2lambda -i zaobao_drush:latest
2019/05/29 18:09:49 Parsing the docker image docker-daemon:zaobao_drush:latest
2019/05/29 18:10:12 Image docker-daemon:zaobao_drush:latest has 21 layers
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:7bff100f35cb359a368537bb07829b055fe8e0b1cb01085a3a628ae9c187c7b8 (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:b57f3f21236a88541bddd22ccc18a7e54b4eeb05756bc4cb295e8bd555a0fd81 (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:30461eee5472d34544daa3acf0f0f1ec1a0c396406d676a06947010d8a86d5fb (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:70c6d1eb014488ec8355c7878c0ead807da686e8173e0ebac0fdcf49e05e770d (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:c4bf75cee0e1f53ff4dfe80da8173f8f3e88019c38866c386f53b0745d86dc5c (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:c2feeff076f9a0996b6a6cf528a11a4dcb180240f45b2abdde02ed784616d6a9 (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:a058b24dac4735e049423c9f493e1a7b4a2f14094fc3819458911786a9cb7881 (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:d3c3132289ac03aec3b8beeed8bd85d15d3adf5fa046dce2a5c7e746e69299ae (no relevant files found)
2019/05/29 18:10:12 Did not create a Lambda layer file from image layer sha256:46388d31ffe7499e91d49eea7d7c27001fdde0625a5ac5560514a11c5fdfe2f4 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:869a18aad610c811f4483612e0a6a196c367df19dc34e5821804c3208beba688 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:824410e4d7f4c8df76f036877eb4067ece14337121d99c6d1a825c2a67806292 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:e18ced74f6ed82f8ed1372bc9b0a1e96227ba2d55a8b2e05e0a127f9b6d235c3 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:a17ad75d62ff5ee1d49fdc5664b6e2edb51aa3cf90f4fae83436f7953ce9e462 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:63e7383fa0979e6afc462ea3aa1545293309eff6f8b865f95d582c8fb4074078 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:e894024d6e00d09b6477e19ee80142f0dfda930cebf43cd4b156c5160a3aa08f (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:5bef7d78aec0e3cbd2616deb4f6637b98674271c7ef77851878c216f09068395 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:e43d9404cc8887e9e921b127e3634ef8a9db550f14c119975254d3e93958ae31 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:17589be8568fd02d32d35067288b63d6a34d0f83f715630e6ae0316ab3363ed8 (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:05a588806cee1bad47322cd80af99b332a98356d38b26b1b65060533fcf813df (no relevant files found)
2019/05/29 18:10:13 Did not create a Lambda layer file from image layer sha256:5e6f54d367375499a4662fc49911c7247e82e1ec571c201a648f22a8db6ce21e (no relevant files found)
2019/05/29 18:10:14 Did not create a Lambda layer file from image layer sha256:6aff14f8bff9b5a17c16c11ef08976904bf41d03339a834b1ad41750b5d256f5 (no relevant files found)
2019/05/29 18:10:14 Created 0 Lambda layer files for image docker-daemon:zaobao_drush:latest
2019/05/29 18:10:14 No compatible layers found in the image (likely nothing found in /opt)

I was wondering if the process failed due to too many layers. could you help? thanks

Example Error: No php-example-hello.zip file found in the package path you provided.

Hi.

I returned to my child and started example.

An error occurred when deploying serverless.

Serverless Error ---------------------------------------

  No php-example-hello.zip file found in the package path you provided.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          win32
     Node Version:              10.13.0
     Framework Version:         1.54.0
     Plugin Version:            3.1.2
     SDK Version:               2.1.2
     Components Core Version:   1.1.1
     Components CLI Version:    1.2.3

Steps

$ git clone https://github.com/awslabs/aws-lambda-container-image-converter

$ cd aws-lambda-container-image-converter/example

$ docker build -t lambda-php .
[Succeeded]

$ img2lambda -i lambda-php:latest -r ap-northeast-1 -o ./output
[Succeeded, and 2 layers created]

$ cd deploy

$ sls deploy
[above error]

Is php-example-hello.zip created automatically? Do I have to create it myself?
What should I put in if I need to create it myself?

Thanks.

Enhancement: Use a spec-compliant PHP Runtime

Hello,

Kudos for this excellent project. I have noticed that the example PHP Runtime that you are currently using for the example is not spec-compliant. It only implements two of the four interface methods. InitializationError and InvocationError methods are not implemented. Also, there is no Context object passed to the execution function.

Also, as per the AWS docs, the format for functions is filename.methodname which is also not followed in the used example.

I have implemented a custom PHP Runtime myself to take care of these issues and to be full spec compliant. I'd be issuing a PR for your example to use my runtime instead of the example one used.

Please share your thoughts.

Regards,
Ajitem

Feature: Support images in Docker registry

Support images directly from a Docker registry, without needing a Docker daemon locally.

The image library used supports reading directly from a Docker registry already ("docker://" transport vs "docker-daemon://" transport), but this will require handling the .tar.gz-format of Docker registry images. For example, here the blob needs to be gunzipped before untarred.

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /img2lambda/Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /img2lambda/Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

libraries under /opt are not detected

under /opt we put libraries our lambda would require to run .
in the lambda envrionment , we'd had to overwrite the default LD_LIBRARY_PATH to search under the newly library path first : $LAMBDA_TASK_ROOT/lib:$LAMBDA_TASK_ROOT/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:/opt/lib:/lib64:/usr/lib64

when the lambda ran it failed with:

/var/task/main: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/lib/libheif.so.1)

but both were included in our newley created layer with img2lambda:

$ unzip -l lambda-img/layer-1.zip
Archive: lambda-img/layer-1.zip
Length Date Time Name


13762736 01-25-2019 10:47 lib/libMagickCore-7.Q16HDRI.so.6
3155944 01-25-2019 10:47 lib/libMagickWand-7.Q16HDRI.so.6
10996664 01-25-2019 10:47 lib/libde265.so.0
6577608 01-25-2019 10:47 lib/libheif.so.1
178376 01-25-2019 10:47 lib64/ld-linux-x86-64.so.2
2066416 01-25-2019 10:47 lib64/libc.so.6
19208 01-25-2019 10:47 lib64/libdl.so.2
92736 01-25-2019 10:47 lib64/libgcc_s.so.1
187576 01-25-2019 10:47 lib64/libgomp.so.1
281096 01-25-2019 10:47 lib64/libjpeg.so.62
1465520 01-25-2019 10:47 lib64/libm.so.6
149272 01-25-2019 10:47 lib64/libpthread.so.0
1590808 01-25-2019 10:47 lib64/libstdc++.so.6

so is adding libraries under /opt supported ?

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.