I have a .pkl which I would like to put into production. I would like to do a daily query of my SQL server and do a prediction on about 1000 rows. The documentation implies I have to load the daily data into s3. Is there a way around this? It should be able to fit in memory no problem.
The answer to " is there some kind of persistent local storage in aws sagemaker model training? " says that "The notebook instance is coming with a local EBS (5GB) that you can use to copy some data into it and run the fast development iterations without copying the data every time from S3." The 5GB could be enough but I am not sure you can actually run from a notebook in this manner. If I set up a VPN could I just query using pyodbc?
Is there sagemaker integration with AWS Lambda? That in combination with a docker container would suit my needs.
You can create an endpoint on Sagemaker to host your pickled model and make predictions by invoking the endpoint using AWS Lambda. S3 bucket is not necessary for making real time predictions. Batch Transform is non-real time inference which requires S3 bucket. For making predictions up to 1000 rows, you can use real time inference inside a lambda function. The lambda code roughly looks like this
The S3 data is not required.
Here's the link to SageMaker documentation page: https://docs.aws.amazon.com/sagemaker/latest/dg/API_ContainerDefinition.html#SageMaker-Type-ContainerDefinition-ModelDataUrl
A prediction can be made via in-line text blob or a data file (binary, plain text, csv, json, etc.)
While you need to to specify a s3 "folder" as input, this folder can contain only a dummy file. Also if you bring your own docker container for training like in this example, you can do pretty much everthing in it. So you could do your daily query inside your docker container, because they have access to the internet.
Also inside this container you have access to all the other aws services. Your access is defined by the role you're passing to your training job.