<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Narender Kumar Sharma</title>
    <description>The latest articles on DEV Community by Narender Kumar Sharma (@narender-kumar-sharma).</description>
    <link>https://dev.to/narender-kumar-sharma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F991407%2F15ed7ee2-eb79-4a6a-8649-b23887544ca2.jpeg</url>
      <title>DEV Community: Narender Kumar Sharma</title>
      <link>https://dev.to/narender-kumar-sharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/narender-kumar-sharma"/>
    <language>en</language>
    <item>
      <title>GitHub Actions runners on Oracle Cloud with Cirun.</title>
      <dc:creator>Narender Kumar Sharma</dc:creator>
      <pubDate>Thu, 29 Dec 2022 15:17:49 +0000</pubDate>
      <link>https://dev.to/narender-kumar-sharma/github-actions-runners-on-oracle-cloud-with-cirun-3db5</link>
      <guid>https://dev.to/narender-kumar-sharma/github-actions-runners-on-oracle-cloud-with-cirun-3db5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4js59col2lauidbe62i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4js59col2lauidbe62i.png" alt="Cirun" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding The Problem
&lt;/h2&gt;

&lt;p&gt;As we all know GitHub Actions is a CI/CD platform used to automate the builds, test, and deployment process. GitHub Actions uses workflows to automate the whole process. We can run the builds and tests on every push and pull request, or even on merging the pull request with workflows. For all this GitHub Actions use its cloud machines but also they have some limitations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GitHub Actions does not provide support for custom images, or customized configurations of hardware. Sometimes users need a custom image to complete their build and run tests on it according to their use case. Also, GitHub Actions provides a fixed configuration of the systems.&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkujjc2yff7ptdxs5hdkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkujjc2yff7ptdxs5hdkq.png" alt="GitHub Actions Hardware" width="788" height="438"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It does not provide users with GPU instances. When working on stuff like MLops that may requires GPU to build. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub Actions provide you with limited execution time for each run in a workflow that is 6 hours. If a job takes more than this time to execute it will automatically terminate. GitHub provides you with 2000 minutes/month and 500 MB of free storage. To use beyond these limits we have to pay some amount. You can see the pricing &lt;a href="https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What if we can automate this whole process on our cloud and run workflows on desired machine?
&lt;/h3&gt;

&lt;p&gt;Definitely, we can do this on our cloud using GitHub actions feature self-hosted runners and Cirun. Also, we have to pay what we are using.&lt;/p&gt;

&lt;h2&gt;
  
  
  About Cirun
&lt;/h2&gt;

&lt;p&gt;Cirun provides self-hosted GitHub Actions Runners on your clouds. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzdob8i4e92uo1ptvh4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzdob8i4e92uo1ptvh4c.png" alt="Flowchart" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  From Flowchart
&lt;/h3&gt;

&lt;p&gt;We can see whenever an event is triggered on the repository. GitHub sends a webhook to cirun. Cirun authenticates the cloud using credentials provided by you. It takes Machine configurations defined in &lt;code&gt;.cirun.yml&lt;/code&gt; from your GitHub repository and sends a request to the cloud for creating instance. The cloud will create a instance using &lt;code&gt;.cirun.yml&lt;/code&gt; file, and then all workflow files defined on the GitHub repo will run on the instance. Besides all of this, Cirun continuously checks whether the workflow is completed and the machine is idle or not? If condition is satisfied then cirun delete's the VM, and we have to pay what we used.&lt;/p&gt;

&lt;p&gt;This blog explains GitHub Actions runners on Oracle Cloud with Cirun.. For reference, you can check cirun &lt;a href="https://docs.cirun.io/reference/examples#oracle-cloud" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The steps are almost the same for other cloud providers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In Cirun, log in with GitHub&lt;/li&gt;
&lt;li&gt;Install Cirun on your Repository&lt;/li&gt;
&lt;li&gt;Toggle on the Repository to activate.&lt;/li&gt;
&lt;li&gt;Pass your cloud credentials and connect Oracle with Cirun&lt;/li&gt;
&lt;li&gt;Add workflow file and &lt;code&gt;.cirun.yml&lt;/code&gt; file on your repository&lt;/li&gt;
&lt;li&gt;Now push a trigger in your Repository&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's done! 🚀&lt;/p&gt;
&lt;h4&gt;
  
  
  Demo
