Snowflake Native Apps — Simple CI/CD for ML Apps

<p>Snowflake native apps allow you to develop applications directly on your data in your Snowflake cloud. With native apps, you can build out apps that can go above and beyond what traditional BI tools can do all while maintaining Snowflake&rsquo;s high standard of security. Since native apps are still in their early stages (still in private preview at this time), there is no standard way of automating development processes with continuous integration and continuous delivery (CI/CD). CI/CD is at the core of modern DevOps and agile app development and will need to be implemented for any non-trivial use case. In this article, I&rsquo;ll go over the simple CI/CD strategy I used for deploying Snowflake native apps and provide the associated code for both the app and CI/CD process.</p> <p>For this CI/CD setup, I focused on using models in Sreamlit with a Snowflake native app. For a fully-fledged ML app, there are many more components that need to be taken into consideration with CI/CD, but lots of good reference material already exists for the upstream MLOps.</p> <p>Goals for this CI/CD implementation:</p> <ol> <li>Deploy a ML model in a native app and access the model using Streamlit</li> <li>Automate SQL execution so I don&rsquo;t need to run any individual SQL statements by hand</li> <li>Seamlessly move between local, dev, and prod environments</li> <li>Continuous deployment with Github actions integration</li> </ol> <p>&nbsp;</p> <h2>Overview</h2> <p>Before we can get the CI/CD automation, we will need to generate a model object and Snowflake UDF that will be used to make the predictions. In a real setup, this would happen in a separate MLOps pipeline, but to keep things simple we will build and train a single model using Snowpark stored procs. This leverages Snowflake compute for model training and will produce the model that we will use for predictions.</p> <p><a href="https://medium.com/@prestonblckbrn/snowflake-native-apps-simple-ci-cd-for-ml-apps-98be076564ce">Read More</a></p>
Tags: CD CI ML Snowflake