Build a Python Microservice with Amazon Web Services Lambda & API Gateway

I think in many ways AWS (Amazon Web Services) is a game changer for the entire “cloud”. Many companies base all or some of their infrastructure on AWS. Today I want to kick off an AWS Lambda tutorial from a Python developer’s perspective. Since the past year the Python code I write my articles have been done in Python 3.x however today’s article is an exception since the actual hosted Lambda Python code has to be Python 2.7 since that is what AWS Lambda currently only supports (Jan. 2016). Regardless of having to use Python 2.7.x AWS Lambda is very cool to work with and has a lot of potential to make some very useful services.

Continue reading

Posted in Amazon Web Services, Python | 5 Comments

Deploy a Go (golang) application to a minimal sized Docker container

Docker and Go have both been getting a lot of attention and rightfully so for the particular problems each one solves. Today I’m going to focus on something each technology does very well and that is building an application that is built with no external dependencies and is easy to deploy. Of course this example will be very scaled down so the article itself doesn’t get so long that readers lose interest but it is enough to extend from for those that want to take it to the next step.

Continue reading

Posted in Go, Open Source | 2 Comments

Fetching a remote configuration using Consul and Go (golang)

Nowadays its pretty common to spin up a Docker container that will run an application to do some sort of work or processing. Many times this application requires some sort of configuration to set it up correctly to run. With Docker and an app built in Go (or any other language) you could spin up the container and set an environment variable which the application could then read. Let’s assume the environment variable is just an address that points to something like ectd or Consul where the full configuration settings are stored. Let’s go over how this can be done using Go (golang – excuse the redundancy on Go/golang I use this to help the search engines out).

Continue reading

Posted in Go, Open Source | 2 Comments

Building a self-contained Python 3 application using PyPy

A few articles ago I showed you how to create a Python 3 Microservice (a simple Minecraft service). At the end of that article I mentioned in the future I’d show you how to build a self-contained Python application/service. Well, today is that day.

I’ll use PyPy (the Python 3.2.5 compatible PyPy3 2.4.0 version) to show how this can easily be done and how you can install packages into the self-contained instance of Python. What this means is you easily package this up and simply extract it to another machine (same architecture or you need to modify some steps) and it will just run even if Python is not installed there. In fact there are several ways to do what I’m going to show you how to do today and several ways to package this up. I’m just going to focus on one possible way to do this as easily as possible.

Continue reading

Posted in Open Source, Python | Comments Off on Building a self-contained Python 3 application using PyPy

Introducing PyWebhooks: An Easy to Use Webhooks Service (Written in Python 3)

A while back (and even recently) I was looking for any sort of project that allowed you to create and define your own webhooks. Features like allowing others to subscribe to those events, and then trigger your custom webhooks when needed which then would go and notify each subscription’s endpoint. I couldn’t find anything like that. Pieces that did some of those features, but not the whole package. So PyWebhooks was born (Github repo here).

Continue reading

Posted in Open Source, Python | 1 Comment

Go: Simple, Easy, Fast – Building a Go (golang) REST Service with Gorilla

There are a lot of tools out there for Go (golang) to build REST based services. Gorilla is a web toolkit for the Go programming language. With Gorilla you can build RPC services, WebSocket apps and many more. Today I’m going to go over building a simple REST service using Gorilla (Mux).

Continue reading

Posted in Go, Open Source | 3 Comments

Introducing ECS Minion – A Python library for interacting with the ECS 2.x Management API

I currently work in EMC’s Cloud Services group and we scale very large storage solutions. We write a lot of code and many times this is done in Python. Previously I wrote another open source tool that worked with EMC’s ViPR product. Today I want to announce that ECS Minion is ready to go. We use both ViperPy and ECS Minion in production but if you find any issues please file it on Github.

To get started check out the readme which has plenty of examples.

To install simply run:

$ pip install ecsminion
Posted in Uncategorized | Comments Off on Introducing ECS Minion – A Python library for interacting with the ECS 2.x Management API

Getting started with RethinkDB and Python 3

I’ve been keeping an eye on RethinkDB for a while now and recently began working with it. There is a lot to like about RethinkDB like the ability to easily cluster and scale your deployment but what I’m going to focus on today is something called Changefeeds. I’ll start this blog article off with installing a development server running RethinkDB and then move onto a quick tutorial. From there we will look at Changefeeds.

Continue reading

Posted in Open Source, Python | Comments Off on Getting started with RethinkDB and Python 3

Installing Hashicorp’s Consul and using Python 3 to communicate with it

Hashicorp builds several great tools and I’m going to focus on one in particular today called Consul. In particular one of the many ways to utilize Consul is it’s ability to support service discovery, failure detection and to be multi-datacenter aware for things like microservices (or other types of projects). Consul also has a sophisticated key/value storage feature in addition to the other features. Today I want to cover how to easily get a small two node Consul cluster up and running and use Python to do some simple communication with it.

Continue reading

Posted in Open Source, Python | Comments Off on Installing Hashicorp’s Consul and using Python 3 to communicate with it

Exploring Python 3’s Asyncio by Example

In spring 2014 Python 3.4 shipped a provisional package (asyncio) which according to the docsprovides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives“. I can’t possibly cover everything in this article but I can introduce some of the things you can do with it. As per my New’s Years resolution I’ll be building these examples using Python 3.4.2 (Asyncio has been ported back to Python 3.3 now as well).

Continue reading

Posted in Open Source, Python | 9 Comments