Petrobras MLOps Transformation With MLflow and Databricks
Summary
- MLOps automation: Petrobras replaced error-prone manual validation with automated metric-driven workflows using MLflow and Databricks Asset Bundles.
- Deployment acceleration: The new MLOps framework reduced model deployment timelines from days to hours, enabling faster time-to-value for ML initiatives.
- Production governance: Unity Catalog established granular governance and reproducibility across production models, ensuring compliance and scalability in Petrobras' complex energy ecosystem.
Petrobras MLOps Transformation With MLflow and Databricks

Talk by Bruno Guberfain do Amaral, Consultant, Petrobras ; Luiz Carrossoni Neto, Sr. Solutions Architect, Databricks
As a global energy leader, Petrobras relies on machine learning to optimize operations, but manual model deployment and validation processes once created bottlenecks that delayed critical insights. In this video, we’ll reveal how we revolutionized our MLOps framework using MLflow, Databricks Asset Bundles (DABs) and Unity Catalog to: Replace error-prone manual validation with automated metric-driven workflows Reduce model deployment timelines from days to hours Establish granular governance and reproducibility across production models Discover how we enabled data scientists to focus on innovation—not infrastructure—through standardized pipelines while ensuring compliance and scalability in one of the world’s most complex energy ecosystems.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
FAQs
How did Petrobras reduce model deployment time?
Petrobras revolutionized their MLOps framework using MLflow, Databricks Asset Bundles (DABs), and Unity Catalog. This automated metric-driven approach replaced manual validation processes, reducing deployment timelines from days to hours.
What was the scale of Petrobras' data science operation?
Petrobras has more than 1,000 full-time data scientists and over 1,000 additional employees working with data science in their daily roles. This scale made standardization and governance through MLOps critical to operations.
How do I move a machine learning model from experimentation to production?
This video presents Petrobras' MLOps transformation: they standardized model development using MLflow for experiment tracking and model registry, then deployed models to production through Databricks Data and AI platform. The unified approach reduced deployment time significantly while improving model governance and reproducibility.
How do I standardize MLOps across multiple data science teams?
This video shows how Petrobras achieved MLOps standardization by centralizing experiment tracking, model registry, and deployment workflows through MLflow integrated with Databricks Data and AI platform. The platform provides consistent governance, versioning, and deployment practices across all data science teams.
How can AI agents help data scientists build, debug, and productionize machine learning models?
This video demonstrates how AI agents can assist data scientists with repetitive tasks in the ML lifecycle, from experimentation through deployment. By automating debugging, hyperparameter optimization, and deployment processes, agents accelerate the time from model concept to production.
Full transcript
Hi everyone. Thanks for having me today. We'll We'll talk today about how Petrobras leverage ML spreads inside the company. First, there's a forward-looking statement. These doesn't apply for the stock or the components. And the details today are from uh public features, so there's there's no apply for today. So, let's start. , present yourself. Yes. I'm senior solutions architect here Databricks. And I attend Petrobras as account.
Thank you. Hello everyone. I work as a consultant for data scientist Petrobras. Maybe some of you may not know about Petrobras. So, a little I bring you a brief introduction about our company. Petrobras is a Brazilian energy company that is based on oil and natural energy, oil and gas exploration, and production. We have a deep expertise in ultra deep water exploration. This means that we go as deep as a thousand thousands of meters below the sea level to find oil and bring the energy to our country.
And it's a very big company in Brazil. So, we have more than 40,000 employees on there, and we have even more if you consider all the people that work with us, or partners that work with us. Within this group, we have at least more than thousand more than a thousand data scientists working with full-time data science and full-time data science employees. They work only with data science on their daily jobs. And we have more than thousand people working with data science with um on their daily not in a daily job, but within with data science on their jobs.
So, we have a lot of people working with data science in Petrobras, and I think that is the main point that we can um it's the main point that bring us to our journey. Before we talk about uh ML Ops, I'd like to bring you to the data journey that we fought that we get in the previous years. Our data journey begins a few years ago. In this moment, we have a lot of um difficulty in scaling our engineering data engineering pipelines.
We have a lot of data engineering working on different areas of the company, but they have very difficult time getting this uh in production. They have uh separate tools, they have specific tools, and they are very spreads all over the company. And we have spread this along the company, we have as well some difficulty in finding data. You don't have an entry point, you don't have a central point where I can find the data in our company.
So, it's very diff- it was very difficult for them to find the data. You can imagine if you want to use any like uh RNA uh data, and you ask the department, and then you get back a Excel file that well, what I can do with this? The but um in a few days, this Excel may not be updated, and it will be being to cold data. So, I think this is our where our data journey begins. I won't get into details, but nowadays, we have established a data governance that has a very strong data mesh implemented.
We have data teams that works all over the departments and they work together with the IT department to bring data into the Databricks platform. This this governance also allows allows to bring this data to a metadata store where everyone can search data. So, it's very easy for a user to find and search for to find data that he's searching for. And we have as well a pipeline that uh that brings this data every day and so it updated with parity students.
If you want more details, I'd like to present to you my friend at Petrobras that has this presentation that he talks a little bit more about the journey what in the previous year. It was uh it is presented in Portuguese, but I think you have turn you know, you can turn on their captions and translate automatically. And this this this brings us to our machine learning operation at Petrobras. Again, we start with a lot of data scientists working along all over the company.
They have a lot of people working with data science in a very different areas. And we have even more potential data science working with small projects all over the company. And they have a well-defined experimentation environment. This means that they have some kind of if they want computer power to experiment with their data, they can they find it easy in our company, but there is there was no clear path to productionize those solution.
That's why we have this uh uh, this issue in that we have a good experimentation, experimentation, but we don't have a clear path to bring those solutions to production. And with our data solution, with our MLops solution, we're developing on top of my on Databricks and it's used basically on these three steps. The first one is Databricks asset bundles. We started using asset bundles think, uh, a year ago and it was the short-term way to get to the plat to MLops to platform to work with MLops at Petrobras.
I think that, uh, it is very well suitable for our needs and it brings back to, um, it's very simple to learn as well. And on top of that, we also use MLflow to experimentation. So, data scientists uses, um, a lot of MLflow to do experimentation and as well for for putting models on production as well. It has a catalog for models as well. And, asset bundles was very flexible, so we can hey use our DevOps platform that was built on top of GitHub.
So, I think that this is the main point that we have that, um, bring the asset bundles to a good solution to our MLops platform. In a nutshell, what we did, this is our current architecture. So, on the left side, you find the data platform I talked to you before. So, the data chain uses those, um, three environments that are actually three workspace to bring data from our external system into a uh, gold standard system.
It's a And the gold standard is the we call internally the curated data. Is the data that can be used by end users or applications as well. Those date These data are is uh can be found using internal portal that we develop and the and the user can find and ask for access to this data on this platform. On the right side, you find the data scientist working within the ML Ops platform. So, we have the three environments over there.
But, the data scientist only interact with the development environment. It has a little bit more loose permissions. I mean, they can create jobs manually. They can inspect environment just to get to engage with the platform. But, to put models on production, to make production um to make machine learning production, you must go through our dev ops pipeline that runs on top of GitHub. As you can see, he he interacts here or she interact with the GitHub to put models on production.
He brings this uh using asset bundles. Those machine learning artifacts are then pushed back to our data platform just to get into the our catalog of data. It joins together with the data data products and machine learning products as well. Then, they can be consumed by the end users and application if needed. It follows the same pipeline for um to have to authorization. You don't have to authorization. Well, I I just like to materialize one use case that we have.
A internally, it's uh text classification. So, it's just a a simple binary classification. No no LLM, no fancy things here. Just a machine learning model, classic model. But I think that the real challenge here is how to put it in production and automatize all these works and have the all the governance that goes to production here. And what we do is we receive some files from a federal registry that has some publications that are interesting to Petrobras.
Um in Brazil we have a very complex tax uh rules. They can be federal, state law, state based or based on the city. So and this changes is a very dynamic environment, so it changes sometimes and we have to take care of new publication that changes some of the rules that were subjected to. But as you can see we have a lot of rules mean being changed every day. So which one are relevant to our company or not? So for this we have a subject matter expert that is guy on the bottom that tries to to tell which of those documents are relevant or not relevant to our business.
And within the cycle that we created, we created two jobs basically. One job to do the classification and one job to update the model because the SME SME is always updating and creating new annotations every day. So just to bring you to a a more specific solution here, more details. We have um a pipeline that is created by the data team that brings this data from the outer system into the data platform that in a nutshell is just table with a fields and the SME can update this data and then it can have some files that are uh relevant or not relevant.
Those files with annotated data are brought to our MLops platform and the job that runs like daily, they can update this model with this new annotated data and register a new version of the model on the Unity Catalog using MLflow. Then this model can be is used the latest model used by the prediction job to fill back the values on the table and it can afterward we have this table final table with all the fields um some are from the annotated data and some are from our automatic annotated data.
And it accelerates the business they have because they now have a a full list of new publications that are relevant or not relevant to our business. Well, in a nutshell, what we find out is the MLops provided by Databricks has a very robust solution for production usage. And um I think that the feedback we have from the data scientists is really good. They think that they say that is really easy to use this pipeline in production because the learning curve you will use to using the notebooks but are not but you have just to learn a little bit more about the data Databricks asset bundles where it can and it's very easy to learn.
It's not hard to learn. So they have very very very good feedback from this. So I think it's very easy solution for machine learning publication for machine learning going to production. And it's very adapted to our flexible to adapt to our current day DevOps pipeline that runs on GitHub. So, I think that is summarized what we find out about ML Ops at Petrobras. And I think that this journey is just starting. This morning I was in a meeting in a in a in a presentation about asset bundles.
And they are presenting new features very interesting as well. So, I think that we're still evolving this environment and I think that Databricks is good being a good partner for us for this in this journey to our getting more production, getting more value to the data, to the to the machine learning solutions. So, I'd like to thank you and maybe Causali can tell a little bit more about the asset bundles here. Perfect.
Okay, thank you. Thanks. Well, thanks everyone again. I will tell a little bit about the details of the components using on the what showed to us. showed already said about Databricks asset bundles and MLflow, but there's more other components in the solution as well. First of all, I want to thank Data Solutech, a partner of us that helped on the successes of this implementation. And this project was born because Petrobras challenged us to implement what is is described on the big book of ML Ops, which is free for download.
I really recommend to do so if you're interested. Uh everything that we will talk about about here is related to this book as well. So, uh here is a picture extracted from the book. Uh The primary component that mentioned is MLflow. MLflow is the centerpiece of the solution where offers the full life cycle model management. Petrobras is leveraging MLflow for tracking and cataloging the model in Unity Catalog, and also for deploying the model for the end users.
The other solution that's already on this picture is MLops stacks. mentioned about Databricks asset bundles. MLops stacks works under the covers behind Databricks asset bundles, bringing the power for the ML projects teams to develop ML projects as a code. And with that, they can collaborate in a version source control repository like GitHub that Petrobras is using. The other components that said is Databricks workflows.
Via GitHub actions, Petrobras is deploying all of their model pipelines, and behind under the covers is triggering jobs via GitHub actions to Databricks workflows automatically. And everything is monitored and logged it through the platform. So, when we say that machine learning thing at Petrobras is deploying a machine learning model, actually they are deploying the code, all the resource behind the solution or the project as well, and all the pipelines across the different environments in an automated and fully integrated way.
And the piece and the component that bring together all of this is Databricks asset bundles. Databricks asset bundles is what made possible Petrobras to achieve the MLops practice by bringing it together the code, so you can define metadata alongside the code, the source code, and also you We define metadata of the Databricks resource like jobs, like workflows as a source files. So, infrastructure infrastructure as a code as well, you can apply on Databricks asset bundles.
And bundles comes with a default templates for the machine learning project within MLops stacks that can be customized to attend what what are your needs. Petrobras did some customizations for example to force some policies that they have inside a company. And this is highly customizable within Databricks asset bundles. Databricks asset bundles basically is a collection of the source files, the resource that is being used in by the project, and also the configuration file.
It's a simple YAML file that can define everything on that. This YAML file is validated, deployed, and executed within Databricks CLI for example. Or you can use your IDE. And Databricks just released a new tool that you can do this also in Databricks UI. And Petrobras enables now all their machine learning teams and the users to have two deployment types. This is also extracted from the big books of MLops. They can expose online models via model serving endpoints.
And they can expose batch models that is being triggered by jobs and pipelines and doesn't need a low latest approach. Everything depends on the use case. If it's optimized for latest, of course the cost is more than a batch job for example. This is a real example of extracted from the templates that Petrobras is using for that. This is for online models. They are simple to find the resource the model server endpoint.
You can define the name of the server entities, the name of the model. If you use GPU or not. So everything is customizable depending on the project and the machine learning teams can use this to attend their needs. This is another example for batch. Is this the example that the real use case that showed to us is using. Basically, you can define when it will be executed the schedule the duration. The notebook and the resource attached to this job as well.
And with that Petrobras can allow their teams to basically use the full power of the data platform. In a collaborative way, governed and scaled. So their users can innovate quickly. And also can collaborate with each other. In a ML Ops practice inside the company. The results is faster time to production as mentioned earlier. So that's it. Let's open for questions if anyone has and thank you.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.