Continuous Machine Learning with Kubeflow
eBook - ePub

Continuous Machine Learning with Kubeflow

Performing Reliable MLOps with Capabilities of TFX, Sagemaker and Kubernetes (English Edition)

Aniruddha Choudhury

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Continuous Machine Learning with Kubeflow

Performing Reliable MLOps with Capabilities of TFX, Sagemaker and Kubernetes (English Edition)

Aniruddha Choudhury

Book details
Book preview
Table of contents
Citations

About This Book

An insightful journey to MLOps, DevOps, and Machine Learning in the real environment.

Key Features
? Extensive knowledge and concept explanation of Kubernetes components with examples.
? An all-in-one knowledge guide to train and deploy ML pipelines using Docker and Kubernetes.
? Includes numerous MLOps projects with access to proven frameworks and the use of deep learning concepts.

Description
'Continuous Machine Learning with Kubeflow' introduces you to the modern machine learning infrastructure, which includes Kubernetes and the Kubeflow architecture. This book will explain the fundamentals of deploying various AI/ML use cases with TensorFlow training and serving with Kubernetes and how Kubernetes can help with specific projects from start to finish.This book will help demonstrate how to use Kubeflow components, deploy them in GCP, and serve them in production using real-time data prediction. With Kubeflow KFserving, we'll look at serving techniques, build a computer vision-based user interface in streamlit, and then deploy it to the Google cloud platforms, Kubernetes and Heroku. Next, we also explore how to build Explainable AI for determining fairness and biasness with a What-if tool. Backed with various use-cases, we will learn how to put machine learning into production, including training and serving. After reading this book, you will be able to build your ML projects in the cloud using Kubeflow and the latest technology. In addition, you will gain a solid knowledge of DevOps and MLOps, which will open doors to various job roles in companies.

What you will learn
? Get comfortable with the architecture and the orchestration of Kubernetes.
? Learn to containerize and deploy from scratch using Docker and Google Cloud Platform.
? Practice how to develop the Kubeflow Orchestrator pipeline for a TensorFlow model.
? Create AWS SageMaker pipelines, right from training to deployment in production.
? Build the TensorFlow Extended (TFX) pipeline for an NLP application using Tensorboard and TFMA.

Who this book is for
This book is for MLOps, DevOps, Machine Learning Engineers, and Data Scientists who want to continuously deploy machine learning pipelines and manage them at scale using Kubernetes. The readers should have a strong background in machine learning and some knowledge of Kubernetes is required.

Table of Contents
1. Introduction to Kubeflow & Kubernetes Cloud Architecture
2. Developing Kubeflow Pipeline in GCP
3. Designing Computer Vision Model in Kubeflow
4. Building TFX Pipeline
5. ML Model Explainability & Interpretability
6. Building Weights & Biases Pipeline Development
7. Applied ML with AWS Sagemaker
8. Web App Development with Streamlit & Heroku

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Continuous Machine Learning with Kubeflow an online PDF/ePUB?
Yes, you can access Continuous Machine Learning with Kubeflow by Aniruddha Choudhury in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Inteligencia artificial (IA) y semántica. We have over one million books available in our catalogue for you to explore.

CHAPTER 1

Introduction to Kubeflow & Kubernetes Cloud Architecture

In this chapter, we will learn about the complete features of Kubeflow, how it works, and why we need Kubeflow. We will also learn about the architecture functionality of Kubernetes, like service, pod, Ingress, and so on, and how to build the docker image, and how it works. Here, we will see the components of Kubeflow advantage, which we will be using in the upcoming chapters. Then, we will proceed towards the complete setup of Kubeflow in the Google Cloud Platform and Jupyter notebook setup. We have an optional item – how to create the Persistent Volume Claim, and attach it to the File store to save your codes and data.

Structure

In this chapter, we will cover the following topics:
  • Docker understanding
  • Kubernetes concepts and architecture
  • Kubernetes components
  • Introduction on Kubeflow Orchestration for ML Deployment
  • Components of Kubeflow
  • Setting Up for Kubeflow in GCP
  • Jupyter Notebook setup
  • Optional: PVC setup for Jupyter Notebook

Objectives

This chapter will help you learn the following:
  • The core understanding of Docker and Kubernetes, and its application to be used in Cloud.
  • Kubernetes and Kubeflow Architecture and its functionality and advantages.
  • The components of Kubeflow and how to setup Kubeflow IAP Cluster in Google Cloud Platform.
  • Docker image of CPU for setting up the Jupyter notebook, alongside the PVC Setup in Cloud.
NOTE
Rest all the imports I have showed in my Colab Notebook, for which the hyperlink of GitHub account of this chapter is given below. Note Colab platform Python 3.x. RUN IN GOOGLE COLAB
CODE
https://github.com/bpbpublications/Continuous-Machine-Learning-with-Kubeflow/tree/main/Chapter1

