-
Notifications
You must be signed in to change notification settings - Fork 1
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
Deploy grants tagger with sage #4
Comments
Hi Nick, Back from paternity leave! Happy to try this on my side too. Two things:
But I get a setuptools error. I'll copy my error log below. Could you try on your side?
Anything else in there? Here is the error code for trying to install poetry in docker:
|
Which repo did you try this on? Grants tagger uses a In general the idea is that you can use the tool
|
If on the other hand the model you want to deploy uses poetry for managing dependencies, here is a minimal Dockerfile that works for installing those deps
|
I tested the deployment
Let me know what you think |
For testing purposes I am testing with the following files requirements.txt
run_api.sh
First test is to ensure the api works outside of docker container. Run
Second test is to ensure the api works inside the container I am running
and then
Final test is to push to ECR and try with sagemaker |
🥳 The API works locally!
results in 😢 I did the docker run [image-name] serve, which seems to work fine:
But the above curl command results in: 🥳 🥳 because I also tried to push with sage to sagemaker and low and behold, it works:
returns
|
I think fastapi & uvicorn weren't part of my requirements file previously (I previously just used the requirements from grants_tagger) |
I also made an sh file to help with the build and push: this is my
FYI - we have to include sagemaker into the name of the ECR repo otherwise we can't push.. it's the way our iam roles are set up 🙈 |
I also think it's useful to use a separate requirements file just for the docker build containing just the requirements you have mentioned above |
You need to be careful with different requirements file to ensure the project with with the versions you use but in this project there is defintiely a need for a lighter set of requirements. I think the current set of requirements based in https://github.com/wellcometrust/grants_tagger/blob/main/unpinned_requirements.txt are relatively light. |
Some points to keep in mind when deploying with custom containers
|
In regards to the error most probably you needed a port forward in your |
We might need to update the README but worth checking that deployment works for you first @ArneRobben. Note that you need a couple of steps for deploying custom containers like the wellcome bert mesh model which are out of scope for this tool but should probably neverthless be either in the documentatinon or as a example scripts
You need to first build and push a container to pass the IMAGE_URI
Build
API
Dockerfile
Build
Push
Note you need to create a ECR repository, in this examples this is
wellcome-custom-containers
Test
The text was updated successfully, but these errors were encountered: