Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support invoke/local #9

Closed
softprops opened this issue Sep 9, 2018 · 6 comments
Closed

Support invoke/local #9

softprops opened this issue Sep 9, 2018 · 6 comments

Comments

@softprops
Copy link
Owner

softprops commented Sep 9, 2018

add support for serverless invoke local -f function-name

@softprops
Copy link
Owner Author

while looking into this it seems very possible at the outset but now seems blocked by a conflict in what rust crowbar expects in a provided context and what is provided by serverless' fake invoker context namely to properties would need to be added to serverless's provided context log_group_name and log_stream_name. Aws' documentation for its python runtime does have a complete list of attributes but mentions log_stream_name may be None if the lambdas role doesn't have permission to write logs but is less clear about log_group_name. It should be relatively straightforward to add these to serverless's invoke harness. so we may want to open an issue there and get feedback on what a patch may look like.

In addition serverless's invoke conext returns an memory_limit_in_mb as an in where crowbar assumes a str. Since crowbar works in production aws its likely its represented as a string and should be with serverless invoke context for consistency.

It's also work taking note that crowbar has its own fake invoke context for testing that we may want to reference for comparison

@softprops
Copy link
Owner Author

this seems to be blocked by some misalignment with the python context in serverless. I've opened pr to address there serverless/serverless#5291

@softprops
Copy link
Owner Author

1.33 of severless framework was just released which should now make invoke local possible

@softprops
Copy link
Owner Author

closing to reopen for the new serverless runtime

@ajmwagar
Copy link

Doesn't work for me on Serverless 1.38.0.

Using your serverless-aws-rust template.

serverless invoke local -f hello -d '{"foo":"bar"}'
Serverless Error ---------------------------------------
 
  You can only invoke Node.js, Python, Java & Ruby functions locally.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           10.15.3
     Serverless Version:     1.38.0

Maybe reopen?

@ajmwagar
Copy link

Oops. I didn't see #20.

Thanks, Google. :/

Please disregard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants