concept Docker image in category dask

appears as: Docker image, Docker images, Docker images
Data Science with Python and Dask

This is an excerpt from Manning's book Data Science with Python and Dask.

In local mode, all elements run on the same computer, and the number of workers corresponds with the number of CPU cores by default. In cluster mode, we’ll configure each of the elements to run on a separate computer. We’ll also gain the freedom to increase or decrease the number of workers on the fly, which gives us the flexibility to scale the cluster as needed. But, since all these elements will reside on different computers, we must consider a few new things: the data must be in a shared place that can be accessed by all the workers, and all the workers must have the right Python packages installed. The first consideration is straightforward—we’ll set up a shared filesystem that each of the workers can access, and then put the data there. The second consideration has, historically, been a bit trickier to handle. For instance, if we want to run the code from chapter 9 that filters out all of the stopwords using NLTK (Natural Language Toolkit) on a cluster, we have to make sure that every worker in the cluster has NLTK installed and also has the stopword data downloaded. This might not be a problem to do manually if we have a handful of workers in the cluster, but if we needed to scale the cluster to 10,000 workers, it would take a very long time to configure the workers one at a time. This is where Docker becomes incredibly useful. Docker essentially allows us to create a blueprint, called an image, that contains data and instructions to build an identical copy of a system. The image can be launched inside a container and becomes a fully functional self-contained system, much like a virtual machine. This image can be deployed to Amazon Elastic Container Service (ECS) to launch many hundreds or thousands of workers, all with the same identical configuration and software, at the press of a button. Later in the chapter, we’ll build a Docker image that contains all the software we need to run the Dask worker alongside all the necessary Python packages. We’ll also do the same for the scheduler and the notebook server. Our overall objective for this section is encompassed in this scenario: