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

Add Python Lambda #1599

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Add Python Lambda #1599

merged 1 commit into from
Oct 31, 2023

Conversation

lpsinger
Copy link
Member

@lpsinger lpsinger commented Oct 27, 2023

@lpsinger lpsinger added this to the ACROSS Kickoff milestone Oct 27, 2023
@lpsinger lpsinger force-pushed the python branch 4 times, most recently from d235df5 to 1f480c4 Compare October 30, 2023 23:26
@lpsinger lpsinger marked this pull request as ready for review October 31, 2023 00:01
@lpsinger lpsinger added the backend Issue relates to back-end development (API endpoints and other server-side code) label Oct 31, 2023
@@ -0,0 +1,4 @@
astropy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this being used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't yet, but it will be.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer that I remove this?

Copy link
Contributor

@dakota002 dakota002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straight-forward enough, though I am not familiar with FastAPI and Magnum. I did some reading on the former and I get that part now. Is this the latter?

@lpsinger
Copy link
Member Author

Seems straight-forward enough, though I am not familiar with FastAPI and Magnum. I did some reading on the former and I get that part now.

They were new to me too, but @jak574 has used them (see #1584). The advantage of FastAPI over more common Python web frameworks like Flask or Django is that FastAPI provides an auto-generated OpenAPI spec and API browser (derived from Python type annotations) whereas Flask or Django require third-party extensions and a bunch of boilerplate to do that.

Is this the latter?

Yes. It is an adapter that allows you to run any Python ASGI app in a serverless context (e.g. AWS Lambda).

@lpsinger lpsinger merged commit ed1f670 into nasa-gcn:main Oct 31, 2023
8 checks passed
@lpsinger lpsinger deleted the python branch October 31, 2023 19:19
@lpsinger
Copy link
Member Author

Is this the latter?

Ah, no, actually, it's mangum (note the deliberately odd spelling).

@dakota002
Copy link
Contributor

Ah now that makes more sense. I was reading it as magnum this whole time

@jak574
Copy link
Contributor

jak574 commented Nov 1, 2023

Seems straight-forward enough, though I am not familiar with FastAPI and Magnum. I did some reading on the former and I get that part now. Is this the latter?

It's "Mangum" not Magnum. https://mangum.io

Basically a ASGI layer to allow FastAPI to work with AWS Lambda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue relates to back-end development (API endpoints and other server-side code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create placeholder Python Lambda
4 participants