Giter VIP home page Giter VIP logo

aws-lambda-ocaml-runtime's People

Contributors

anmonteiro avatar chris-armstrong avatar joprice avatar superherointj 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

aws-lambda-ocaml-runtime's Issues

Async handlers

currently Lambda_runtime.start is:
(Yojson.Safe.json -> Context.t -> (Yojson.Safe.json, string) result) -> unit

I think we might need to provide a Lambda_runtime.start_async or start_io that is:

(Yojson.Safe.json -> Context.t -> (Yojson.Safe.json, string) result Io.t) -> unit

where Io.t is either Lwt.t or Async.Deferred.t

to allow for async handlers.

Expose the client

Right now the client is not exposed in the .mli file but perhaps we should do it if people wanna build their own modified runtime?

How to resolve failed to compute cache key: "/esy.lock" not found: not found error when running build.sh

Hi there. I'm trying to spin up a lambda function, but when I run the build.sh file (after adapting the build.sh and Dockerfile scripts to my project -- basically just removing the examples/basic/ stuff), I get the following error:

failed to compute cache key: "/esy.lock" not found: not found

I'm happy to provide more details if needed. But is there any quick fix for this that comes to mind? Thanks so much for the work on this project.

How to run the basic example with only dune, no docker

Hi @anmonteiro

Do you have an idea as to why I receive this error from my basic lambda? I've changed the build.sh to build with only dune without docker. Although it's likely my build script is incorrect now and is the root issue of this, the basic example doesn't work as-is because it lacks the esy.json and esy.lock file that the dockerfile expects.

{
  "errorMessage": "RequestId: 5489ab76-43af-4303-9ec8-9984e5ae7c44 Error: fork/exec /var/task/bootstrap: exec format error",
  "errorType": "Runtime.InvalidEntrypoint"
}
#!/usr/bin/env sh

set -eo pipefail

root_path=$PWD

# Start in examples/basic/ even if run from root directory
cd "$(dirname "$0")"

rm -rf bootstrap
# possible that this is the issue because i left out --profile=static
dune build basic.exe
mv ../../_build/default/examples/basic/basic.exe ./bootstrap
zip -j ./ocaml.zip bootstrap

cd $root_path

build script fails

I'm using Linux, 5.3.5-arch1-1-ARCH. And tried to build the basic example. It went as this:

$ cd aws-lambda-ocaml-runtime/examples/basic
$ ./build.sh

Errors as:

Step 18/26 : RUN echo ' {  "name": "package-base",   "dependencies": {     "ocaml": "4.9.0",     "@opam/dune": "*"   } } ' > esy.json
 ---> Using cache
 ---> 41501f5c6966
Step 19/26 : RUN esy
 ---> Running in 07e224fcc0d8
ESC[91minfo esy 0.5.8 (using esy.json)
ESC[0mESC[91minfo checking https://github.com/ocaml/opam-repository for updates...
ESC[0mESC[91minfo checking https://github.com/esy-ocaml/esy-opam-override for updates...
ESC[0mESC[91minfo resolving esy packages: done
ESC[0mESC[91m/esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe: /usr/lib/libstdc++.so.6: no version information available (required by /esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe)
/esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe: /usr/lib/libstdc++.so.6: no version information available (required by /esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe)
/esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe: /usr/lib/libstdc++.so.6: no version information available (required by /esy/lib/node_modules/esy/node_modules/esy-solve-cudf/esySolveCudfCommand.exe)
ESC[0mESC[91minfo solving esy constraints: done
ESC[0mESC[91minfo resolving npm packages: done
ESC[0mESC[91minfo fetching: done
ESC[0mESC[91minfo installing: done
ESC[0mESC[91minfo building @esy-ocaml/[email protected]@d41d8cd9
ESC[0mESC[91minfo building [email protected]@d41d8cd9
ESC[0mESC[91merror: build failed with exit code: 1
  build log:
    # esy-build-package: building: [email protected]
    # esy-build-package: pwd: /root/.esy/3__________________________________________________________________________/b/ocaml-4.9.0-031bf83c
    # esy-build-package: running: './esy-configure' '--disable-cfi' '--prefix' '/root/.esy/3__________________________________________________________________________/s/ocaml-4.9.0-031bf83c'
    [esy-configure] Detected OSX / Linux environment
    configure: Configuring OCaml version 4.09.0
[
<!---- There is more logs! --->
    stat: can't read file system information for '%m': No such file or directory
    stat: can't read file system information for '%m': No such file or directory
    tools/check-parser-uptodate-or-warn.sh: line 48: arithmetic syntax error
    make[4]: *** [Makefile:1079: parsing/parser.ml] Error 2
    make[4]: *** Waiting for unfinished jobs....
    make[4]: Leaving directory '/root/.esy/3__________________________________________________________________________/b/ocaml-4.9.0-031bf83c'
    make[3]: *** [Makefile:355: coreall] Error 2
    make[3]: Leaving directory '/root/.esy/3__________________________________________________________________________/b/ocaml-4.9.0-031bf83c'
    make[2]: *** [Makefile:362: core] Error 2
    make[2]: Leaving directory '/root/.esy/3__________________________________________________________________________/b/ocaml-4.9.0-031bf83c'
    make[1]: *** [Makefile:415: opt.opt] Error 2
    make[1]: Leaving directory '/root/.esy/3__________________________________________________________________________/b/ocaml-4.9.0-031bf83c'
    make: *** [Makefile:468: world.opt] Error 2
    error: command failed: './esy-build' (exited with 2)
    esy-build-package: exiting with errors above...
    
  building [email protected]
esy: exiting due to errors above

**The command '/bin/sh -c esy' returned a non-zero code: 1**


What did I do wrong? :-)

use from esy/nix/opam

I'd like to try this out, but unsure about a way to add it as a dependency. I'd be fine using esy nix or opam to install it, but I'm not good enough at any of them to figure out immediately how to go about that.

Poor performances ?

Hey !
It seems we had the same idea https://github.com/vanwalj/aws-lambda-ocaml ! :D

I'm quite new to Ocaml, so i'm not sure what to expect but my handler seems pretty slow.
I get between 30 and 100ms (most of the time around 50ms) response time once the lambda is warmed up.
Did you notice something similar ?

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.