This PR updates api.R to deploy multiple /predict endpoints, one for each of a set of valid run IDs. The new API structure looks like this:
POST /predict: Predicts with a default model, configured via the AWS_S3_MODEL_RUN_ID environment variable
POST /predict/<run_id>: Predicts with a model determined by the run ID passed to the endpoint
Maintaining a POST /predict endpoint that falls back to a default model should allow us to deploy this change without disrupting the operation of the workbooks that Valuations is currently using for desk review.
Closes #1.
Deployment steps
[x] Notify Valuations and IT that we are deploying changes to the API
[x] Merge the PR
[x] Pull the latest image on the server
[x] Make sure the env vars are up to date
[x] Rename AWS_S3_MODEL_RUN_ID to AWS_S3_DEFAULT_MODEL_RUN_ID
[x] Remove AWS_S3_DVC_BUCKET
[x] Remove AWS_S3_MODEL_YEAR
[x] Try removing privileged: true
[x] Restart the compose process and see if it works
[x] Modify and reupload any API workbooks that need to change
This PR updates
api.R
to deploy multiple/predict
endpoints, one for each of a set of valid run IDs. The new API structure looks like this:POST /predict
: Predicts with a default model, configured via theAWS_S3_MODEL_RUN_ID
environment variablePOST /predict/<run_id>
: Predicts with a model determined by the run ID passed to the endpointMaintaining a
POST /predict
endpoint that falls back to a default model should allow us to deploy this change without disrupting the operation of the workbooks that Valuations is currently using for desk review.Closes #1.
Deployment steps
AWS_S3_MODEL_RUN_ID
toAWS_S3_DEFAULT_MODEL_RUN_ID
AWS_S3_DVC_BUCKET
AWS_S3_MODEL_YEAR
privileged: true