Prelogue:
Recently kdNuggets published this poll survey depicting that one of the hottest skills is MLOps nowadays. Although I knew ML Ops is devOps for ML; but knowing that one line is clearly lacking as a data scientist. And boy that's not good for my career. So buckle your seats as I take you through my internet voyage through knowing basics of ML Ops.
Introduction:
To begin with, one must read the awesome intro to ML Ops written by google clouds. This awesome article first introduces the concept of CI/CD/CT. which are respectively continuous integration, continuous delivery and the last option being specific to ml models: continuous training.
This post then goes on to define each of terms and establishes the facts that ml code is actually a very small part of a data science exercise; with starting from product designing and data storage; to data validation, data fetching, model deployment and many more concepts actually come together to create the whole picture of ml practice in a company.
After that this article mainly talks about
(1) 0 level ml ops:
static model development in offline and then deployment
(2) 1 level ml ops:
dynamic model development pipeline with two main tracks of modeling; one of which continuously gathers more and more data from the online traffic and then builds new data to re-train the model automatically in the CT(continuous training) pipeline.
The second pipeline is the manual model training track; which starts the original CT track the first time by providing source code related to model as well as feature stores and other relevant resources.
This second and manual track gets triggered automatically from the automated track whenever data shows pattern changes, features fail in various tests and so on. The above mentioned article describes all that very well.
(3) level 2 ml ops:
This is the most advanced stage of ml ops. In this stage, the continous integration is also automated. i.e. the manual track we were talking about above is actually translated into an semi-automatic pipeline.
In this new pipeline, once the data scientist employs the changes in parameter, algorithms or some other specifications; the integration ( testing of the model, validation, test case performance check of packages written ) is done automatically and then the model is checked with the last version of it in terms of accuracy and other similar performance metrics. And finally the CD is also automatically completed.
This level of ml ops scaling, gives data scientists much time to actually change and experiment their models in vast variety and then come up with better results rather than wasting time with repeating similar tasks in the manual track.
How to start with such pipeline in your work?
For this, I will read the referred articles one by one. From this article, you will get a basic idea of how to create a ci/cd pipeline for your own data-flow. I will summarize the article in fewer words; as a gist; to keep up the continuity of our current post.
This second post, actually introduces us to the google cloud platform and aims to teach
(1) cloud build (2) cloud composer and (3) data flow
With these 3 tools, we can supposedly build data pipelines for automatic CI/CD. Let's see how we do that. Before beginning of the tutorial itself, google describes the tools like cloud build, cloud composer and data flow.
Before all that, just let's look at this picture and get intimidated for sometimes.
Now that we are properly intimidated; google will slowly describe why you don't need to be.
Basically you can consider the CI/CD pipeline as a small packaging and loading line in a delivery bay.
Imagine 3 people standing; A,B and C.
A takes a new fresh product, packages it under a nice box, gives it to B.
B checks the box strength, size, product labels and other things and also writes a delivery instruction on the top of the box; finally giving it to C.
C takes this checked product and finally as B tells he loads the product on the truck; which ships for customers.
Now, in CI/CD pipeline, absolutely the same thing is happening.
Here,
First new product arrival refers to new commit in code repository in the cloud.
A being the cloud build; creates a JAR ( java archive which I don't know what it is) file using Maven builder and tests the JAR build by automatic java test cases.
Then it uploads it to test JAR bucket in a cloud storage; which is later picked up by C for running the workflow.
Here B is also cloud build itself, which now additional to creating the automated running build ( a good question to ask here is what is technical definition of a build, will answer later), it also
sets variables in cloud composer to refer to new JAR build.(writing delivery instructions)
And finally it also triggers the test files stored in cloud storage, as cloud build deploys the test files and test the newly built workflow.
Finally the cloud composer, runs the workflow using the JAR and workflow DAG.
Here there are a bunch of terms which I am just taking as it is but not explaining. These are:
maven builder, JAR, build and DAG.
I will go through these later after I get a handle of what is happening.
Now, after explaining all these, we enter to the main tutorial.
Before entering the main tutorial you actually see the google cloud platform for the first time. It is a whole new ball game; and looks like this:
Now I will try and explore a few things in the google cloud platform, as it is free for first timers for starting 3 months. I plan to put those exploration in a separate post entirely on google cloud exploration.
Now for the build, composer and storage understanding we will enter into the main tutorial. make sure:
(1) you have also opened your project like this
(2) enabled APIs
(3) last but not least verified the billing
Main tutorial and begining of the code:
I am still working on this portion of the post. I know, you are like, what takes you so long? well I will come back tomorrow and update this more. Upto that point, stay tuned with me to learn MLOps with me.
Comments
Post a Comment