lambda icon indicating copy to clipboard operation
lambda copied to clipboard

lambda-test not finding lambda function

Open truff77 opened this issue 9 years ago • 5 comments

Hi, I've gone over the lambda/docs/getting-started.md to test iron lambda functionnalities but I've an issue:

$ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE irontest/node-exec 1 891029aca185 18 hours ago 44.61 MB iron/lambda-nodejs latest 8907411785de 7 weeks ago 44.61 MB

$ iron lambda test-function --function-name irontest/node-exec:1 --payload '{ "cmd": "echo Dockerized Lambda" }' Function irontest/node-exec:1 does not exist.

But when I test directly using Docker it works, see bellow: $ cat /tmp/payload_dir/my_payload.json { "cmd": "echo Dockerized Lambda" }

$ docker run -v /tmp/payload_dir:/mnt -m 1G -e PAYLOAD_FILE=/mnt/my_payload.json -e TASK_ID=$RANDOM -e TASK_MAXRAM=1 --rm -it irontest/node-exec:1 Dockerized Lambda

Thanks for your help !

truff77 avatar May 31 '16 12:05 truff77

I tried this exact command

iron lambda test-function --function-name irontest/node-exec:1 --payload '{ "cmd": "echo Dockerized Lambda" }'

and it worked. Could you paste the output of iron -version and docker version? Also, what OS is the host machine? Thank you.

nikhilm avatar May 31 '16 17:05 nikhilm

I just upgraded to fresh new CentOS 6.8 yesterday night and I'm still experiencing the issue:

$ cat /etc/redhat-release CentOS release 6.8 (Final) $ docker -v Docker version 1.7.1, build 786b29d/1.7.1 $ iron -version 0.1.1

truff77 avatar Jun 01 '16 11:06 truff77

Does the following work (leaving the version out):

iron lambda create-function --function-name irontest/node-exec --runtime nodejs --handler node_exec.handler node_exec.js

iron lambda test-function --function-name irontest/node-exec --payload '{ "cmd": "echo Dockerized Lambda" }'

nikhilm avatar Jun 01 '16 15:06 nikhilm

$ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE irontest/node-exec latest 103269220cfc 59 seconds ago 44.61 MB iron/lambda-nodejs latest 8907411785de 7 weeks ago 44.61 MB

$ iron lambda test-function --function-name irontest/node-exec --payload '{ "cmd": "echo Dockerized Lambda" }' Dockerized Lambda

this one works :)

truff77 avatar Jun 01 '16 15:06 truff77

Thanks! I'm on a Mac and seems like the suffix :1 works here (or maybe I have some stale files around). I will try on Linux on a fresh setup in a day or two.

nikhilm avatar Jun 01 '16 16:06 nikhilm