&lt;/h4&gt;
&lt;h4&gt;
  
  
  In Cirun login with GitHub
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ulwhwo6a3bkri0q95ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ulwhwo6a3bkri0q95ug.png" alt="Login with GitHub" width="668" height="324"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Install Cirun on your Repository
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudl92fc7hq7rb4l9ihyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudl92fc7hq7rb4l9ihyl.png" alt="Install github to repo" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure Cirun
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3drqeohdc7mgphugowo.png" alt="Install" width="533" height="288"&gt;
&lt;/li&gt;
&lt;li&gt;Give access to repositories
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbat5j5hnco50k78y10qo.png" alt="Access to repo" width="576" height="421"&gt;
&lt;/li&gt;
&lt;li&gt;To activate the repository toggle the button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcocnn9133po249roa5xj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcocnn9133po249roa5xj.png" alt="Toggle on the repo" width="576" height="421"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding Oracle cloud to Cirun
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE:&lt;/em&gt;&lt;/strong&gt;  Make sure you have permissions to create VMs/runners.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to profile.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hbpalxfl388hw5ha8dc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hbpalxfl388hw5ha8dc.png" alt="Oracle user profile" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on API keys&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb73hfaodujb4y3rrfoq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb73hfaodujb4y3rrfoq8.png" alt="API keys" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After clicking on Add api key, download private key and hit add button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfn0mhl58tszp2ttraxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfn0mhl58tszp2ttraxu.png" alt="Add API key" width="800" height="655"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After adding, you will have this kind of configuration file. Copy &lt;code&gt;user&lt;/code&gt;, &lt;code&gt;fingerprint&lt;/code&gt;, &lt;code&gt;tenancy&lt;/code&gt; and paste them in text file.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiouog2k84cjjaaj4o8l6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiouog2k84cjjaaj4o8l6.png" alt="Configuration file" width="800" height="656"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then navigate to compartments and copy ocid, then paste this inside text file as &lt;code&gt;compartment_id=&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2ad3rnfotat0orm3t8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2ad3rnfotat0orm3t8h.png" alt="Ocid" width="680" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste your text saved in text file and downloaded private key in Cirun dashboard under cloud section.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83bz1c1yaninr9wsmke5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83bz1c1yaninr9wsmke5.png" alt="Paste your keys" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Add Workflow file on your Repository
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;oracle.yml&lt;/code&gt; file inside &lt;code&gt;.github/workflows&lt;/code&gt;. In workflow you can put jobs you want. For example paste the yml file given below to print the hostname, system info, memory, architecture, OS version. For latest file you can visit &lt;a href="https://github.com/vishal9629/cirun-oracle" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GitHub Actions on Oracle Cloud&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;push&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;self-hosted&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;oracle-cloud&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get Hostname&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;hostname&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get system Information&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;uname -a&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get Architecture&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;dpkg --print-architecture&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get system Disk space&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;df -h&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get OS version&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;cat /etc/*release&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run "lscpu"&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lscpu&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;hello world&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo hello world&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Todays Date&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;date&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Now add a &lt;code&gt;.cirun.yml&lt;/code&gt; file in your Repository
&lt;/h4&gt;

&lt;p&gt;In this yml, we define the configuration and flags we want on your clouds (AWS, GCP, Oracle, etc.), instance_type, and machine_image. To explore more you can visit cirun &lt;a href="https://docs.cirun.io/reference/examples#oracle-cloud" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this blog, we are creating &lt;code&gt;.cirun.yml&lt;/code&gt; file for the AWS cloud with the infinitely scalable runner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;runners&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;runners&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;oracle-runner&lt;/span&gt;
    &lt;span class="na"&gt;cloud&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;oracle&lt;/span&gt;
    &lt;span class="na"&gt;instance_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;VM.Standard.E2.1.Micro&lt;/span&gt;
    &lt;span class="na"&gt;machine_image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ocid1.image.oc1.uk-london-1.aaaaaaaavy5v3inu2ho2h57vwvvsclukdh4jvhg45um2nrejyxa7s46zcwoq&lt;/span&gt;
    &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;uk-london-1&lt;/span&gt;
    &lt;span class="na"&gt;workflow&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.github/workflows/oracle.yml&lt;/span&gt;
    &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;oracle-cloud&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing a trigger
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To trigger an event we must commit something in our repo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiid51fcltn5z2hrqw86n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiid51fcltn5z2hrqw86n.png" alt="New trigger" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With a new commit, cirun sends a request to the cloud then the cloud makes a instance and runs the workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5blfmq43mzfd4h33j8n9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5blfmq43mzfd4h33j8n9.png" alt="Running workflow" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Printed the hostname, system info, memory, architecture, OS version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxb4914j06cl0uis6nvl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxb4914j06cl0uis6nvl.png" alt="Printed jobs" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;GitHub Actions provide us with self-hosted runners for your repository but setting up them is a tedious task. You can automate the set-up process using cirun. Cirun charges some amount for private repositories and you have to pay for what you use on your cloud. Cirun supports all major cloud providers at this time. (AWS, GCP, Digital Ocean, Azure, Openstack, Oracle).&lt;br&gt;
For more information you can visit &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;cirun.io&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cirun.io/" rel="noopener noreferrer"&gt;Cirun documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/vishal9629/cirun-oracle" rel="noopener noreferrer"&gt;Repository used for demo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any questions and feedback about this blog, feel free to comment or reach out &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cirun</category>
      <category>github</category>
      <category>oracle</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Infinitely scalable GitHub Actions runners on AWS with Cirun</title>
      <dc:creator>Narender Kumar Sharma</dc:creator>
      <pubDate>Thu, 29 Dec 2022 15:17:30 +0000</pubDate>
      <link>https://dev.to/narender-kumar-sharma/infinitely-scalable-github-actions-runners-on-aws-with-cirun-5beh</link>
      <guid>https://dev.to/narender-kumar-sharma/infinitely-scalable-github-actions-runners-on-aws-with-cirun-5beh</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4js59col2lauidbe62i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4js59col2lauidbe62i.png" alt="Cirun" width="800" height="478"&gt;&lt;/a&gt;&lt;br&gt;
Using the features of cloud providers like AWS and GCP, we can create Infinitely scalable GitHub Actions runners on Cloud but why do we need them?&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding The Problem
&lt;/h2&gt;

&lt;p&gt;In the tech world, everyone wants CI/CD. As we all know GitHub Actions is a CI/CD platform used to automate the builds, test, and deployment process. GitHub Actions uses workflows to automate the whole process. We can run the builds and tests on every push and pull request, or even on merging the pull request with workflows. For all this GitHub Actions use its cloud machines but also they have some limitations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GitHub Actions does not provide support for custom images, or customized configurations of hardware. Sometimes users need a custom image to complete their build and run tests on it according to their use case. Also, GitHub Actions provides a fixed configuration of the systems.&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkujjc2yff7ptdxs5hdkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkujjc2yff7ptdxs5hdkq.png" alt="GitHub Actions Hardware" width="788" height="438"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It does not provide users with GPU instances. When working on stuff like MLops that may requires GPU to build. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub Actions provide you with limited execution time for each run in a workflow that is 6 hours. If a job takes more than this time to execute it will automatically terminate. GitHub provides you with 2000 minutes/month and 500 MB of free storage. To use beyond these limits we have to pay some amount. You can see the pricing &lt;a href="https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  What if we can automate this whole process on our cloud and have minimum cost?
&lt;/h3&gt;

&lt;p&gt;Definitely, we can do this on our cloud using GitHub actions feature self-hosted runners and Cirun. Also, we can reduce the cost by doing &lt;strong&gt;Infinitely scalable GitHub Actions runners on the cloud with Cirun&lt;/strong&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  About Cirun and Infinitely scalable runners
&lt;/h2&gt;

&lt;p&gt;Cirun provides self-hosted GitHub Actions Runners on your clouds. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkhuckytdhil450hfrpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkhuckytdhil450hfrpg.png" alt="Flowchart" width="800" height="402"&gt;&lt;/a&gt;&lt;br&gt;
Before understanding the flowchart let's understand:&lt;/p&gt;
&lt;h3&gt;
  
  
  How does Infinitely scalable Runners works?
&lt;/h3&gt;

&lt;p&gt;Sometimes we may don't have limit of time and we want the minimum cost of our process. Clouds like AWS and GCP allow us to do so with an option. In the case of AWS, it is &lt;strong&gt;SPOT&lt;/strong&gt;. A spot instance allows us to make a machine whenever capacity is available with no time constraints. To automate this whole process, Cirun provide us with a flag named &lt;code&gt;preemptible&lt;/code&gt;. When we pass value &lt;strong&gt;true&lt;/strong&gt;, It creates the cheapest self-hosted VM.  &lt;/p&gt;
&lt;h3&gt;
  
  
  From Flowchart
&lt;/h3&gt;

&lt;p&gt;We can see whenever an event is triggered on the repository. GitHub sends a webhook to cirun. Cirun authenticates the cloud using credentials provided by you. It takes Machine configurations and &lt;code&gt;preemptible&lt;/code&gt; flag defined in &lt;code&gt;.cirun.yml&lt;/code&gt; from your GitHub repository and sends a request to the cloud for &lt;strong&gt;Spot instance&lt;/strong&gt;. Cloud keeps checking for available capacity. Whenever it meets its conditions, the cloud will create a spot instance using &lt;code&gt;.cirun.yml&lt;/code&gt; file, and then all workflow files defined on the GitHub repo will run on the instance. Besides all of this, Cirun continuously checks whether the workflow is completed and the machine is idle or not? If condition is satisfied then cirun delete's the VM. By doing this we have minimum cost for our desired machine.&lt;/p&gt;

&lt;p&gt;This blog explains how to set up Infinitely scalable GitHub Actions runners on AWS with Cirun. For reference, you can check cirun &lt;a href="https://docs.cirun.io/reference/examples#amazon-web-services" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The steps are almost the same for other cloud providers which provide the scalable option.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In Cirun, log in with GitHub&lt;/li&gt;
&lt;li&gt;Install Cirun on your Repository&lt;/li&gt;
&lt;li&gt;Toggle on the Repository to activate.&lt;/li&gt;
&lt;li&gt;Pass your cloud credentials and connect AWS with Cirun&lt;/li&gt;
&lt;li&gt;Add workflow file and &lt;code&gt;.cirun.yml&lt;/code&gt; file on your repository&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;.cirun.yml&lt;/code&gt; along with machine config also specify the flag &lt;code&gt;preemptible: true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Now push a trigger in your Repository&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's done! 🚀&lt;/p&gt;
&lt;h4&gt;
  
  
  Demo
&lt;/h4&gt;
&lt;h4&gt;
  
  
  In Cirun login with GitHub
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ulwhwo6a3bkri0q95ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ulwhwo6a3bkri0q95ug.png" alt="Login with GitHub" width="668" height="324"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Install Cirun on your Repository
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudl92fc7hq7rb4l9ihyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudl92fc7hq7rb4l9ihyl.png" alt="Install github to repo" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure Cirun
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3drqeohdc7mgphugowo.png" alt="Install" width="533" height="288"&gt;
&lt;/li&gt;
&lt;li&gt;Give access to repositories
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrwv5dtkcq38mp28zvzc.png" alt="Access to repo" width="553" height="415"&gt;
&lt;/li&gt;
&lt;li&gt;To activate the repository toggle the button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c27p9mp26l3dorxyskc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c27p9mp26l3dorxyskc.png" alt="Toggle on the repo" width="770" height="464"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Adding AWS to Cirun
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to IAM user.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxlv3jx12e7cp4bitl3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxlv3jx12e7cp4bitl3t.png" alt="AWS IAM" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5barawn6p3hao5hvbwd8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5barawn6p3hao5hvbwd8.png" alt="AWS user console" width="439" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add users&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo895wtt4xdy9atie7wwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo895wtt4xdy9atie7wwc.png" alt="Adding user" width="792" height="576"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add user with credential type programmatic access&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrn9p7a4qh7chsk8al2r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrn9p7a4qh7chsk8al2r.png" alt="Access key type" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add user with permission &lt;strong&gt;AmazonEC2FullAccess&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6xpyskoyi6jn3qh0w93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6xpyskoyi6jn3qh0w93.png" alt="AWS permission" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate Access key ID and Access Secret key&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdxw1sblktci8kd2gu9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdxw1sblktci8kd2gu9r.png" alt="Paste keys in cirun dashboard" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste your Access key Id and Access Secret key in Cirun dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd554282e5nguzsu24wui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd554282e5nguzsu24wui.png" alt="Paste your keys" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Add Workflow file on your Repository
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;aws.yml&lt;/code&gt; file inside &lt;code&gt;.github/workflows&lt;/code&gt;. In workflow you can put jobs you want. For example paste the yml file given below to print the system info, memory, architecture. For latest file you can visit &lt;a href="https://github.com/vishal9629/Infinitely-scalable-runners-on-aws" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;self-hosted&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;cirun-aws-runner&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;System Info&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;uname -a&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Print Memory&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;free -m&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Print Architecture&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;dpkg --print-architecture&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Now add a &lt;code&gt;.cirun.yml&lt;/code&gt; file in your Repository
&lt;/h4&gt;

&lt;p&gt;In this yml, we define the configuration and flags we want on your clouds (AWS, GCP, Oracle, etc.), instance_type, and machine_image. For Infinitely scalable GitHub Actions runners we must have pass flag &lt;code&gt;preemptible: true&lt;/code&gt;.&lt;br&gt;
To explore more you can visit cirun &lt;a href="https://docs.cirun.io/reference/examples#amazon-web-services" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this blog, we are creating &lt;code&gt;.cirun.yml&lt;/code&gt; file for the AWS cloud with the infinitely scalable runner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;runners&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;aws-runner"&lt;/span&gt;
    &lt;span class="na"&gt;cloud&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;aws"&lt;/span&gt;
    &lt;span class="na"&gt;instance_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;t2.micro"&lt;/span&gt;
    &lt;span class="na"&gt;machine_image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ami-05e786af422f8082a"&lt;/span&gt;
    &lt;span class="na"&gt;preemptible&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
    &lt;span class="na"&gt;workflow&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.github/workflows/aws.yml&lt;/span&gt;
    &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cirun-aws-runner"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing a trigger
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To trigger an event we must commit something in our repo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjb9rd0fycxocvkdc4ck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjb9rd0fycxocvkdc4ck.png" alt="New trigger" width="467" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With a new commit, cirun sends a request to the cloud then the cloud makes a spot instance and runs the workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhy5uktnd1ir40uro48j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhy5uktnd1ir40uro48j.png" alt="Running workflow" width="774" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Printed the system info, memory info, system architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjgxtsn4ottwdyz4wmrv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjgxtsn4ottwdyz4wmrv.png" alt="Printed jobs" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;GitHub Actions provide us with self-hosted runners for your repository but setting up them is a tedious task. You can automate the set-up process using cirun. Cirun charges some amount for private repositories and you have to pay for what you use on your cloud. Cirun supports all major cloud providers at this time. (AWS, GCP, Digital Ocean, Azure, Openstack, Oracle).&lt;br&gt;
For more information you can visit &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;cirun.io&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cirun.io/" rel="noopener noreferrer"&gt;Cirun documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/vishal9629/Infinitely-scalable-runners-on-aws" rel="noopener noreferrer"&gt;Repository used for demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html" rel="noopener noreferrer"&gt;Spot instance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any questions and feedback about this blog, feel free to comment or reach out &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cirun</category>
      <category>github</category>
      <category>aws</category>
      <category>cicd</category>
    </item>
    <item>
      <title>MLOps on GitHub Actions with Cirun</title>
      <dc:creator>Narender Kumar Sharma</dc:creator>
      <pubDate>Thu, 29 Dec 2022 15:17:09 +0000</pubDate>
      <link>https://dev.to/narender-kumar-sharma/mlops-on-github-actions-with-cirun-1c06</link>
      <guid>https://dev.to/narender-kumar-sharma/mlops-on-github-actions-with-cirun-1c06</guid>
      <description>&lt;p&gt;MLOps is very useful in ML world and when run on GPUs they are way faster. To have an idea how fast MLOps on GPUs, here we are doing comparison of MLOps on CPU and GPU using &lt;a href="https://docs.github.com/en/actions" rel="noopener noreferrer"&gt;GitHub Actions&lt;/a&gt; and &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  About MLOps and it's uses
&lt;/h2&gt;

&lt;p&gt;MLOps is set of practices that establishes a smooth connection from the creation of the ML models to the production. MLOps continues by concentrating on the upkeep and overall monitoring of Machine Learning Engineering. MLOps reduce friction with DevOps and IT, allows better cooperation with data teams, makes ML pipelines reproducible, and speeds up the process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why MLOps are better on GPUs?
&lt;/h3&gt;

&lt;p&gt;As ML models uses too many mathematical algorithms and demands to train the different data on same code and GPUs are designed to do so. So, whenever we do ML operations on GPUs, it will be done effectively and also minimize the computing time complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Cirun might help to do this?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.cirun.io/reference/yaml#runners-runners" rel="noopener noreferrer"&gt;Cirun&lt;/a&gt; enables us to create GPU enabled virtual machines on our cloud. It minimize the gap between GitHub Actions and automation of self-hosted runners. By using this feature we can automate MLOps on desired GPUs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup of MLOps on CPU and GPU using GitHub Actions and Cirun for comparison
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In first step created a workflow for MLOps to be run on a GitHub Actions machine having CPU and on a Self-hosted runner having GPU.&lt;/li&gt;
&lt;li&gt;Then for MLOps we have to make ML friendly environment. For this we used &lt;a href="https://github.com/iterative/cml#getting-started" rel="noopener noreferrer"&gt;CML&lt;/a&gt;, which is an open-source CLI tool for implementing CI/CD with a focus on MLOps. CML uses custom Docker images that come pre-installed libraries that are essential for MLOps like NodeJS, Python, DVC (Data Version Control).&lt;/li&gt;
&lt;li&gt;To setup CML environment on CPU use docker container mentioned below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docker://dvcorg/cml-py3:latest"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To setup CML environment on GPU use docker container mentioned below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ghcr.io/iterative/cml:0-dvc2-base1-gpu"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Followed by container argument.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--gpus&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;all"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This is very important to pass the GITHUB_TOKEN to have a working workflow. So, that authentication is done on behalf of GitHub Actions. You can have look to &lt;a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token" rel="noopener noreferrer"&gt;GITHUB TOKEN&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MLops"&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;repo_token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secrets.GITHUB_TOKEN&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Machines used for comparison:-
&lt;/h3&gt;

&lt;h4&gt;
  
  
  For MLOps on CPU, we used GitHub-hosted runners which only provides CPUs to work with.
&lt;/h4&gt;

&lt;p&gt;Hardware configuration of &lt;a href="(https://docs.github.com/en/actions/using-github-hosted-runnersabout-github-hosted-runners#supported-runners-and-hardware-resources)"&gt;GitHub Actions machine&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2-core CPU (x86_64)&lt;/li&gt;
&lt;li&gt;7 GB of RAM&lt;/li&gt;
&lt;li&gt;14 GB of SSD space&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  For MLOps on GPU, we used Self-hosted runners with NVIDIA T4 GPU.
&lt;/h4&gt;

&lt;p&gt;In example we used AWS instance g4dn.xlarge to demonstrate MLOps on GPU.&lt;/p&gt;

&lt;p&gt;To configure GPUs using self-hosted runner see &lt;a href="https://docs.cirun.io/reference/yaml#gpu-gpu" rel="noopener noreferrer"&gt;Cirun Configuration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hardware configuration of instance &lt;strong&gt;g4dn.xlarge&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NVIDIA T4 GPU&lt;/li&gt;
&lt;li&gt;4-core CPU (x86_64)&lt;/li&gt;
&lt;li&gt;16 GB of RAM&lt;/li&gt;
&lt;li&gt;125 GB of SSD space&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Workflow used for comparison
&lt;/h2&gt;

&lt;p&gt;This workflow created jobs for two runners, one is for self-hosted using GPU and another one is for GitHub action runner using CPU. To review the latest version of this workflow in this &lt;a href="https://github.com/vishal9629/MLops_with_Cirun/tree/new-example-2/.github/workflows" rel="noopener noreferrer"&gt;repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also you can directly copy workflow for single runner. &lt;a href="https://github.com/vishal9629/MLops_with_Cirun/blob/new-example-2/.github/workflows/MLOps-gpu.yml" rel="noopener noreferrer"&gt;MLOps using GPUs&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GitHub&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Actions&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;your&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;own&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;GPUs"&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;none"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# When a push occurs on a branch workflow will trigger on your desired branch.&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;CPU_GPU_matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# Creating matrix for jobs.&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Creating a 2d matrix to execute our jobs with respective docker containers.&lt;/span&gt;
        &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ubuntu-latest"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cirun.gpu"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; 
        &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docker://dvcorg/cml-py3:latest"&lt;/span&gt; &lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ghcr.io/iterative/cml:0-dvc2-base1-gpu"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="na"&gt;container_arg&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt; &lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--gpus&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;all"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="c1"&gt;# Excluding the unwanted docker container and container_arg in our respective OS.&lt;/span&gt;
        &lt;span class="na"&gt;exclude&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ubuntu-latest"&lt;/span&gt;
            &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ghcr.io/iterative/cml:0-dvc2-base1-gpu"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ubuntu-latest"&lt;/span&gt;
            &lt;span class="na"&gt;container_arg&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--gpus&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;all"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cirun.gpu"&lt;/span&gt;
            &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;docker://dvcorg/cml-py3:latest"&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cirun.gpu"&lt;/span&gt;
            &lt;span class="na"&gt;container_arg&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
    &lt;span class="c1"&gt;# Workflow to run commands in OS.&lt;/span&gt;
    &lt;span class="c1"&gt;# Dynamic passing of os, containers, container_agr using matrix &lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;matrix.os&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt; 
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;matrix.containers&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;matrix.container_arg&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
    &lt;span class="c1"&gt;# Steps that we want to have with OS.&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;actions/checkout@v3"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Dependency&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Install"&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pip&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;install&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-r&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;requirements.txt"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MLops"&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;repo_token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secrets.GITHUB_TOKEN&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;# Your ML workflow goes here, you can pass your variable name&lt;/span&gt;
          &lt;span class="s"&gt;"python train.py"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Comparison of time complexities:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/cirunlabs/mlops-github-actions-cirun" rel="noopener noreferrer"&gt;Example repository&lt;/a&gt; uses a workflow to run MLOps on CPU and GPU using Cirun and returns execution times.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can see the Time complexity difference in CPU and GPU &lt;a href="https://github.com/vishal9629/MLops_with_Cirun/actions/runs/3452191297/usage" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5wo4l3sl32etwgbvf1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5wo4l3sl32etwgbvf1f.png" alt="Time Complexities" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this image we can clearly see that GPU is &lt;strong&gt;5.53&lt;/strong&gt; times faster then CPU and we can choose between two.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxbhysq9iw9ifagrd4gx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxbhysq9iw9ifagrd4gx.png" alt="Flowchart" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How Cirun helped us to do this?
&lt;/h3&gt;

&lt;p&gt;Cirun provides us with feature to create On-demand Self-Hosted Github Actions Runners with any configuration on our cloud. We also know that MLOps operates more efficiently on GPUs. Therefore we automated the entire process with GPU.&lt;br&gt;
Using Cirun we created a machine on AWS with NVIDIA T4 GPU and performed our operations. As a result we can see the huge difference between time complexities of MLOps using CPU and GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cml.dev/" rel="noopener noreferrer"&gt;CML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ml-ops.org/" rel="noopener noreferrer"&gt;MLOps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/actions" rel="noopener noreferrer"&gt;GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/vishal9629/MLops_with_Cirun/tree/new-example-2" rel="noopener noreferrer"&gt;Example GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/vishal9629/MLops_with_Cirun/blob/new-example-2/.github/workflows/MLOps-gpu.yml" rel="noopener noreferrer"&gt;MLOps using GPUs workflow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any questions and feedback about this blog, feel free to comment or reach out &lt;a href="https://cirun.io/" rel="noopener noreferrer"&gt;Cirun.io&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>mlops</category>
      <category>cirun</category>
      <category>github</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
