# DevOps revisited The goal of DevOps is to transform these isolated procedures into an ongoing series of coordinated actions within a company. The practice of provisioning and managing infrastructure through code and software development methodologies like version control and continuous integration A single application can be built as a collection of small services using the microservices architectural design strategy. Each service operates as a separate process and interacts with other services via a clear interface and a lightweight method, usually an HTTP-based API (API). # MLOps vs DevOps MLOps can be considered as a superset of DevOps. Data engineering, DevOps, and machine learning are combined to form MLOps. This is how MLOps and DevOps are different: Over time, models may deteriorate. Models and data must be iterated upon and tested continuously since they are mutable. ML models are more unpredictable and nondeterministic than software development. Ensuring ML models climb the performance curve requires additional effort. Significant hardware and infrastructure costs are involved. Higher processing and compute power are related to models. ML models typically require GPUs to run, and thus use more memory than software development does. size of the operation. In order to handle the always changing data, models must be scalable. The following considerations need to take place when dealing with MLOps and running models at scale: 1. Model versioning and Serving 2. Monitoring the performance of the machine learning model 3. Retraining the model from time to time. # Flyte comes into the picture! Built on top of Kubernetes, Flyte is a workflow automation tool with data and machine learning awareness. Flyte aims to manage business-critical machine learning and data processes at scale. # How does Flyte Work? ## Goals Here are some of the goals Flyte wishes to achieve: i. Assist any organization with a reproducible, gradual, iterative, and extendable workflow automation PaaS. ii. User experience, dependability, and accuracy should be prioritized. iii. responsibilities for platform teams and user teams should be separated. ![](https://i.imgur.com/4BZVJXx.png) ## Building blocks of Flyte: Workflows & Tasks Workflow: Workflows provide the series of business, administrative, or other procedures that a piece of work goes through from beginning to end. Tasks: A fully-independent unit of execution and first-class entity. ![](https://i.imgur.com/CnzF8S4.png) ## How does Flyte solve the ML Orchestration problems What all problems does Flyte Solve for MLOps? a. Flyte has a Centrally managed infrastructure. It gives access to the system resources such as the CPU, GPU etc. Multi-tenancy unaware b. In ML, experiments need: Comparable algorithms with varied inputs/parameters modifying behavior in response to the given input.  It is preferable to be aware of the pipeline in advance, even with dynamism. This is achievable with Flyte c. Flyte provides implicit support for resuability. using the concept of project and domains in Flyte the following can be achieved: Domain experts can work on the problematic components on their own. The current tasks and workflows can be reused by other users in the organization. In a unified pipeline, users are allowed to choose any language of their choice. Over a robust interface border, communication occurs. ## How to setup and use Flyte Learn how to get started with using Flyte ### 1. Writing the Machine learning job and running it locally Writing a job, or a @task in Flyte terminology, is the initial step in creating an ML pipeline. The position may be in training, data preprocessing, or spark. In order to execute it on the Flyte backend, the user will need to translate any implementation-related code they already have into Flyte-compatible code. (Only minor reworking is necessary.) Before writing the code from scratch, the user can look at the supported plugins if the task interacts with a tool or an external service. It's critical that the user be able to locally execute the code. Local executions are supported out of the box by Flyte. The user can run the code locally just like a Python file once it has created Flyte-compatible workflows. ### 2. Scaling the jobs The user may need to adjust resources in order to run the activities on a production setup, depending on how computationally demanding the jobs are. Flyte offers a declarative IaC solution, allowing the user to set the necessary CPU, GPU, and memory via knobs implementation. ### 3. Creating and testing the pipelines Create a pipeline or workflow by connecting all the jobs and tasks. Now to check the result, execute the code locally. ### 4. Setting up Flyte The user should be able to execute the workflows on the Flyte backend and build up a Kubernetes cluster on their local computers with the help of the Getting Started manual.It should just take a few minutes to launch the Flyte workflows on the backend because Docker, an OS-level virtualization platform, is already deployed. Configuring the database, object store, authentication, and other components is part of setting up Flyte for production. AWS, GCP, Azure, or any other cloud provider can be used for this, as well as an on-premises arrangement. # Flyte Architecture Flyte consists of various components. There are primarly 3 planes: 1. Input Plane All user tools that facilitate interacting with the main Flyte API are included in the User Plane. The FlyteConsole, Flytekit, and Flytectl are some of these tools. 2. Control plane The primary Flyte API is implemented in the Control Plane. All client requests coming from the User Plane are fulfilled by it. It retains data about ongoing and previous workflows and makes that data available upon request. Additionally, it agrees to requests to carry out workflows, but it delegated that work to the Data Plane. 3. Data Plane Workflow fulfillment is the only duty the Data Plane has. By launching tasks on a cluster of computers as necessary depending on the workflow graph, it receives workflow requests from the Control Plane and guides the workflow to completion. In order for the data to be saved and made available to end users, it sends status events back to the control plane. ![](https://i.imgur.com/cIG9zxP.png) Let's see what happens under the hood. Using the Flyte SDK, the user creates workflows. The user then uses FlyteCLI to compile and register them. The code is accessible on the FlyteAdmin, which contains data for tasks and workflows, following the registration of the workflows. The command plane is FlyteAdmin. The user creates a Docker container with all the listed dependencies. The FlytePropeller enters the picture after registration and the user wants to start the workflow. A Kubernetes Operator and a component of the data plane is called FlytePropeller. The operations are carried out by FlytePropeller, which also interacts with other Kubernetes operators and objects and stores the output in cloud blob storage. The user can view the results on the Flyte Dashboard thanks to FlyteAdmin, who retrieves them from the storage. # Introducing Machine Learning Microservices with UnionML By offering a uniform interface for datasets, model training, and batch, live, and streaming prediction, UnionML fills the gap between research and production. And thus UnionML provides the easiest way to build and deploy and scale machine learning microservices ![](https://i.imgur.com/yXlwstu.png) ## How does a UnionML application look like? ### 1. Importing Dependencies The first step is to import all the project dependencies ### 2. Creating the Dataset and the Model The next step involves creating the dataset and a model that will be bound to the dataset ### 3. Defining the methods #### 3a. Reader Method #### 3b. Trainer Method #### 3c. Predictor Method #### 3d. Evaluator Method All of these methods combined with the dependencies, the dataset and the model combines together to form the minimal UnionML app. Some of the inherent advantages that you get by using the UnionML application is the ability to create prediction microservices quickly and be able to execute these applications out of box. ![](https://i.imgur.com/U2f4uEc.png) ## UnionML Integrations UnionML also comes with a huge number of integrations. It is currently supported with FastAPI, but there are plans to also include integrations with Streamlit, Flask. Other integrations planned in the roadmap include hyperparamater optimization and machine learning libraries, serverless functions like AWS Lambda and also event driven services like Apache Kafka. ![](https://i.imgur.com/8KHIlpj.png) # Outrow Thus what that means is with Flyte, you can code, ship, and scale ML pipelines with ease! One issue that has persisted for a while is the convergence of engineering and machine learning workflows, which we must now resolve. We think Flyte bridges the gap between the two and gives engineering a lot more machine learning (ML) flavor. By building solid interface boundaries, Flyte intends to bring together data scientists, ML engineers, and platform engineers on a single platform. Visit our GitHub, look through our documentation, and join our Slack