Python app serverless deployment

Overviews of best solution for serverless deployment: Amazon Web Services and Slam
25 August 2017   924

What is Slam?

Slam is a serverless deployment tool that allows you to deploy your Python functions or web applications to AWS Lambda, API Gateway and DynamoDB. It does so by generating a Cloudformation template that describes the deployment in its entirety. If you are deploying a web application, the Lambda function is deployed using the techniques described above to adapt API Gateway invocations to the WSGI format.

The package is called Slam, and can be installed like this:

$ pip install slam

Also, check small video tutorial:

Learn more at GitHub.

What is AWS?

Amazon Web Services (AWS) is a subsidiary of Amazon.com that provides on-demand cloud computing platforms to individuals, companies and governments, on a paid subscription basis with a free-tier option available for 12 months.

In AWS, Lambda is the function as a service offering. With this service, you can upload your Python, Node.js, Java or C# code and Lambda will store it and run it for you. To work with the Lambda service you upload your project packaged as a zip file, containing your own code plus any dependencies that are needed. You have to designate a function in your code as the entry point, and this function will be called by AWS when a client "invokes" your Lambda function.

The API Gateway service allows you to construct API endpoints, and configure what actions these endpoints trigger when a client sends requests to them. The service takes care of scaling, rate limiting, and even authenticating your clients if you wish to go that far. An API Gateway endpoint can be configured to invoke a Lambda function, so you can create endpoints in API Gateway that match the endpoints in your API, and connect each of them to a Lambda function, and with this combination of API Gateway and Lambda your clients can work with your API in the normal way, by sending HTTP requests.

The serverless platform for AWS is often described as having three main services. DynamoDB is a simple NoSQL database service. Why is a NoSQL database so popular in the serverless world? Well, serverless applications tend to be built as a collection of small and independent pieces (the so called microservices), so while you can use a relational database, that is sometimes overkill. DynamoDB tables do not need a schema, are very easy to setup and use, and follow the "only pay for what you use" model present in many AWS services.

Students to Beat Google’s Machine-Learning Code

Student programmers' image classification algorithm successfully identifies the object in 93% of cases
13 August 2018   401

Developers-students from Fast.ai which organize free online computer training courses have created an image classification algorithm that successfully identifies the object in 93% of cases and copes with it faster than a similar Google algorithm with a similar configuration. The authors argue that "the creation of breakthrough technologies is not just for big companies". This is reported by MIT Technology Review.

When evaluating performance, the DAWNBench test was used, which calculates the speed and cost of teaching the neural network. During the Fast.ai experiment, the neural network was launched on 16 virtual AWS nodes, each contained 8 NVIDIA V100 graphics cards. This configuration achieved accuracy of 93% in 18 minutes, and the cost of machine time was estimated at $ 40. The result of Fast.ai is faster than the development of Google engineers by 40%, but the corporation uses its own clusters TPU Pod, so the comparison is not entirely objective.

The developers used the PyTorch Python library, as well as their own development - fastai. They were able to achieve this learning speed with the new method of cropping images from the ImageNet dataset: instead of square pictures, they began to use rectangular:

Fast AI
Fast AI

State-of-the-art results are not the exclusive domain of big companies. These are the obvious, dumb things that many researchers wouldn’t even think to do.
 

Jeremy Howard

Founder, Fast.AI

The authors tried to make the project accessible to everyone, so they simplified its infrastructure, refusing to use distributed computing systems and containers. To implement it, developers teamed up with engineers from the innovative division of the Pentagon (DIU) to release software to quickly create and support distributed models on AWS.