Skip to content

feat: FastAPI integration for In_Process Mode (2/2) #4808

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

Merged
merged 90 commits into from
Aug 22, 2024

Conversation

bryannahm1
Copy link
Contributor

Issue #, if available:

Description of changes:
Introduced new app.py and local_run.sh files that allow for the server to run requests using FastAPI and uvicorn.

Testing done:
Integr tests run locally.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


count = 1
time_limit = datetime.now() + timedelta(seconds=20)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: time_limit = datetime.now() + timedelta(seconds=5)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix, thank you

config = uvicorn.Config(
_app,
host="127.0.0.1",
port=9007,
Copy link
Contributor

Choose a reason for hiding this comment

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

q: can we let port be dynamic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are researching this, will be an action item.

Bryannah Hernandez added 2 commits August 15, 2024 17:08
Copy link
Collaborator

@samruds samruds left a comment

Choose a reason for hiding this comment

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

Approve please address minor changes and get additional approval from @makungaj1

Copy link
Collaborator

@benieric benieric left a comment

Choose a reason for hiding this comment

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

what is the .whl file for?

@@ -1,2 +1,5 @@
accelerate>=0.24.1,<=0.27.0
sagemaker_schema_inference_artifacts>=0.0.5
uvicorn>=0.30.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these needed? Doesn't look like we import them anywhere?

Copy link
Contributor Author

@bryannahm1 bryannahm1 Aug 22, 2024

Choose a reason for hiding this comment

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

They're imported in the app.py file

@benieric benieric merged commit da348e8 into aws:master Aug 22, 2024
13 of 14 checks passed
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

Successfully merging this pull request may close these issues.

5 participants