<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0"><channel><title>Pulumi Blog: Kat Morgan</title><link>https://www.pulumi.com/blog/author/kat-morgan/</link><description>Pulumi blog posts: Kat Morgan.</description><language>en-us</language><pubDate>Tue, 23 Jan 2024 19:41:13 +0000</pubDate><item><title>The Pulumi 'Push to start' GitOps Experience</title><link>https://www.pulumi.com/blog/pulumi-developer-workflow/</link><pubDate>Tue, 23 Jan 2024 19:41:13 +0000</pubDate><guid>https://www.pulumi.com/blog/pulumi-developer-workflow/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/pulumi-developer-workflow/index.png" /&gt;
&lt;p&gt;As a skeptic of &amp;ldquo;quick starts&amp;rdquo; myself, I approach most marketing promises with a measure of cautious excitement. If the great and powerful algorithm, friends, or a peer brought your attention here, then I invite you to take this one seriously.&lt;/p&gt;
&lt;p&gt;Pulumi, with its full support of many general-purpose programming languages, can appear like a chore to get started with. The feeling can haunt seasoned developers as much as practitioners new to infrastructure code.&lt;/p&gt;
&lt;p&gt;However, I&amp;rsquo;ll show you that finding the proverbial easy street is easier than you might believe. The &lt;code&gt;pulumi new&lt;/code&gt; developer story just gets sweeter when combined with a few other nice-to-have conveniences.&lt;/p&gt;
&lt;p&gt;This is a &amp;ldquo;bring your own &lt;a href="https://github.com"&gt;GitHub&lt;/a&gt; login&amp;rdquo; event, so refresh that login. You will want to grab a &lt;a href="https://app.pulumi.com/signup"&gt;Pulumi Cloud&lt;/a&gt; login as well. With credentials in hand, you are set with everything that you need to start. Let&amp;rsquo;s go!&lt;/p&gt;
&lt;h2 id="index"&gt;Index&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#new-technology-learning-advice"&gt;New technology learning advice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-devops-journey"&gt;A DevOps Journey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#devops-day-0"&gt;DevOps Day 0: Plan &amp;amp; Prepare&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#devops-day-1"&gt;DevOps Day 1: Execute&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#devops-day-2"&gt;DevOps Day 2: Enhance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#cleanup"&gt;Cleanup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Hint:
all of the steps in this demo are ready to run yourself from the &lt;a href="https://github.com/pulumi/devcontainer"&gt;Pulumi Devcontainer&lt;/a&gt; using just your web browser and a Github account. Even better, they are real activities that Pulumians use every day to orchestrate the cloud too!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="new-technology-learning-advice"&gt;New technology learning advice&lt;/h2&gt;
&lt;p&gt;When it comes to ice cream, sometimes just selecting your flavor can be too much. Similarly, when choosing where to start with cloud tooling the onset of &amp;ldquo;choice paralysis&amp;rdquo; can be chronic. Pulumi&amp;rsquo;s powerful toolset is both a worthy endeavor to learn and a rewarding challenge to master. There is no better time to learn than the present!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;If you are short on time and have a bike, do you stop to hop on the bike, or choose to walk because there is no time to stop and get on?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Freezing, while great for ice cream, is not quite as satisfying when building the next cloud solution and putting it off for next week or next year can be about as useful as walking fast and pushing a perfectly good bike because there is no time to stop and get on.&lt;/p&gt;
&lt;p&gt;How can we overcome the learning curve? Picking up and mastering a new tool can be easy if we choose to start small.&lt;/p&gt;
&lt;blockquote&gt;
&lt;h3 id="tech-learning-hacks"&gt;Tech learning hacks:&lt;/h3&gt;
&lt;p&gt;🏆 Do: Start&lt;br&gt;
🔨 Use: Helpful Tools&lt;br&gt;
🥅 Make: Achievable Goals&lt;br&gt;
🎉 Win: Celebrate Successes&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Recognizing achievable goals can be tricky when you are learning something new. Always over-estimate the complexity of each step. If you overestimate how complicated a task might be, the biggest risk is accomplishing the goal faster than you think! Either way, the learning journey should be enjoyable and rewarding by following this rule.&lt;/p&gt;
&lt;p&gt;Helpful tools are more abundant than ever. I recommend Pulumi as one of the most helpful tools but that is my bias showing through. Consider how intuitive, durable, and well-integrated any tool selection you make will be. Today we&amp;rsquo;re using multiple features and services of both the Pulumi and Pulumi Cloud offering, as well as demonstrating the benefits of a tightly integrated Git, Github, Devcontainers, and VSCode workflow to make light work of a traditionally considerably complicated achievement.&lt;/p&gt;
&lt;p&gt;The resulting developer stack left me feeling like I would be successful automating anything. Be sure to share your experience with us in the &lt;a href="https://join.slack.com/t/pulumi-community/shared_invite/zt-2amio1u4h-5Y35enT27Y0dk4N8ZYHbMg"&gt;Pulumi Community Slack&lt;/a&gt; or find us on &lt;a href="https://twitter.com/PulumiCorp"&gt;Twitter/X @PulumiCorp&lt;/a&gt; too!&lt;/p&gt;
&lt;h2 id="a-devops-journey"&gt;A DevOps journey&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;The best solutions are often buried in the details. The only way to reach them is to dig.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In true DevOps fashion, development for this blog post featured a roller coaster of chronic scope creep, pushing deadlines, discovering details that scrapped the original plan, and during the final finish line approach too! The worry and doubt was palpable.&lt;/p&gt;
&lt;p&gt;Have we taken on too much? Did project ambitions exceed the achievable? The solution emerged while hacking on a side quest with a friend. A single vision came into focus, tying everything together into a simple &amp;ldquo;&lt;em&gt;Push to Start&lt;/em&gt;&amp;rdquo; Pulumi developer workflow.&lt;/p&gt;
&lt;p&gt;In this story, it took two tries to achieve the goal. Often it can take several tries. With that backstory let&amp;rsquo;s begin this next learning adventure together.&lt;/p&gt;
&lt;h3 id="devops-day-0"&gt;DevOps day 0&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s track our DevOps journey in typical &amp;ldquo;DevOps Day&amp;rdquo; style. Because we&amp;rsquo;re &lt;a href="https://en.wikipedia.org/wiki/Zero-based_numbering#:~:text=In%20computer%20science%2C%20zero%20is,from%20zero%20rather%20than%20one."&gt;counting like computers&lt;/a&gt;, of course, we start with zero. In other words, we need a goal, and we will be starting from scratch.&lt;/p&gt;
&lt;p&gt;Day zero is going to be your design, planning, and prep phase. Sometimes this includes various stages of research and other times it is a matter of just getting started with hands-on investigation.&lt;/p&gt;
&lt;p&gt;Every journey includes a beginning and an end. To demonstrate the Pulumi &lt;em&gt;Push to Start&lt;/em&gt; developer workflow, we need a project to develop! For this adventure let&amp;rsquo;s use the &lt;a href="https://www.pulumi.com/registry/packages/kubernetes"&gt;Pulumi Kubernetes Provider&lt;/a&gt; from the Pulumi Providers registry to deploy an app on Kubernetes. This provider is one of our most popular providers, as you might guess.&lt;/p&gt;
&lt;p&gt;In this case, we can practice with a new project from the &lt;a href="https://www.pulumi.com/community/"&gt;Community Engineering&lt;/a&gt; team. The GitHub &lt;a href="https://github.com/pulumi/devcontainer"&gt;pulumi/devcontainer&lt;/a&gt; repository is a GitHub &lt;a href="https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template"&gt;template repository&lt;/a&gt; containing all the fundamentals of a new Pulumi infrastructure as code GitOps project. Let&amp;rsquo;s begin with a quick tour of the GitOps repo boilerplate.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;&lt;em&gt;What belongs in a GitOps git repository?&lt;/em&gt;&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have seen this question raised several times during the past year. Most recently it was brought up during a great customer conversation at AWS re:Invent.&lt;/p&gt;
&lt;p&gt;Filtering through the conflicting opinions and advice about proper GitOps repo hygiene, a few fundamentals remain consistent.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Ops Environment
&lt;ul&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;li&gt;Artifacts&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Documentation
&lt;ul&gt;
&lt;li&gt;Who it is for&lt;/li&gt;
&lt;li&gt;What it does&lt;/li&gt;
&lt;li&gt;How to Operate&lt;/li&gt;
&lt;li&gt;Why it is important&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Actions
&lt;ul&gt;
&lt;li&gt;Testing: Continuous Integration&lt;/li&gt;
&lt;li&gt;Deployment: Continuous Deployment&lt;/li&gt;
&lt;li&gt;Safety: Version Controls&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You may have assembled projects piece by piece before. In the &lt;a href="https://github.com/pulumi/devcontainer"&gt;pulumi/devcontainer repository&lt;/a&gt;, we provide a turnkey &amp;ldquo;known good&amp;rdquo; starter kit which will even improve over time. As a community resource, we welcome bugs and contributions!&lt;/p&gt;
&lt;p&gt;And now for the feature presentation, let&amp;rsquo;s get to dev&amp;rsquo;ing!&lt;/p&gt;
&lt;h4 id="whats-in-a-devops-day-0"&gt;What&amp;rsquo;s in a DevOps day 0?&lt;/h4&gt;
&lt;p&gt;Day 0 usually includes aspects of planning and preparing. For this exercise, we have just a few requirements to get started. Let&amp;rsquo;s knock these out and get to the fun stuff!&lt;/p&gt;
&lt;h4 id="prerequisites"&gt;Prerequisites&lt;/h4&gt;
&lt;p&gt;Now, even the fanciest push-to-start car still requires a fob, so let&amp;rsquo;s cover those bases super quick.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Web browser&lt;/li&gt;
&lt;li&gt;GitHub account&lt;/li&gt;
&lt;li&gt;10 minutes (approx.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Next, let&amp;rsquo;s review the tools we will depend on for developing and deploying our project.&lt;/p&gt;
&lt;h4 id="commandline-utilities"&gt;Commandline Utilities:&lt;/h4&gt;
&lt;p&gt;*Dependencies supplied in the Pulumi devcontainer &lt;code&gt;ghcr.io/pulumi/devcontainer&lt;/code&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;Tool&lt;/th&gt;
&lt;th style="text-align: center"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;A Programming Language&lt;/td&gt;
&lt;td style="text-align: center"&gt;The code part of IaC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Pulumi CLI&lt;/td&gt;
&lt;td style="text-align: center"&gt;Infrastructure as Code Tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Pulumi ESC&lt;/td&gt;
&lt;td style="text-align: center"&gt;Secrets and Configuration Store&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Kubectl&lt;/td&gt;
&lt;td style="text-align: center"&gt;Kubernetes CLI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Direnv&lt;/td&gt;
&lt;td style="text-align: center"&gt;Automated Environment Variables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;KinD&lt;/td&gt;
&lt;td style="text-align: center"&gt;Local Kubernetes Infrastructure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;Github CLI&lt;/td&gt;
&lt;td style="text-align: center"&gt;Github &amp;amp; Git Repository Binaries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;curl, jq, act, awk, etc&lt;/td&gt;
&lt;td style="text-align: center"&gt;Other useful tools&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="cloud-native--cloud-developer-environment"&gt;Cloud-native &amp;hellip; cloud developer environment?&lt;/h3&gt;
&lt;p&gt;Besides our command line tools and the programming language of your choice, we need an editor to write our code with. Many practitioners are fluent with Vim or Emacs; others turn to editors like VSCode, IntelliJ, and others. We are going to choose the GitHub Codespaces VSCode IDE for its deep integration with GitHub, and its convenience of requiring nothing from the user other than a web browser to use.&lt;/p&gt;
&lt;p&gt;If you are already familiar with GitHub Codespaces, then you might know what to expect next. If not, you are in for a treat, and yes that is right, we are &lt;em&gt;developing for the cloud, in the cloud, with the cloud&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Alright, let&amp;rsquo;s jump in and get started by launching a new &lt;a href="https://github.com/features/codespaces"&gt;GitHub Codespaces&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;👇 Click this button to begin.👇
&lt;a href="https://bit.ly/pulumi-devcontainer"&gt;&lt;img src="https://github.com/codespaces/badge.svg" alt="Open in GitHub Codespaces"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you prefer a more informed approach you can launch the same codespaces by navigating to the &lt;a href="https://github.com/pulumi/devcontainer"&gt;Pulumi Devcontainer Repository&lt;/a&gt; or you can learn more about Codespaces at this &lt;a href="https://docs.github.com/en/codespaces/overview"&gt;Github Codespaces Link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Clicking the &amp;lsquo;Open in GitHub Codespaces&amp;rsquo; button should take you directly into a new Codespaces session.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note:
This demonstration is deeply integrated into the Web based Codespaces environment offered by Github. Alternatively, VSCode also supports running Devcontainers with Docker locally allowing you the benefit of &lt;a href="#pulumi-devcontainer"&gt;Pulumi Devcontainer&lt;/a&gt; on your own hardware.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With a new codespaces session launched you should see the VSCode IDE in your browser. If you are not already familiar with VSCode, you can learn more about it in the &lt;a href="https://code.visualstudio.com/docs"&gt;VSCode Docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Congratulations! Your developer environment is ready for some Pulumi action.&lt;/p&gt;
&lt;p&gt;&lt;img src="image-vscode-codespaces-blank.png" alt="Screenshot: Pulumi Devcontainer Codespaces session"&gt;&lt;/p&gt;
&lt;p&gt;For our final Day 0 step, we still need to decide what app to deploy with our Infrastructure-as-Code (IaC) program.&lt;/p&gt;
&lt;p&gt;Focusing on something fun, let&amp;rsquo;s deploy Minecraft as the app for our Kubernetes exercise. It&amp;rsquo;s a fun way to get started with Pulumi, a great way to show off your cloud skills to friends, and maybe even share with your favorite young future technologists! After all, Open Source DevOps is for everyone!&lt;/p&gt;
&lt;h3 id="devops-day-1"&gt;DevOps day 1&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;We have an environment! We have a plan!
Now we need to code &amp;hellip; or do we?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Don&amp;rsquo;t just take my word for it. The big brains of Pulumi&amp;rsquo;s AI Engineering team have delivered a brilliant Pulumi AI. Your Pulumi IaC developer sidekick makes learning and developing Pulumi just that much easier.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Q: What can Pulumi AI do?
A: Today&amp;rsquo;s AI is all experimental. As an industry, we are only just beginning to discover the possibilities, but you are invited to try it yourself with the &lt;a href="https://www.pulumi.com/product/neo/"&gt;Pulumi Neo WebUI&lt;/a&gt; or with the &lt;code&gt;pulumi new&lt;/code&gt; cli as demonstrated below.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="-pulumi-new---ai"&gt;&lt;code&gt;~$ pulumi new --ai&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://pulumi.com/product/neo/"&gt;Pulumi Neo&lt;/a&gt; is available via WebUI much like the ChatGPT console. Besides the familiar browser-based interface, Pulumi AI is also built into the &lt;code&gt;pulumi new&lt;/code&gt; CLI too! Now you can prompt Pulumi AI interactively from the convenience of the command line tools you will already be using, conveniently configured in your new Codespaces IDE.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try it! (Reminder: Perform all these steps from within the Codespaces IDE.)&lt;/p&gt;
&lt;h4 id="step-1-login-to-pulumi-cloud"&gt;Step 1. Login to Pulumi Cloud&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# First Login to Pulumi Cloud for a few features we will use in upcoming GitOps content.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi login
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="step-2-create-a-new-program"&gt;Step 2. Create a new program&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Let&amp;#39;s create a new pulumi with the Pulumi CLI&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi new
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="step-3-yolo-for-fun-and-profit"&gt;Step 3. YOLO for fun and profit!&lt;/h4&gt;
&lt;p&gt;Let&amp;rsquo;s go all in on this one and try Pulumi AI. We can always enhance the prompt with additional dialog back and forth during the &lt;code&gt;pulumi new&lt;/code&gt; chat if it doesn&amp;rsquo;t meet our expectations right away.&lt;/p&gt;
&lt;p&gt;It is good to keep in mind that even as advanced as AI is today, the practice is still very much in its infancy. We will save more deep dives into the differences Traditional Ops (Imperative Ops), GitOps (Automated Declarative Ops), and AI Ops (Probability Augmented GitOps) in another post, for now let&amp;rsquo;s see how close the Pulumi AI can take us.&lt;/p&gt;
&lt;p&gt;&lt;img src="image-1.png" alt="Alt text"&gt;&lt;/p&gt;
&lt;p&gt;Woohoo! We selected the AI option on CLI, let&amp;rsquo;s follow the user prompts and feed the AI a simple prompt of what we want our Pulumi project to create.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Write a pulumi infrastructure as code program which creates the namespce &lt;span class="s1"&gt;&amp;#39;minecraft&amp;#39;&lt;/span&gt; and using the pulumi_kubernetes.helm.v3.Release to deploy the https://itzg.github.io/minecraft-server-charts &lt;span class="s1"&gt;&amp;#39;minecraft-server&amp;#39;&lt;/span&gt; helm chart, sets EULA to true, deploys onto Kubernetes in the minecraft namespace.&lt;span class="s2"&gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;How did we do? Let&amp;rsquo;s see what the AI came up with.&lt;/p&gt;
&lt;p&gt;&lt;img src="image-2.png" alt="pulumi ai"&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s looking pretty good for a simple deployment. In DevOps, nothing works till the CI testing turns green. Since fortune favors the bold let&amp;rsquo;s proceed. For my developer workflow I ran &lt;code&gt;kind create cluster&lt;/code&gt; in the Codespaces terminal. You can do the same or add your own kubeconfig to deploy on your choice of cluster.&lt;/p&gt;
&lt;p&gt;Of course, proceed through the remaining prompts from the &lt;code&gt;pulumi new&lt;/code&gt; interactive CLI.&lt;/p&gt;
&lt;p&gt;&lt;img src="image-3.png" alt="pulumi configured a full python venv as its last stage of the pulumi new command function"&gt;&lt;/p&gt;
&lt;p&gt;I chose Python for this project, but you can choose any of the supported languages. We can see that &lt;code&gt;pulumi new&lt;/code&gt; creates a new Python virtual environment for us programmatically. In addition to the boilerplate supporting our new project, Pulumi AI wrote the first iteration of our Python Minecraft Deployment IaC! The next steps should be printed on the screen. Assuming your Kubernetes cluster kubeconfig is ready to roll we just have one step left.&lt;/p&gt;
&lt;p&gt;Hint, this is where we get the name for our annual &amp;ldquo;&lt;a href="https://youtu.be/J5BudoobwgY"&gt;Pulumi Up&lt;/a&gt; conference.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://youtu.be/J5BudoobwgY"&gt;Follow the link&lt;/a&gt; for the full playlist of 2023 Pulumi Up sessions&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up -y
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="devops-day-2"&gt;DevOps day 2&lt;/h3&gt;
&lt;p&gt;Finally, it is day two. This is the beginning of a choose-your-own-adventure wonderland and the opportunities go almost as far as your imagination. This is where we commit our code and plan our next change requests and enhancements.&lt;/p&gt;
&lt;p&gt;We can commit this code to git. Build a Github Actions Workflow to automate the CI testing of our IaC with every git pr or commit. Once you have a production-ready IaC, you can add another to deploy to production clusters. If you run &lt;code&gt;make act&lt;/code&gt; you will see how comfortable testing new GitHub actions workflows can be in the convenience of your new enhanced IDE workflow. You can see the dev container workflow running yourself right away by executing &lt;code&gt;make act&lt;/code&gt; as a starting point.&lt;/p&gt;
&lt;p&gt;To conclude, Pulumi is not a single tool. Pulumi is a complete cloud developer ecosystem. Tools, SDKs, and cloud services come together forming the most accelerated way to create your own cloud success legends.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;h3 id="did-it-deploy"&gt;Did it deploy?&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s check on the status of our deployment.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Check for your new Minecraft pod&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get po
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With any luck, our &lt;a href="https://pulumi.com/product/neo/"&gt;Pulumi Neo&lt;/a&gt; gave you a working program right out of the gate. For references on Kubernetes Pulumi package resources to expand your infrastructure from here head to the &lt;a href="https://www.pulumi.com/registry/packages/kubernetes/"&gt;Pulumi Registry Kubernetes Provider&lt;/a&gt; page for more.&lt;/p&gt;
&lt;p&gt;Sharing Pulumi with people is a genuine passion found among Pulumians all around the globe but we all know evidence reigns king among engineers who, like any good practitioner, expect proof. Evolving your developer workflow with Pulumi gets even better than just easy, it&amp;rsquo;s remarkably powerful and ready for you to adopt in your daily workflows right away too.&lt;/p&gt;
&lt;p&gt;Follow &lt;a href="https://youtube.com/@PulumiTV"&gt;PulumiTV&lt;/a&gt; for upcoming examples built on this solution and to see how Pulumi ESC brings safety to your secrets and more.&lt;/p&gt;
&lt;h3 id="whats-in-the-recipe"&gt;What&amp;rsquo;s in the recipe?&lt;/h3&gt;
&lt;p&gt;Because no hero&amp;rsquo;s journey is complete without a gruesome account of what came before, I have included many of the manual steps required to reach this state one command at a time for the &lt;del&gt;morbidly&lt;/del&gt; curious as well.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;click &amp;lsquo;details&amp;rsquo; to expand&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;details&gt;
&lt;h3 id="git-code-repository"&gt;Git Code Repository&lt;/h3&gt;
&lt;p&gt;Now create a git code repository to version control this project infrastructure code in Github.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Authenticate with Github before proceeding.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh auth login --web --git-protocol https --scopes &lt;span class="s2"&gt;&amp;#34;repo,gist,read:packages,admin:org,delete_repo,codespace&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create new Git Repository&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh repo create workshop --public &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --gitignore Python --license apache-2.0 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --description &lt;span class="s2"&gt;&amp;#34;pulumi iac developer workflow workshop&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Initialize the git repository&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone --recurse-submodules https://github.com/&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GITHUB_USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;/workshop .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Configure `git` cli to use the `gh` cli for authentication with Github&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh auth setup-git
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Configure the username and email associated with your Github account.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git config --global user.email &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GIT_COMMITTER_EMAIL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git config --global user.name &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GITHUB_USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# List files being tracked by git and their current status.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="direnv-automatic-environment-variables"&gt;Direnv: Automatic Environment Variables&lt;/h3&gt;
&lt;p&gt;Various non-secret environment variables may be worth maintaining in code locally as well. There are many ways to do this, but here we are going to use Direnv to automatically load environment variables from a .envrc file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Add environment variables useful during development to .envrc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat &lt;span class="s"&gt;&amp;lt;&amp;lt;EOF &amp;gt;&amp;gt; .envrc
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;export NO_COLOR=true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;export PULUMI_HOME=\${HOME}/.pulumi
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;export PULUMI_SKIP_UPDATE_CHECK=true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;export PULUMI_SKIP_CONFIRMATIONS=true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;export KUBECONFIG=\${PWD}/.kube/config
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;source venv/bin/activate 2&amp;gt;/dev/null || true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you can enable &lt;code&gt;direnv&lt;/code&gt; on this directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Enable direnv in this directory.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;direnv allow
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;p&gt;Env variables shown are for educational purposes only and should be used with care.
Read more about available Pulumi Environment variables here:
https://www.pulumi.com/docs/cli/environment-variables&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="pulumi-devcontainer"&gt;Pulumi Devcontainer&lt;/h3&gt;
&lt;p&gt;Now, to make sure we have all of our CLI dependencies, let&amp;rsquo;s grab the &lt;a href="https://github.com/pulumi/devcontainer"&gt;Pulumi Devcontainer&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Add the Pulumi Devcontainer git submodule&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git submodule add https://github.com/pulumi/devcontainer .devcontainer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git submodule update --init --recursive .devcontainer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Copy the devcontainer config of your choice into the top level of your project&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# so it will auto select by default when you open Codespaces in the future.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -f .devcontainer/devcontainer.json .devcontainer.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Rebuild the codespaces using the newly added Pulumi Devcontainer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh codespace rebuild --codespace &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CODESPACE_NAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="pulumi-cloud"&gt;Pulumi Cloud&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s login to Pulumi Cloud and initialize a new ESC environment to store our environment variables, secrets, and configuration which should be preserved and distributed securely from your Pulumi Cloud account.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Login to Pulumi Cloud&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi login
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create a new ESC Environment (optionally use another already existing environment)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi env init workshop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="kind-kubernetes-in-docker"&gt;KinD: Kubernetes-in-docker&lt;/h3&gt;
&lt;p&gt;We are going to use Kubernetes to demonstrate our Pulumi IaC. Let&amp;rsquo;s go ahead and create a new cluster now.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create the directory for your new kind kubeconfig&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir .kube
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create a Kind Cluster&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kind create cluster
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Let&amp;#39;s make sure our kubeconfig works and pods are starting up&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get pods -A
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Load Kubeconfig into Pulumi ESC as an encrypted secret for safe keeping.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# This is an example use case for storing kubeconfig which would not usually be practical&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# for disposable kind kubernetes clusters like this however the approach is practical in many&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# other scenarios which you may come across.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi env &lt;span class="nb"&gt;set&lt;/span&gt; workshop secrets.kubeconfig.kind --secret &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;jq . -R -s &amp;lt; &lt;span class="nv"&gt;$KUBECONFIG&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi env &lt;span class="nb"&gt;set&lt;/span&gt; workshop files.KUBECONFIG --plaintext &lt;span class="se"&gt;\$&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;secrets.kubeconfig.kind&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In our environment, we maintain our secrets including API personal access tokens, kubeconfigs, and such all with Pulumi&amp;rsquo;s Environments, Secrets, and Configuration cloud service.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Load the newly updated Pulumi ESC Environment in the local shell&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;pulumi env open workshop --format shell&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="now-lets-create-the-deployment-code"&gt;Now let&amp;rsquo;s create the deployment code!&lt;/h3&gt;
&lt;p&gt;If fortune favors the bold, let&amp;rsquo;s be bold on this next step and let AI write our sample code on the fly!&lt;/p&gt;
&lt;p&gt;As this is a &amp;ldquo;hello world&amp;rdquo; style demonstration intended to showcase the developer workflow more than any specific cloud technologies, let&amp;rsquo;s deploy something fun like a Minecraft server! Be sure to watch the video demonstration of this exercise on Pulumi&amp;rsquo;s &lt;a href="https://youtube.com/@PulumiTV"&gt;PulumiTV&lt;/a&gt; YouTube channel for an extra easter egg bonus step!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Write a new Pulumi Python IaC program to deploy Minecraft on Kubernetes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi new &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --ai &lt;span class="s2"&gt;&amp;#34;Write a program using pulumi kubernetes helm v3 Release to deploy the itzg/minecraft-server helm chart on Kubernetes, and include a pulumi output to show the helm release status.&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --description &lt;span class="s2"&gt;&amp;#34;A pulumi infrastructure as code (iac) program for deploying and serving minecraft on kubernetes&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --name &lt;span class="s2"&gt;&amp;#34;minecraft-on-kubernetes&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --language python &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --stack &lt;span class="s2"&gt;&amp;#34;workshop&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --force &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --dir .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&amp;rsquo;s see if our new Infrastructure as Code Pulumi Python Codebase will deploy!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Deploy your new Pulumi IaC on Kubernetes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi stack &lt;span class="k"&gt;select&lt;/span&gt; workshop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="cleanup"&gt;Cleanup&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi destroy -y --skip-preview
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi stack rm workshop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kind delete cluster --name kind
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh repo delete &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GITHUB_USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;/workshop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/details&gt;</description><author>Kat Morgan</author><category>pulumi</category><category>environments</category><category>secrets</category><category>configuration</category><category>infrastructure-as-code</category><category>developer</category><category>workflow</category><category>devcontainer</category><category>github</category><category>codespaces</category></item><item><title>LangChain for DevOps: Learn LLM &amp; GenAI for Dev, Sec &amp; Ops</title><link>https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/</link><pubDate>Thu, 26 Oct 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/generative-ai-apps-devops-talks-pulumi-user-group/index.png" /&gt;
&lt;p&gt;The emergence of DevOps revolutionized software development. Now, with AI powered tools like LangChain, these transformations are being accelerated. Unsurprisingly, our distinguished speaker at the launch of Pulumi&amp;rsquo;s in-person AI Talks, Patrick Debois, who coined the term &amp;ldquo;DevOps,&amp;rdquo; has recently tuned into LLM and GenAI Ops using the Langchain framework.&lt;/p&gt;
&lt;p&gt;This article unwraps the topics addressed during our &amp;ldquo;Generative AI, Apps, and DevOps | AI/ML Talks&amp;rdquo; event in Seattle, focusing on Langchain and GenAI for DevOps. You&amp;rsquo;ll be able to &lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#how-to-use-langchain-to-learn-llms-and-genai-for-devsecops"&gt;watch Patrick Debois teach LangChain to learn LLMs and GenAI&lt;/a&gt;, with code examples and lessons that are easily understood by traditional software engineering.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#what-is-langchain-used-for"&gt;What is LangChain used for?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#why-is-langchain-becoming-popular"&gt;Why is LangChain becoming popular?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#langchain-accelerating-devops"&gt;LangChain Accelerating DevOps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#how-to-use-langchain-to-learn-llms-and-genai-for-devsecops"&gt;How to Use LangChain to Learn LLMs and GenAI for Dev(Sec)Ops&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#real-world-applications-of-langchain-ai-in-devops"&gt;Real-World Applications of LangChain AI in DevOps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#monitoring-and-anomaly-detection-with-langchain-ai"&gt;Monitoring and Anomaly Detection with LangChain AI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#future-ai-apps-and-devops"&gt;Future: AI, Apps, and DevOps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/#frequently-asked-questions"&gt;Frequently Asked Questions&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="what-is-langchain-used-for"&gt;What is LangChain used for?&lt;/h2&gt;
&lt;p&gt;LangChain is an open-source Python framework designed to empower developers to construct robust generative AI applications. It facilitates the integration of advanced AI models such as OpenAI&amp;rsquo;s GPT, &lt;a href="https://gemini.google.com"&gt;Google&amp;rsquo;s Gemini&lt;/a&gt;, and &lt;a href="https://ai.meta.com/llama"&gt;Meta&amp;rsquo;s LLaMA&lt;/a&gt;. This versatile tool finds application in developing retrieval-augmented chatbots and other personalized assistants, utilizing technologies like ChatGPT. Furthermore, it enables tasks such as question-answering (GQA), summarization, code comprehension, API interactions, data cleansing, and much more.&lt;/p&gt;
&lt;h2 id="why-is-langchain-becoming-popular"&gt;Why is LangChain becoming popular?&lt;/h2&gt;
&lt;p&gt;The landscape of AI development is rapidly evolving, and LangChain is packed with incredible features for building LLM applications and tools. Developers with a wide range of expertise use LangChain for tasks such as managing interactions with language models, establishing seamless connections between diverse components, and integrating external resources like APIs and databases effortlessly.&lt;/p&gt;
&lt;p&gt;The LangChain platform hosts a diverse collection of APIs seamlessly integrated into applications. This enables developers to incorporate advanced language processing functionalities without the need for laborious construction from scratch.&lt;/p&gt;
&lt;h2 id="langchain-accelerating-devops"&gt;LangChain Accelerating DevOps&lt;/h2&gt;
&lt;figure&gt;&lt;img src="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/patrick-debois-langchain-ai-workshop.png"
alt="Patrick Debois at the Seattle Pulumi User Group, with a monitor showing OpenAI LangChain and code in Python" width="100%"&gt;&lt;figcaption&gt;
&lt;p&gt;Patrick Debois presenting the workshop Dev, Sec &amp;amp; Ops meet LangChain&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;LangChain can streamline the integration of large language models and data sources. By helping bring in AI capabilities, DevOps can revolutionize software development life cycles by making it easier for teams to handle challenges while optimizing resource allocation and usage through their cutting-edge, AI-powered solutions. This makes the &lt;a href="https://www.pulumi.com/docs/using-pulumi/automation-api/"&gt;automation of manual processes easier&lt;/a&gt; and the development of new resources far more accessible with faster utilization rates by leveraging artificial intelligence. Significantly important as &amp;ldquo;&lt;a href="https://www.pulumi.com/product/internal-developer-platforms/"&gt;Developer Velocity and Productivity&lt;/a&gt;&amp;rdquo; become business performance metrics across various industries.&lt;/p&gt;
&lt;p&gt;The features included in LangChain include chain interface memory functions for scalability within apps, control over dataflow, as storage – making code quality more reliable, plus seamless machine learning models integration, which allows them to build custom automated AI programs quickly. Thus providing users with an advanced but easy way of creating sophisticated solutions by combining their knowledge of coding and machine training models together.&lt;/p&gt;
&lt;h2 id="how-to-use-langchain-to-learn-llms-and-genai-for-devsecops"&gt;How to Use LangChain to Learn LLMs and GenAI for Dev(Sec)Ops&lt;/h2&gt;
&lt;p&gt;Patrick teaches in the way he would like to be taught. The workshop mainly uses the Langchain framework and basic Python knowledge. OpenAI will also need to be installed. You&amp;rsquo;ll learn essential skills in multiple use cases, applying Langchain for LLM application Development.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/iIl1bQnVwEs?rel=0?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;You can see the breakdown of the lessons per role below, and find the code examples in the &lt;a href="https://github.com/jedi4ever/learning-llms-and-genai-for-dev-sec-ops/tree/main"&gt;Learning LLMs and GenAI for DevSecOps repo&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="developer"&gt;Developer&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Calling a simple LLM using OpenAI&lt;/li&gt;
&lt;li&gt;Looking at debugging in Langchain&lt;/li&gt;
&lt;li&gt;Chatting with OpenAI as a model&lt;/li&gt;
&lt;li&gt;Using prompt templates&lt;/li&gt;
&lt;li&gt;Use Docloader to read your local files and prepare them for the LLM&lt;/li&gt;
&lt;li&gt;Explain the calculation and use of embeddings&lt;/li&gt;
&lt;li&gt;Understand how splitting and chunking are important&lt;/li&gt;
&lt;li&gt;Loading embeddings and documents in a vector database&lt;/li&gt;
&lt;li&gt;Use a chain for Questions and Answers to implement the RAG pattern (Retrieval Augmented Generation)&lt;/li&gt;
&lt;li&gt;Show the use of OpenAI documentation to have the llm generate calls to find real-time information&lt;/li&gt;
&lt;li&gt;Implement an Agent and provide it with tools to get more real-time information&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="operations"&gt;Operations&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Find out how many tokens you are using and the cost&lt;/li&gt;
&lt;li&gt;How to cache your calls to an LLM using exact matching or embeddings&lt;/li&gt;
&lt;li&gt;How to cache the calculation of embeddings and run the calculation locally&lt;/li&gt;
&lt;li&gt;Run your own local LLM (using Ollama)&lt;/li&gt;
&lt;li&gt;Track your calls and log them to a file (using a callback handler)&lt;/li&gt;
&lt;li&gt;Impose output structure (as JSON) and have the LLM retry if it&amp;rsquo;s not correct&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="security"&gt;Security&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Explain the OWASP top 10 for LLMS&lt;/li&gt;
&lt;li&gt;Show how simple prompt injection works and some mitigation strategies&lt;/li&gt;
&lt;li&gt;How to detect prompt injection using a 3rd party model from Hugging Face&lt;/li&gt;
&lt;li&gt;Detect project injection by using a prompt&lt;/li&gt;
&lt;li&gt;Check the answer LLMs provide and reflect if it is ok&lt;/li&gt;
&lt;li&gt;Use a Hugging Face model to detect if an LLM output was toxic&lt;/li&gt;
&lt;li&gt;Show a simple prompt for asking the LLM&amp;rsquo;s opinion on Kubernetes and Trivy vulnerabilities&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="real-world-applications-of-langchain-ai-in-devops"&gt;Real-World Applications of LangChain AI in DevOps&lt;/h2&gt;
&lt;figure&gt;&lt;img src="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/langchain-vector-similarity-search-in-a-rag-application.png"
alt="Vector similarity search in a RAG application" width="90%"&gt;&lt;figcaption&gt;
&lt;p&gt;Vector similarity search in a RAG application. Credit to LangChain and Neo4J team&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;LangChain AI has practical applications in DevOps, particularly related to question-answering using documents as context, extraction, evaluation, and natural language processing tasks, all powered by AI tools. An interesting scenario is implementing &lt;a href="https://blog.langchain.dev/using-a-knowledge-graph-to-implement-a-devops-rag-application/"&gt;a knowledge graph based RAG application with LangChain&lt;/a&gt; to support the DevOps team.&lt;/p&gt;
&lt;p&gt;ChatGPT based on LLMs enabled with these AI tools is one of the foremost implementations at present. Tracking capabilities through LangChain enables developers to determine which prompts are more effective, thus supporting what artificial intelligence offers when integrated into development operations.&lt;/p&gt;
&lt;h2 id="monitoring-and-anomaly-detection-with-langchain-ai"&gt;Monitoring and Anomaly Detection with LangChain AI&lt;/h2&gt;
&lt;figure&gt;&lt;img src="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/monitoring-llm-langchain-whylabs.png"
alt="Monitoring LLM performance with LangChain and LangKit" width="90%"&gt;&lt;figcaption&gt;
&lt;p&gt;Monitoring LLM performance with LangChain and LangKit. Credit to WhyLabs&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;LangChain AI provides an efficient approach to DevOps through continuous monitoring, and anomaly detection. LangChain&amp;rsquo;s integration in DevOps allows for intelligent monitoring of various system parameters, application performance metrics, and log files. It can process large volumes of data generated by applications and infrastructure components. Through natural language processing (NLP) techniques, LangChain can interpret logs, error messages, and system alerts in real-time.&lt;/p&gt;
&lt;p&gt;LangChain&amp;rsquo;s AI-driven anomaly detection capabilities are pivotal in identifying deviations from expected behavior in the monitored data. By analyzing historical data patterns, LangChain can learn the normal behavior of the system and its components. When the system encounters an unusual event or behavior, LangChain can promptly detect it as an anomaly. These anomalies could be security threats, performance bottlenecks, code quality, or any irregularities within the system.&lt;/p&gt;
&lt;p&gt;Keep in mind that monitoring LLM performance is important to ensure you can rely on the model&amp;rsquo;s accuracy and relevance in real-world applications. Our customer &lt;a href="https://www.pulumi.com/case-studies/whylabs/"&gt;WhyLabs&lt;/a&gt; has a great article showing the significance of &lt;a href="https://whylabs.ai/blog/posts/monitoring-llm-performance-with-langchain-and-langkit"&gt;monitoring LLMs performance with LangChain and how to get started&lt;/a&gt; with monitoring.&lt;/p&gt;
&lt;h2 id="future-ai-apps-and-devops"&gt;Future: AI, Apps, and DevOps&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.pulumi.com/what-is/what-is-platform-engineering/"&gt;Platform engineering&lt;/a&gt;, DevOps, or MLOps may be the next steps in the AI-driven software development future. AI tools are the gateway to giving developers access to big language models that allow them to create highly sophisticated solutions.&lt;/p&gt;
&lt;h3 id="accelerating-development-with-ai-powered-tools"&gt;Accelerating Development with AI-Powered Tools&lt;/h3&gt;
&lt;p&gt;AI-powered tools are revolutionizing the development process, enabling DevOps teams to access intelligent recommendations and improve code quality or obtain suggestions on new ways to accomplish goals. An example is the usage of &lt;a href="https://www.pulumi.com/product/neo/"&gt;Pulumi Neo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Tools like LangChain, Amazon CodeGuru, and Pulumi AI provide actionable insights for efficient resource utilization while enforcing policy and compliance best practices. An &lt;a href="https://www.pulumi.com/blog/pulumi-insights-ai-cli/"&gt;IaC that leverages AI empowers teams&lt;/a&gt; to automate and more effectively manage infrastructure.&lt;/p&gt;
&lt;p&gt;Developers can reap multiple benefits from higher quality assessment of code lines, instantaneous detection of policy and security issues, useful cues on how to resolve problems, and improving code quality, productivity, and time management.&lt;/p&gt;
&lt;p&gt;AI has greatly impacted optimization during the review stage, providing developers with better insights into performance issues, code effectiveness, and &lt;a href="https://www.pulumi.com/blog/property-search/"&gt;resource utilization&lt;/a&gt; without any extra effort.&lt;/p&gt;
&lt;h3 id="security-and-vulnerability-management-with-ai"&gt;Security and Vulnerability Management with AI&lt;/h3&gt;
&lt;p&gt;The marriage of AI, machine learning, and DevOps/DevSecOps practices revolutionizes security and vulnerability management in software engineering. AI-enabled tools technologies not only strengthen the defenses of software systems but also enable organizations to stay one step ahead in ensuring successful deployments by removing manual processes through automation, using single sources of truth, enforcing least-privileged access through role-based access controls, and &lt;a href="https://www.pulumi.com/blog/remediation-policies/"&gt;automated remediation to correct configuration violations&lt;/a&gt; like auto-tagging, removing Internet access, and enabling storage encryption.&lt;/p&gt;
&lt;p&gt;DevSecOps can foster collaboration between developers, security, and operations and still enhance security and compliance best practices using Artificial Intelligence (AI) and Machine Learning techniques.&lt;/p&gt;
&lt;h3 id="leveraging-machine-learning-in-devops"&gt;Leveraging Machine Learning in DevOps&lt;/h3&gt;
&lt;p&gt;&lt;img src="https://www.pulumi.com/blog/generative-ai-apps-devops-talks-pulumi-user-group/ml-dev-ops-cycle.png" alt="MLOps (Machine Learning Operations) meets DevOps Infinity Loop as part of the software development lifecycle" title="MLOps (Machine Learning Operations) meets DevOps Infinity Loop"&gt;&lt;/p&gt;
&lt;p&gt;Applying Machine Learning in DevOps is a game-changer. Not only does it automate and enhance various processes but also brings an intelligent, predictive, and adaptive dimension to development workflows. By embracing these technologies, development teams can achieve higher efficiency, improve code quality, optimize performance, and seamlessly integrate with artificial intelligence, thereby shaping the future of software engineering.&lt;/p&gt;
&lt;p&gt;ML models can evaluate past outcomes from compilation/builds plus performance metrics within an operation so that developers may leverage these insights when writing code accordingly with machine learning algorithms, allowing them to identify vulnerabilities or issues faster through root cause analysis while ameliorating system security against outside attacks like hackers or DDOS activity thus boosting overall system productivity thanks to AI implementation into existing processes.&lt;/p&gt;
&lt;h3 id="implementing-ai-models-into-devops-key-considerations"&gt;Implementing AI models into DevOps: Key Considerations&lt;/h3&gt;
&lt;p&gt;When considering AI, it&amp;rsquo;s essential to assess data quality, integration complexity, cost savings, and ethical/legal considerations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ensuring the data used for training these AI tools are precise, exhaustive, and up-to-date will help gain more reliable results.&lt;/li&gt;
&lt;li&gt;An important aspect of the implementation process is integrating existing DevOps instruments and guaranteeing scalability, depending on the company&amp;rsquo;s necessities.&lt;/li&gt;
&lt;li&gt;Ensuring that all laws applicable when working with such technology.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;AI and ML are rapidly becoming a necessity, which can greatly enhance and benefit Development, Security, and Operation teams. At first glance, it may appear daunting or out of reach, but tools like Langchain and Pulumi can make it easier to get started. Follow the Pulumi Python + AI/ML series to upskill and get ahead:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/mlops-the-ai-challenge-is-cloud-not-code/"&gt;The Real AI challenge is Cloud, not Code!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/mlops-huggingface-llm-aws-sagemaker-python/"&gt;Deploy AI Models on Amazon SageMaker using Pulumi Python IaC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/blog/deploy-ai-ml-vercel-app/"&gt;Deploying Your AI/ML Chatbot Frontend To Vercel Using Pulumi&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="frequently-asked-questions"&gt;Frequently Asked Questions&lt;/h2&gt;
&lt;h3 id="who-is-patrick-debois"&gt;Who is Patrick Debois?&lt;/h3&gt;
&lt;p&gt;Patrick Debois is a highly accomplished technologist whose expertise spans the domains of Development (Dev), Security (Sec), and Operations (Ops). Acknowledged as a respected confidant within the developer, security, and operations communities, Patrick is presently deeply engrossed in the realm of Artificial Intelligence and Machine Learning, continually pushing the boundaries of his technical acumen.&lt;/p&gt;
&lt;p&gt;He was the organizer of the inaugural DevOpsDays in 2009. He is credited with coining &amp;ldquo;DevOps&amp;rdquo; and co-authoring the renowned DevOps Handbook. In the past, Patrick has collaborated with esteemed technology organizations such as &lt;a href="https://www.pulumi.com/case-studies/atlassian/"&gt;Atlassian&lt;/a&gt; and Snyk. Currently, he wears dual hats as the Vice President of Engineering and a Distinguished Engineer at Showpad.&lt;/p&gt;
&lt;h3 id="is-langchain-free"&gt;Is LangChain Free?&lt;/h3&gt;
&lt;p&gt;Yes, LangChain is an open-source framework, free to use and modify.&lt;/p&gt;
&lt;h3 id="how-does-langchain-work"&gt;How Does LangChain Work?&lt;/h3&gt;
&lt;p&gt;LangChain is a meticulously designed open-source framework tailored to simplify the creation of applications powered by large language models (LLMs). First, you will need to have a language model or you can use a public language model or train your own.&lt;/p&gt;
&lt;p&gt;Once you have a language model ready, you can start building applications. The framework offers an array of tools and APIs, simplifying the process of connecting language models to diverse data sources, interacting with their environment, and constructing intricate applications.&lt;/p&gt;
&lt;p&gt;LangChain operates by linking together various components, referred to as links, to establish a workflow. Each link in the chain performs a task and is connected in a sequence, enabling the output of one link to serve as the input for the subsequent one. This sequential linking allows the chain to execute intricate tasks by combining simple tasks seamlessly.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://python.langchain.com/docs/get_started/introduction"&gt;LangChain&amp;rsquo;s get started&lt;/a&gt; docs for more information.&lt;/p&gt;
&lt;h3 id="does-chatgpt-use-langchain"&gt;Does ChatGPT use LangChain?&lt;/h3&gt;
&lt;p&gt;ChatGPT utilizes LangChain to create custom artificial intelligence (AI). This allows for an individualized experience.&lt;/p&gt;</description><author>Sara Huddleston</author><author>Kat Morgan</author><category>pulumi-events</category><category>community</category><category>ai</category><category>devops</category><category>langchain</category><category>ml</category></item><item><title>Deploy AI Models on Amazon SageMaker using Pulumi Python IaC</title><link>https://www.pulumi.com/blog/mlops-huggingface-llm-aws-sagemaker-python/</link><pubDate>Mon, 11 Sep 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/mlops-huggingface-llm-aws-sagemaker-python/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/mlops-huggingface-llm-aws-sagemaker-python/index.png" /&gt;
&lt;p&gt;Running models from Hugging Face on Amazon SageMaker is a popular deployment option for AI/ML services. While the SageMaker console allows for provisioning these cloud resources, this deployment pattern is labor intensive to document and vulnerable to human errors when reproducing as a regular operations practice. Infrastructure as Code (IaC) offers a reliable and easy to duplicate deployment practice. By developing this IaC with Pulumi, practitioners can choose to write their infrastructure code in Python and seamlessly develop both AI application code and IaC code in the same language.&lt;/p&gt;
&lt;p&gt;In this short tutorial we will deploy a publicly available &lt;a href="https://ai.meta.com/llama"&gt;Meta AI LlaMa 2&lt;/a&gt; based model from &lt;a href="https://huggingface.co"&gt;Hugging Face&lt;/a&gt;, on &lt;a href="https://aws.amazon.com/pm/SageMaker"&gt;Amazon SageMaker&lt;/a&gt;. Then we will test it with a &lt;a href="https://en.wikipedia.org/wiki/Prompt_engineering"&gt;natural language prompt&lt;/a&gt; using a short &lt;a href="https://www.python.org"&gt;Python&lt;/a&gt; script.&lt;/p&gt;
&lt;h2 id="pulumi-makes-aiml-easy"&gt;Pulumi makes AI/ML Easy?&lt;/h2&gt;
&lt;p&gt;We will use the &lt;code&gt;sagemaker-aws-python&lt;/code&gt; &lt;a href="https://www.pulumi.com/blog/how-to-create-and-share-a-pulumi-template"&gt;Pulumi Template&lt;/a&gt; to bootstrap our Python SageMaker IaC. Templates allow you to quickly bootstrap new Pulumi projects from a working scaffold which you can then customize further to your needs. Out of the box, this template provisions Amazon &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/iam/role"&gt;IAM Roles&lt;/a&gt; to assign SageMaker privileges, &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/cloudwatch/metricalarm"&gt;CloudWatch alarms&lt;/a&gt; to alert in case of latency or error spikes for the endpoint, and of course a &lt;a href="https://ai.meta.com/llama"&gt;Meta AI LlaMa 2&lt;/a&gt; based LLM (&lt;a href="https://huggingface.co/NousResearch/Llama-2-7b-chat-hf"&gt;NousResearch/Llama-2-7b-chat-hf&lt;/a&gt;) hosted on &lt;a href="https://huggingface.co"&gt;Hugging Face&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.python.org/downloads"&gt;Python3&lt;/a&gt; (3.9+)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/docs/install/"&gt;Pulumi CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://app.pulumi.com/signup"&gt;Pulumi Account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"&gt;AWS CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html"&gt;AWS Credentials&lt;/a&gt; (pre-configured)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="instructions"&gt;Instructions&lt;/h2&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/9rwsutZbVfI?rel=0?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;h3 id="1-login-to-pulumi-cloud-and-initialize-stack"&gt;1. Login to Pulumi Cloud and initialize stack&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s begin by logging into &lt;a href="https://www.pulumi.com/product/pulumi-cloud"&gt;Pulumi Cloud&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# There are many ways to store Pulumi state, here we use Pulumi Cloud&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Other state backends include S3, local file, and more&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi login
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;If you&amp;rsquo;re unsure of which &lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends"&gt;Pulumi state&lt;/a&gt; backend you&amp;rsquo;re using, you can check by running &lt;code&gt;pulumi whoami&lt;/code&gt; (or &lt;code&gt;pulumi whoami -v&lt;/code&gt; for more info).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="2-prepare-a-new-pulumi-project"&gt;2. Prepare a new Pulumi project&lt;/h3&gt;
&lt;p&gt;Here we create our new Pulumi project directory and populate it from the &lt;code&gt;sagemaker-aws-python&lt;/code&gt; &lt;a href="https://github.com/pulumi/templates"&gt;Pulumi template&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create a new directory &amp;amp; change directories into it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir newSageMaker &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; newSageMaker
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Start your project from the sagemaker-aws-python template&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Follow along with the prompts to create your new project and initialize a stack&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi new sagemaker-aws-python
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;While creating a new project from the &lt;code&gt;sagemaker-aws-python&lt;/code&gt; Pulumi template, you will be prompted for a &lt;a href="https://www.pulumi.com/docs/concepts/projects/"&gt;project&lt;/a&gt; name, description, &lt;a href="https://www.pulumi.com/docs/concepts/stack/"&gt;stack&lt;/a&gt; name, and Amazon Web Service &lt;a href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/"&gt;Region&lt;/a&gt;. You can proceed with defaults, or supply your own.&lt;/p&gt;
&lt;p&gt;After responding to all prompts, the &lt;code&gt;pulumi new&lt;/code&gt; command will proceed to setup a &lt;a href="https://www.pulumi.com/docs/languages-sdks/python/#virtual-environments"&gt;Python Virtual Environment&lt;/a&gt; (venv) and download all dependencies into the &lt;a href="https://www.pulumi.com/docs/languages-sdks/python/#virtual-environments"&gt;venv&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="pulumi-new-sagemaker-template-and-stack.png" alt="pulumi new template command"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="pulumi-new-project-ready-to-go.png" alt="Pulumi new project ready to go message"&gt;&lt;/p&gt;
&lt;h3 id="3-deploy-your-model-as-a-new-sagemaker-endpoint"&gt;3. Deploy your model as a new SageMaker endpoint&lt;/h3&gt;
&lt;p&gt;This step may take between 10 and 20 minutes while Amazon builds your infrastructure and deploys the configured model. You can follow along in the console as resources are provisioned, or open the link displayed in terminal to view the deployment status and other stack information in Pulumi Cloud.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src="pulumi-up-sagemaker-endpoint.png" alt="Screenshot of iTerm2 displaying the resulting stack output after deploying the base sagemaker-aws-python Pulumi template"&gt;&lt;/p&gt;
&lt;h3 id="4-try-your-new-sagemaker-endpoint"&gt;4. Try your new SageMaker endpoint&lt;/h3&gt;
&lt;p&gt;Once your stack has finished deploying, use this rudimentary Python snippet to test the deployed SageMaker endpoint.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;NOTE: Notice that we are using &lt;code&gt;us-east-1&lt;/code&gt; in this script. Be sure to change the region in Python to match the region you deployed the SageMaker endpoint into.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;First, save the following python snippet as &lt;code&gt;test.py&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;json&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nn"&gt;boto3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nn"&gt;argparse&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;endpoint_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SageMaker-runtime&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;region_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;us-east-1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;inputs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;In 3 words, name the biggest mountain on earth?&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;invoke_endpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EndpointName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;endpoint_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ContentType&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;application/json&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Response:&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Body&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ArgumentParser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;endpoint_name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse_args&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;endpoint_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you have the &lt;code&gt;test.py&lt;/code&gt; script created, source the Python virtual environment named &lt;code&gt;venv&lt;/code&gt; (created automatically by Pulumi) and run the script using the name of your new endpoint, taken directly from the Pulumi stack output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Source the venv&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# On Linux &amp;amp; MacOS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;source&lt;/span&gt; venv/bin/activate
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Execute test.py&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 test.py &lt;span class="k"&gt;$(&lt;/span&gt;pulumi stack output EndpointName&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src="sagemaker-test-py.png" alt="Screenshot of executing test.py in terminal to generate a response to the question &amp;ldquo;what is the biggest mountain on earth?&amp;rdquo;"&gt;&lt;/p&gt;
&lt;h3 id="5-cleanup-all-resources"&gt;5. Cleanup all resources&lt;/h3&gt;
&lt;p&gt;Finally, when you&amp;rsquo;re finished with testing your Hugging Face model on SageMaker, you can easily clean up un-used resources with one easy command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi destroy
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To recap, in a few commands, we created a new Pulumi Python project from a ready-to-roll template, deployed an LLM endpoint on Amazon SageMaker, and tested it with a short Python script to generate a response from our model!&lt;/p&gt;
&lt;p&gt;AI and ML is rapidly becoming a necessity with every new day. It may appear daunting or out of reach at first glance, but with the power of IaC written as Pulumi Python programs, getting started has never been easier.&lt;/p&gt;
&lt;p&gt;If you followed along then tell us how it worked out for you! We would love to know what you are looking forward to, or if you have ideas for future installments of the Pulumi Python #PulumiMLOps series!&lt;/p&gt;
&lt;p&gt;Join us on &lt;a href="https://twitter.com/pulumicorp"&gt;Twitter&lt;/a&gt;, and on the &lt;a href="https://slack.pulumi.com"&gt;Pulumi Community Slack&lt;/a&gt; to decide what #PulumiMLOps we take on next!&lt;/p&gt;</description><author>Kat Morgan</author><category>ai</category><category>ml</category><category>infrastructure-as-code</category><category>aws</category><category>llm</category><category>vllm</category><category>aiops</category><category>mlops</category><category>llama</category><category>llama2</category><category>devops</category><category>python</category><category>sagemaker</category><category>huggingface</category><category>platform-engineering</category></item><item><title>The Real AI Challenge is Cloud, not Code!</title><link>https://www.pulumi.com/blog/mlops-the-ai-challenge-is-cloud-not-code/</link><pubDate>Wed, 30 Aug 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/mlops-the-ai-challenge-is-cloud-not-code/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/mlops-the-ai-challenge-is-cloud-not-code/index.png" /&gt;
&lt;p&gt;The AI industry is stealing the show as tech&amp;rsquo;s goldrush of the &amp;rsquo;20s. Just looking at ChatGPT&amp;rsquo;s &lt;a href="https://www.reuters.com/technology/chatgpt-sets-record-fastest-growing-user-base-analyst-note-2023-02-01/"&gt;record setting user growth&lt;/a&gt;, and rapid 3rd party integration &lt;a href="https://www.forbes.com/sites/bernardmarr/2023/05/30/10-amazing-real-world-examples-of-how-companies-are-using-chatgpt-in-2023/?sh=ed1c90f14418"&gt;by top brands&lt;/a&gt;, it is not surprising the hype suggests this is the beginning of a major digital transformation.&lt;/p&gt;
&lt;p&gt;However, using AI/ML in your own products has some major challenges and obstacles. Below is a diagram of the end to end workflow of building and using an AI model: preparing the data, training a model, fine-tuning a model, hosting and running a model, building a backend service to serve the model, and building the user interface that interacts with the model. Most AI engineers are only involved in a few steps of the process. However, there is one challenge that is common across the entire workflow: creating and managing the cloud infrastructure is hard.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Figure 1. A sneak peak at the map of ML development and product path
&lt;img src="image.png" alt="A sneak peak at the map of ML development and product path"&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Training a model requires spinning up hyper scale GPU clusters. Preparing and consuming the training or fine-tuning data requires managing data warehouses and buckets of object storage. Building an AI backend service requires packaging the model, deploying and scaling the model across compute infrastructure, creating and managing the network infrastructure like load balancing, and managing the vector databases. Building great frontend user experiences requires provisioning and managing CDNs and web application services. Suffice to say: &lt;em&gt;The most difficult challenge that we face with AI today is a problem of cloud orchestration&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Most of this cloud orchestration today is done manually or with complex scripts. This is usually fraught with errors and simply doesn&amp;rsquo;t scale. Too much time is spent making cloud infrastructure work instead of focusing on actual AI/ML tasks. Infrastructure as code (IaC) is a key component to solving the cloud orchestration challenge present in AI/ML. By applying the rigor and precision of software development practices to cloud operations, IaC offers AI/ML professionals an efficient, reliable, and predictable way to develop at the highest velocity. Pulumi is an open source infrastructure as code platform that allows engineers to use any programming languages, including Python, to provision and manage AI infrastructure.&lt;/p&gt;
&lt;p&gt;This blog post is the first installment of a series on &lt;em&gt;AI Infrastructure as Python&lt;/em&gt;. We will start this journey with building an AI backend service for a chatbot. In this post, we will deploy a LLM model behind an API backend running on compute infrastructure in the cloud. This entire infrastructure pipeline will be deployed using IaC written in Python. The series will follow this AI backend service through its evolution into a robust and resilient cloud native service.&lt;/p&gt;
&lt;blockquote&gt;
&lt;h2 id="the-most-difficult-challenge-that-we-face-with-ai-today-is-a-problem-of-cloud-orchestration"&gt;&lt;em&gt;The most difficult challenge that we face with AI today is a problem of cloud orchestration&lt;/em&gt;&lt;/h2&gt;
&lt;/blockquote&gt;
&lt;p&gt;Before we get into the details of using Pulumi to deploy a private LlaMa 2 API chatbot service&amp;mdash;in 30 minutes or less, of course&amp;mdash;let&amp;rsquo;s start with some quick terminology/context:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Katwalk Server is a demo AI application written to host your choice of LLM either locally or in the cloud, and serve it as an OpenAI API compatible service. As a practical, hands-on introduction to IaC for the MLOps space, this project aims to demystify the concepts and showcase the benefits Pulumi can bring to your AI/ML projects.&lt;/li&gt;
&lt;li&gt;Large Language Models or LLMs (like ChatGPT) are machine learning models trained to generate human-like conversational text which have already become essential tools for businesses and individuals, transforming every day tasks and how we interact with technology.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai.meta.com/llama/"&gt;LlaMa&lt;/a&gt; is an LLM created by Meta, available for free for research and commercial use.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Figure 2. Or just let ChatGPT describe itself
&lt;img src="image-1.png" alt="Alt text"&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="deploy-a-private-llama-2-api-chatbot-service--in-30-minutes-or-less"&gt;Deploy a private LlaMa 2 API chatbot service &amp;hellip; in 30 minutes or less!&lt;/h2&gt;
&lt;p&gt;If you are ready to try the &lt;em&gt;#MLOpsChallenge&lt;/em&gt; along with us, then let&amp;rsquo;s double check a few requirements before starting the clock on our 30 minute chatbot challenge. While Pulumi supports many languages, we chose Python for this project, as Python is a familiar language in the AI industry.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/IWfPPlzzBzA?rel=0?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;h3 id="requirements"&gt;Requirements&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/docs/install/"&gt;Pulumi CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://app.pulumi.com/signup"&gt;Pulumi account and access token&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.python.org/downloads/"&gt;Python3 (3.11+)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"&gt;Git CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/docs/transformers.js/guides/private"&gt;Huggingface Token&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/meta-llama"&gt;Huggingface access to LLaMa2&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/"&gt;Meta LLaMa2 Access&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Choose one of the following deployment platforms. (You can actually choose more than one, if you&amp;rsquo;d like!)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/engine/install/"&gt;Docker&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nvidia.com/cuda-gpus"&gt;Nvidia CUDA Enabled GPU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html"&gt;Nvidia Container Toolkit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us"&gt;Azure&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli"&gt;Azure CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://runpod.io"&gt;Runpod.io&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.runpod.io/get-started/api-keys"&gt;Runpod api key&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now, for the real fun, let&amp;rsquo;s start the timer and deploy our own chatbot! Note that the instructions below are for Runpod; instructions for the other two deployment platforms are found in &lt;a href="https://github.com/pulumiverse/katwalk"&gt;the GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="1-prepare-your-pulumi-iac-directory"&gt;1. Prepare your Pulumi IaC directory&lt;/h3&gt;
&lt;p&gt;First we need to clone our IaC repository from GitHub and prepare our Python environment.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Clone the repository and cd to the pulumi iac directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/pulumiverse/katwalk &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; katwalk/pulumi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create and initialize the python virtual env&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 -m venv venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; venv/bin/activate
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Install python dependencies&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 -m pip install -r requirements.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2-login-to-pulumi-cloud-and-initialize-stack"&gt;2. Login to Pulumi Cloud and initialize stack&lt;/h3&gt;
&lt;p&gt;Next, let&amp;rsquo;s setup our state and secrets store in Pulumi Cloud.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# There are many ways to store Pulumi state, here we use Pulumi Cloud&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Other state backends include S3, local file, and more&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi login
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Initialize your stack&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Here we name the stack &amp;#34;dev&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi stack init --stack dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="3-configure-required-credentials"&gt;3. Configure required credentials&lt;/h3&gt;
&lt;p&gt;Configure your Huggingface credentials. If you open the &lt;code&gt;Pulumi.${stackName}.yaml&lt;/code&gt; file, you can see the encrypted secrets in this plain text YAML configuration.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set Huggingface.co username&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; hfUsername &amp;lt;huggingface_username&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Configure token as secret&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; --secret hfToken &amp;lt;huggingface_api_token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set the model that you want to download&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; hfModel &lt;span class="s2"&gt;&amp;#34;meta-llama/Llama-2-7b-chat-hf&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="4-deploy-in-the-cloud-on-runpodio"&gt;4. Deploy in the cloud on Runpod.io&lt;/h3&gt;
&lt;p&gt;While there are three providers already supported in this codebase, this post illustrates deploying to Runpod.io, a GPU and ML dedicated cloud catering to AI workloads and development tasks.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# This enables the IaC to deploy Katwalk Server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; deploy True
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set the deploy runtime to runpod to deploy on the Runpod cloud&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; runtime runpod
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Configure your Runpod API Token as a secure Pulumi secret&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# API token available at https://www.runpod.io/console/user/settings&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; --secret runpodToken &amp;lt;your_runpod_api_token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Finally, run `pulumi up` to deploy!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# When done, you can &amp;#39;destroy&amp;#39; the stack to deprovision your deployment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi destroy
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s currently &lt;a href="https://github.com/pulumiverse/katwalk/issues/9"&gt;a bug&lt;/a&gt; in the code that does not return the fully-qualified domain name (FQDN) from Runpod for your chatbot instance. To get the FQDN (referenced later in this post as &lt;code&gt;RUNPOD_FQDN&lt;/code&gt;), you&amp;rsquo;ll need to log into Runpod and &lt;a href="https://www.runpod.io/console/pods"&gt;retrieve that information&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="5-build-the-katwalk-container"&gt;5. Build the Katwalk container&lt;/h3&gt;
&lt;p&gt;While there are many other ways to orchestrate ML services in the cloud and locally, in this project we are taking ownership of the full application and infrastructure story. In fact, all three supported providers use the same container image to serve the LlaMa LLM API Service, and you can build it yourself just like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Set image build to True&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; imageBuild True
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Let&amp;#39;s build this without pushing to a registry for now&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; imagePush False
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Give your katwalk image a project name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi config &lt;span class="nb"&gt;set&lt;/span&gt; registryProject &lt;span class="k"&gt;$(&lt;/span&gt;whoami&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Now build the image!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="6-talk-to-your-chatbot"&gt;6. Talk to your chatbot!&lt;/h3&gt;
&lt;p&gt;Once your Katwalk LlaMa server is running, you can interact with the API by sending prompts as a JSON payload. In future posts we will orchestrate a chat frontend for our chatbot but for now we&amp;rsquo;ll use a &lt;code&gt;curl&lt;/code&gt; command. You can also substitute an API developer tool such as &lt;a href="https://www.postman.com/"&gt;Postman&lt;/a&gt; or &lt;a href="https://insomnia.rest/"&gt;Insomnia&lt;/a&gt;!&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# send a prompt with curl&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -s -X &lt;span class="s1"&gt;&amp;#39;POST&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://${RUNPOD_FQDN}/v1/chat&amp;#39;&lt;/span&gt; -H &lt;span class="s1"&gt;&amp;#39;accept: application/json&amp;#39;&lt;/span&gt; -H &lt;span class="s1"&gt;&amp;#39;Content-Type: application/json&amp;#39;&lt;/span&gt; -d &lt;span class="s1"&gt;&amp;#39;{&amp;#34;prompt&amp;#34;: &amp;#34;Write a short story about a robot.&amp;#34;}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;text&amp;#34;&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;\nOnce upon a time, there was a little robot named R2. R2 was a friendly and curious robot who lived in a big city. One day, R2 decided to go on an adventure. He set out to explore the city and learn about all the different things he could see and do.\nAs R2 explored the city, he met all kinds of people. Some were kind and welcoming, while others were scared or suspicious of him. Despite this, R2 continued to be friendly and curious, always asking questions and trying to learn more about the world around him.\nOne day, while R2 was exploring a busy market, he saw a group of people gathered around a little girl who was&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;Figure 3. A prompt and response from &lt;a href="https://huggingface/meta-llama/Llama-2-7b-chat-hf"&gt;meta-llama/Llama-2-7b-chat-hf&lt;/a&gt; hosted on Katwalk Server
&lt;img src="https://www.pulumi.com/blog/mlops-the-ai-challenge-is-cloud-not-code/chatbot-api-prompt.png" alt="chatbot-api-response"&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In a world where &amp;ldquo;data is the new black gold&amp;rdquo; and tokens are money, deploying a chatbot in 30 minutes is not just interesting, it is a novel capability quickly becoming a necessity.&lt;/p&gt;
&lt;p&gt;Platform engineering, DevOps, or MLOps may be the next hardest step in building the AI future. Pulumi offers a reliable path to higher velocity AI App development and MLOps. Together with Python-based IaC, it empowers the MLOps community to build equity in common AI platform code, and share IaC in a familiar language.&lt;/p&gt;
&lt;p&gt;If you followed along then tell us how it worked out for you! We would love to know what you are looking forward to, or if you have ideas for future installments of the Pulumi Python + MLOps series!&lt;/p&gt;
&lt;p&gt;Join us in the &lt;a href="https://slack.pulumi.com"&gt;Pulumi Community Slack&lt;/a&gt; or in the &lt;a href="https://github.com/pulumiverse/katwalk"&gt;Pulumiverse Community Katwalk Github repository&lt;/a&gt; to decide what #aiChallenge we tackle next!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Figure 4. Midjourney generated image of an imagined machine learning research engineer working among cables, computers, keyboards, and screens, in the glow of electronic lights. Image was generated from a prompt ~80% produced by ChatGPT based on this blog post content and a few superficial details about the author
&lt;img src="image-2.png" alt="Midjourney generated image of an diffusion generated machine learning research engineer working among cables, computers, keyboards, and screens, in the glow of electronic lights. Image was generated from a prompt produced by LlaMa 2 Katwalk server based on this blog post content and a few superficial details about the author."&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><author>Kat Morgan</author><category>ai</category><category>ml</category><category>infrastructure-as-code</category><category>llm</category><category>vllm</category><category>mlops</category><category>azure</category><category>llama</category><category>llama2</category><category>python</category></item></channel></rss>