1.1 Docker understanding

Docker is a platform for the developers and system admins to build, run, and share the applications with the containers. The containers used to deploy the applications is called containerization. To deploy the applications, the containers are making things easier and flexible.
Containerization is increasingly becoming popular because the containers have the following features:
  • Flexible: We can containerize the most complex applications as well.
  • Scalable: We can distribute the container replica’s process across a data center automatically.
  • Lightweight: The containers make things more efficient than the Virtual machines by sharing and leveraging the host kernel.
  • Portable: Due it’s portable nature, we can build them locally, deploy to the cloud, and run it from anywhere.
  • Loosely coupled: They are highly independent and encapsulated, which allows us to replace or upgrade anyone without disrupting others.
  • Secure: Without any required configuration on the part of the user, it applies aggressive isolations and constraints to the processes.
Images and containers:
Logically, a container is a running process, with some added encapsulated features which applies for the Host to be isolated from it and from the other containers. The most important aspects is that each container interacts with its own private file system, which is called container isolation; the Docker image provides this file system. So, an image includes most of the things which are needed to run an application – the code, runtimes, dependencies, and any other file system objects required.
Figure 1.1: Docker Architecture
The Docker has two concepts which are almost the same with its VM containers as the idea of an image and a container. An image, which is the definition of that will be executed, just like an operating system image, and for a given image, the container is the running instance.

1.1.1 Dockerfile

To get our Python or any language code running in a container is to warp it in a package as a Docker image, after that run a container based on it. The steps are sketched as follows:
Figure 1.2: Docker file process
Next, for generating a Docker image, we need to create a Dockerfile which contains some set of instructions needed to build the image. The Dockerfile is then processed by the Docker builder which generates the Docker image. At last, with a simple Docker run command, we can create and run a container with the Python service.
Figure 1.3: Dockerfile code
Let’s split this file into the following lines:
  • It uses the Python base image with the tag Python:3.8, which is a specific version of Python.
  • Then, it creates a working directory, where we will copy our local files to that directory; here we have created an app folder and copied the requirements file which contains the Python library.
  • Then, we have installed all the Python libraries with the pip command.
  • Next, we use CMD, which is a command to run the Python file whenever the container gets started.
Figure 1.4: Dockerfile command
Now, run the preceding code in the terminal to push the image, which you have built in local to cloud (GCP/AWS/AZURE) and Docker hub.

1.2 Kubernetes Architecture

In this section, we will see how the Kubernetes work, and learn about its architecture.

1.2.1 What is Kubernetes?

Kubernetes is an open-source container management system used in large-scale enterprises in several dynamic industries to perform a mission-critical task or any orchestration task. Some of its capabilities include the following:
  • It manages the containers inside cluster.
  • It deploys applications to which it provides ...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. About the Author
  6. About the Reviewer
  7. Acknowledgement
  8. Preface
  9. Errata
  10. Table of Contents
  11. 1. Introduction to Kubeflow & Kubernetes Cloud Architecture
  12. 2. Developing Kubeflow Pipeline in GCP
  13. 3. Designing Computer Vision Model in Kubeflow
  14. 4. Building TFX Pipeline
  15. 5. ML Model Explainability & Interpretability
  16. 6. Building Weights & Biases Pipeline Development
  17. 7. Applied ML with AWS SageMaker
  18. 8. Web App Development with Streamlit & Heroku
  19. Index
Citation styles for Continuous Machine Learning with Kubeflow

APA 6 Citation

Choudhury, A. (2021). Continuous Machine Learning with Kubeflow ([edition unavailable]). BPB Publications. Retrieved from https://www.perlego.com/book/3234779/continuous-machine-learning-with-kubeflow-performing-reliable-mlops-with-capabilities-of-tfx-sagemaker-and-kubernetes-english-edition-pdf (Original work published 2021)

Chicago Citation

Choudhury, Aniruddha. (2021) 2021. Continuous Machine Learning with Kubeflow. [Edition unavailable]. BPB Publications. https://www.perlego.com/book/3234779/continuous-machine-learning-with-kubeflow-performing-reliable-mlops-with-capabilities-of-tfx-sagemaker-and-kubernetes-english-edition-pdf.

Harvard Citation

Choudhury, A. (2021) Continuous Machine Learning with Kubeflow. [edition unavailable]. BPB Publications. Available at: https://www.perlego.com/book/3234779/continuous-machine-learning-with-kubeflow-performing-reliable-mlops-with-capabilities-of-tfx-sagemaker-and-kubernetes-english-edition-pdf (Accessed: 15 October 2022).

MLA 7 Citation

Choudhury, Aniruddha. Continuous Machine Learning with Kubeflow. [edition unavailable]. BPB Publications, 2021. Web. 15 Oct. 2022.