>> You're not going to want to miss this episode of the AI Show.
Part 3 of three, looking at MLOps,
this time CI/CD with GitHub Actions and Azure Machine Learning.
You're not going to want to miss it. Check it out.
[MUSIC].
>> Hello, and welcome to this episode of the AI Show,
Part 3 of a three-part series looking at MLOps.
I'm here with Shivani Patel, how are you doing my friend?
>> Hi, I'm doing fantastic, how are you?
>> Fantastic. So tell us who you are, and what you do.
>> All right. I'm Shivani,
I work as a Program Manager
on the Azure Machine Learning platform team,
and I specifically work on MLOps.
>> All right. Let's talk about
the scenario that we're going to describe here.
>> So today I'm going to show you how to create
a CI/CD workflow using GitHub Actions and AML.
So basically what we'll be doing here is showing you how to create
a automated training pipeline with
machine learning pipelines and automated deployments.
Also we're going to touch on
the topic in that first video where we
showed you how to track your code assets and artifact,
and tying it all together.
>> All right. Let's dive in.
>> Great. So right here,
I am just showing you-all the repo,
where all the code is for your training,
your deployment configuration, all of those files.
So basically what's happening here is that every time,
let's say you fix or update one of your training codes.
So it could be registration or
your preparation files, whatever you're working on.
What that'll do is,
it'll basically trigger a GitHub Action.
Now what's happening in this build is
that this file is as we see controlling what's happening.
What it's going to do is pull
those files and trigger
a machine learning pipeline every time you update,
one of the scripts in there.
So let's see what that actually looks like.
So here I have an action that was triggered,
and this is where it will go ahead
and build that training pipeline and run it.
So you have these files that I was referring to as before.
So great, I'm at training pipeline that's running.
What's really cool is you can also see
the same thing happening here in your experiments.
You'll notice that it's being submitted via service principles.
So that means the GitHub Actions triggering it,
not me or sir or anybody else.
So when you drill into the actual run,
you can see exactly what's going on
as you've seen in the actual GitHub Action.
>> So let's pause for a second because
I want to make sure I understand.
Let's go back to the repo real quick if that's okay.
So basically these are the files that
comprise your code files for creating a machine learning pipeline,
for running let machine learning pipelines, is that right?
>> Exactly.
>> Awesome. So if these are long running processes,
if I check in another image file,
I don't want the whole thing to fire off again.
How do you prevent that from happening?
>> So in the actual build,
what we're doing here is we're only going to
run it when a Python file is edited or pushed.
>> I see, and so basically what it does is it
takes the code and runs,
because I'm looking at, I think it's line 35,
it's running this pipeline code.
What is this actually doing?
>> So that's basically
taking each of those files that are involved
in the machine learning
pipeline and running the latest version of those.
>> I see, and so then that automatically takes
you over to Azure Machine Learning.
Let's go back here one more to where it actually was running,
that one, it actually runs that pipeline.
Then I can see there it's creating all the steps,
and then it shoots that over to Azure Machine Learning service,
which is this thing which we're going to click on right here.
>> Yeah. So you can see it happening in parallel.
>> Fantastic. So that's all the continuous integration build up.
So that's what you mean by CI in this case?
>> Yes.
>> Fantastic. So now that the model is built,
what can you do now?
>> Right. So as you can see at the end of our training process,
our whole goal is to register this really amazing model.
In this case, this model will
be recognizing tacos and burritos, very important.
>> Very important. yeah.
>> Yes very important.
So at the end of this you can see that we're registering a model.
So every time there is a model registered,
we can go in here and it will actually trigger a build,
a GitHub Action for build.
So what's happening in the actual build file,
I can go back here,
please give me just a second, to workflows.
So in the deploy file what it's doing,
is it's going to use that same GitHub reference and pull
those files that were associated with that model that
you registered in your continuous integration build,
that previous build all those files,
especially the most important one is that
scoring file to actually load and run your model.
So that will get passed on and we'll go ahead and use the CLI in
this case to actually just run a simple command that'll pull
in those files using
that GitHub reference that I was talking about.
You can see here, it'll have the name of
the deployment model and the computer get
all those configuration files we showed you in the repo
and basically containerize it and deployed as a web service.
>> Okay, so let me see if I understand this part.
So there's two things that are unclear.
The first one is,
for example, when I check my code in,
it automatically does this build,
let's just say I've checked other code in
after this model may take a long,
let's just say it takes a week to build.
How does it know what code to actually use for the scoring?
Is the scoring is very specific to that check-in?
>> Right. So that's what I was referring to
the actual get preference so that show that you used
in that previous CI build.
>> I see. So if I'm understanding right,
when it was checked in,
it's stored the reference of
that particular command and pull
all the file. Is that what I'm understanding?
>> Yes, exactly the reference.
>> The second question is,
let's go back to where the GitHub Actions were fired,
I think is that, I can see, for example,
made a change, you see that it knows that it was checked into
the master branch and we saw in
the workflow or the GitHub Action knew about that.
How did the model register one get fired?
>> Let's show you right in here.
So when it's listening,
and so basically what's happening is
when that model is registered,
we use an Azure function that's actually
listening in for the modal restriction action that happen.
So just give a summary of what the Azure function is doing,
is it's using Event Grid,
which we'll just talk about in our second video,
to listen in for a model registration.
When that model is registered,
it'll go ahead and send
that information over to the GitHub Action.
Right here you can see that it's sending over the token,
the model, the model version.
You can specify what information you
want to send over to GitHub Action.
>> I see, and then that function is called,
and then it triggers that action to run again.
>> Yeah, right here.
So you see this is distant run until that function completed,
and that function we're calling this API [inaudible].
>> I see. So basically,
in it there was really informative in the second video,
you have this thing called Event Grid that shoots off events.
In this case, it's shooting event to
this Azure function that then saying GitHub,
it's time to do a deploy.
>> Exactly.
>> So what does that look like?
Once you do a deploy where does
it go in Azure Machine Learning service?
>> So from here, as you can see, we're calling the CLI.
It'll go ahead and deploy that model.
You can go back to your actual machine learning workspace.
Click on "endpoints." You can see
that endpoint show up right here.
So you can also see again that model that you register,
the experiments and now the endpoint.
If you want to go ahead and try and consume it,
what you can do is go ahead and ''copy'' this press "endpoint."
Maybe go on being right here,
I have a picture of a wonderful taco.
>> Yeah.
>> Then you'll ''paste'' that in front of the actual image link,
and then that will do prediction right here,
it saying it's 99 percent transmitters taco,
pretty confident that is taco.
>> Well, I'm pretty confident that it's also a taco.
It's also making me very hungry.
Well, this is pretty awesome.
Any other information you want to give about this?
>> No. Try it out for yourself.
We'll post some links in the video below.
So definitely check it out.
>> Thank you so much Shivani.
Thank you so much for watching and learning all about MLOps,
specifically how to do continuous integration,
continuous deployment with GitHub Actions.
Thank you so much for watching.
We'll see you next time. Take care.
[MUSIC].