Packaging and Running Runnerly

Whenthe Python programming language was first released in the early 1990s, a Python application was run by pointing the Python scripts to the interpreter. Everything related to packaging, releasing, and distributing Python projects was done manually. There was no real standard back then, and each project had a long README on how to install it with all its dependencies.

Bigger projects used the system packaging tools to release their work--whether it was Debian packages, RPM packages for Red-Hat Linux distributions, or things like MSI packages under Windows. Eventually, the Python modules from those projects all ended up in the site-packages directory of the Python installation, sometimes after a compilation phase, if you had a C extension.

The Python packaging ecosystem has evolved a lot since then. In 1998, Distutils was added in the standard library to provide essential support to create installable distributions for Python projects. Between then and now, a lot of new tools have emerged from the community to improve how a Python project can be packaged, released, and distributed.

This chapter is going to explain how to use the latest Python packaging tools for your microservices.

The other hot topic around packaging is how it fits in your day-to-day work. When building microservices-based software, you need to deal with many moving parts. When you are working in a particular microservice, you can get away with it most of the time by using the TDD and mocking approach, which we discussed in Chapter 3, Coding, Testing, and Documenting - The Virtuous Cycle.

However, if you want to do some realistic testing, where poking around each service is needed, you have to have the whole stack running in a single box. Moreover, developing in such a context can be tedious if you need to reinstall new versions of your microservices all the time.

It begs one question: how can you correctly install the whole stack in your environment and develop in it?

It also means you have to run all the microservices if you want to play with the app. In the case of Runnerly, having to open six different shells to run all the microservices is not something a developer would want to do every time they need to run the app.

In this chapter, we are going to look at how we can leverage the packaging tools to run all microservices from the same environment, and then how to run them all from a single command-line interface by using a dedicated process manager.

However, first, let's look at how to package your projects, and which tools should be utilized.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset