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

Local Development #172

Closed
arinhouck opened this issue Dec 11, 2023 · 3 comments
Closed

Local Development #172

arinhouck opened this issue Dec 11, 2023 · 3 comments

Comments

@arinhouck
Copy link

arinhouck commented Dec 11, 2023

Hey long time lurker here, I'm just now setting things up for Lamby and getting familiar. However, I don't see any clear instructions on how I should be using Lamby in a local environment. It's a bit unclear to me if the app container service has any entrypoint that I can call via HTTP?

I can just run the rails server and go about my business but I'd be curious if there is any proposed approach here. Is there a proxy server or something that we're responsible for setting up? (eg. like localstack with a gateway lambda)

I'm a bit unfamiliar with Codespaces. Not really interested in inheriting any costs related for that service either.

I couldn't quite pinpoint where the config/environment.Lamby.cmd script is and didn't see any port expose method calls in the Dockerfile.

@jeremiahlukus
Copy link
Contributor

I guess its really up to you. It seems @ metaskills has a fondness of codespaces and using vscode .devcontainer .

For other languages I use .devcontainer but for rails I normally just locally install things.

to answer your other question

Lamby.cmd method is designed to handle AWS Lambda events by invoking the handler method .
https://github.com/rails-lambda/lamby/blob/master/lib/lamby.rb#L24

@metaskills
Copy link
Member

Answer might be more along the lines of this is how the SAM (Serverless Application Model) works. As it builds the final docker image, the Entrypoint & Command are done for you as part of the sam build process. The devcontainers are a CI/CD convention I explored at one time. It is neat... and benefits for development using the same image as the build system. But at the end of the day you could take any of the CI/CD conventions in the cookiecutter and replace them with your own linux env that has SAM installed, etc. Hope that helps?

@arinhouck
Copy link
Author

arinhouck commented Jun 12, 2024

Hey, thanks guys. I ended up using dev containers locally, however I did run into some issues with query params support (array of objects does not work the same locally via standard Rails server as in the AWS environment). I never got the chance to investigate if that was a limitation of AWS Lambda or just something that wasn't handed in the Lambda event handler mapping code of Lamby.

I thought maybe I would mess with serverless (to run a local lambda) to see if I could get a closer 1:1 of live environments to local someday when I get the chance.

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

3 participants