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

document story for what offline development looks like #74

Open
softprops opened this issue Jun 4, 2020 · 5 comments
Open

document story for what offline development looks like #74

softprops opened this issue Jun 4, 2020 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@softprops
Copy link
Owner

💡 Feature description

Local development keeps coming up as a common theme. Figure out and document the story for what this looks like, even if its just documenting how to set up serverless-offline.

💻 Basic example

add a second to the readme that outlines what is needed and how to do this with minimal friction

@softprops softprops added the help wanted Extra attention is needed label Jun 4, 2020
@softprops
Copy link
Owner Author

In theory if the provided runtime is support serverless-offline should "just work"

https://github.com/dherault/serverless-offline/blob/95ec5c45ff29521934f10e1ab690afa31ba2a981/src/config/supportedRuntimes.js#L53

@zprobst
Copy link

zprobst commented Jun 17, 2020

Trying to find a resolution to this myself.

Seems that the error message I keep getting is offline: Warning: found unsupported runtime 'rust' for function 'xzy'. Switching the order of the plugins does not seem to help. Though I am pretty sure offline needs to be after rust.

plugins:
  - serverless-rust
  - serverless-offline

Further confusing is that the source of this library re-writes the runtime as provided here so serverless offline should see it as provided not rust. Going to keep investigating.

@zprobst
Copy link

zprobst commented Jun 17, 2020

In fact, looking a little closer, it looks like serverless offline creates a representation of each lambda right after you run sls offline start here

To that end, it doesn't get re-written as the provided runtime until long after offline knows about its runtime it would seem. As one might imagine, I am not a genius at javascript seeing as I am spending time in the rust ecosystem so I could easily be wrong about that.

Maybe the approach is to do something similar in this repo where there is an internal list of rust functions that are rewritten as provided as soon as the plugin is loaded. Then later in the build function, you simply see if the lambda in question is one of the previously found rust functions and build it as we currently do.

@softprops
Copy link
Owner Author

I almost got this working with serverless offline --useDocker with the pull linked above. however I'm on a mac an the volume serverless offline was mounting wasn't permitted on a mac.

@softprops
Copy link
Owner Author

Linked issue for ref dherault/serverless-offline#1041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants