Closed JimLynchCodes closed 4 years ago
Example project here - > https://github.com/JimLynchCodes/Basic-Rust-Lambda
Thanks! π
What does sls deploy
say?
hmm not sure if I deployed it actually.
I don't want to deploy it yet though- I just want to invoke it locally. Is there a recommended way to do that?
Thanks! β€οΈ
According to README.md, passing local
keyword on the npx cmdline:
https://github.com/softprops/serverless-rust#invoke-your-lambdas-locally
You don't seem to be doing that AFAICT?
Thank you @brainstorm. I am still having issues though.
npm i
local
:
npx serverless invoke local -f hello -d "$(cat local-invoke-payload.json)"
But I am still getting errors about docker for some reason:
β β
β New minor version of npm available! 6.12.1 β 6.13.7 β
β Changelog: https://github.com/npm/cli/releases/tag/v6.13.7 β
β Run npm install -g npm to update! β
β β
β°βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ―
basic-rust-lambda (master) β npx serverless invoke local -f hello -d "$(cat local-invoke-payload.json)"
Serverless: Building native Rust hello func...
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
Serverless: Dockerized Rust build encountered an error: undefined 125.
Error --------------------------------------------------
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
OS: darwin
Node Version: 12.13.1
Serverless Version: 1.47.0
Maybe I need to update versions of something?
I am really interested in building lambda functions with Rust so I'm very keen on getting this working! Thanks! πβ€οΈ
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
... your docker daemon doesn't seem to be running.
@brainstorm Can you please elaborate?
What is the command to start the docker daemon running for this project?
If it is necessary, can we please add it to the README?
@brainstorm ?
π
Hi folks sorry for the delayed response. @JimLynchCodes I tried my best to catch and add useful logging on the case I think we were hitting. The docker daemon was not running. It is needed for the default build for this plugin but also by serverless itself for locally invoking functions on the aws provided runtime.
Of note I'm currently publishing a release for experimental local builds - https://github.com/softprops/serverless-rust#-experimental-local-builds you might want to try this out if docker is becoming a hassle.
Closing the this issue because both reported outcomes were expected behavior for invoking a remote lambda without deploying and invoking locally without a running docker daemon
π Bug description
Describe your issue in detail.
When I scaffold a fresh project with
npx serverless install \ --url https://github.com/softprops/serverless-aws-rust-http \ --name my-new-api
then runnpm i
and then try to invoke locally:It gives me the error, "Function not found".
Serverless Error ---------------------------------------
π€ Expected Behavior
It should have found the function
hello
.π Steps to reproduce
(described above)
π Your environment
serverless version: 1.47.0
rust-plugin version: 0.3.6 Node Version: 11.15.0 OS: darwin