<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rushali Udhani on Medium]]></title>
        <description><![CDATA[Stories by Rushali Udhani on Medium]]></description>
        <link>https://medium.com/@rudhani0?source=rss-10a984c27ff8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cw1jpXMpf6U5ItjZ.jpg</url>
            <title>Stories by Rushali Udhani on Medium</title>
            <link>https://medium.com/@rudhani0?source=rss-10a984c27ff8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:19:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rudhani0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Schedule ETL Transformation jobs on GCP Cloud Scheduler using Pub/Sub]]></title>
            <link>https://medium.com/@rudhani0/schedule-etl-transformation-jobs-on-gcp-cloud-scheduler-using-pub-sub-5391e37ae15?source=rss-10a984c27ff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5391e37ae15</guid>
            <category><![CDATA[matillion]]></category>
            <category><![CDATA[google-cloud-scheduler]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[automating-setup]]></category>
            <category><![CDATA[cloud-pubsub]]></category>
            <dc:creator><![CDATA[Rushali Udhani]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 14:24:44 GMT</pubDate>
            <atom:updated>2020-08-28T14:28:33.711Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A key feature of running virtual machine instances (VMs) in the cloud is that you only pay for the compute resources you use. On GCP, VMs are charged per second.</em></p><blockquote><strong><em>Use Case:</em> We wanted to start the VM just once daily sometime in late night or early morning and then turn it off after completing data transforms. Keeping it running for the entire day and night served no useful purpose and in addition to it, switching it on and off on daily basis was a tiring responsibility. Thus, we decided to automate this process so that it saves time, effort and money.</strong></blockquote><p>This process has four major steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*Nxq_xqQz5tqYDiN1.png" /><figcaption>Steps to automate the flow of running Transformation jobs on schedule</figcaption></figure><p>Before we begin:</p><ol><li>Enable the Cloud Functions, Pub/Sub, and Compute Engine APIs: <a href="https://console.cloud.google.com/flows/enableapi?apiid=cloudfunctions,pubsub,compute_component&amp;redirect=/scheduler/docs/scheduling-instances-with-cloud-scheduler&amp;_ga=2.162642876.1611009392.1598534907-2025925334.1581616504">Enable the APIs here</a></li><li>Go to the VM Instances page, note the details like VM Instance name, region, zone for later use</li><li>Select the instance you wish to work with &gt;&gt;<strong>Click Show Info Panel </strong>&gt;&gt; <strong>Click Labels</strong></li><li>Add a label: enter key value information and keep a note of it, we will be needing this later</li></ol><blockquote><strong><em>Step 1: Create Cloud Functions to Start and Stop the VM Instance using Pub/Sub</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*DeiClqlQh9a9ykeP.png" /><figcaption>Create Cloud Function in GCP</figcaption></figure><ul><li>In your project, Go to the Cloud Function page in GCP</li><li>Click <strong>Create Function</strong></li><li>Set <strong>Function name</strong> to StartInstancePubSub</li><li>Leave <strong>Region</strong> at its default value</li><li>For <strong>Trigger type</strong>, select Cloud Pub/Sub</li><li>For <strong>Select a Cloud Pub/Sub topic</strong>, select Create a topic….</li><li>A <strong>New pub/sub topic</strong> dialog box should appear.</li><li>Under <strong>Topic ID</strong>, enter start-instance-event.</li><li>Click <strong>Create Topic</strong> to finish the dialog box.</li><li>Click <strong>Save</strong> at the bottom of the <strong>Trigger</strong> box.</li><li>Click <strong>Next</strong> at the bottom of the page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SysMz_cDop-_xIAf.png" /><figcaption>Deploying Cloud Function</figcaption></figure><ul><li>For <strong>Runtime</strong>, select Node.js 10.</li><li>For <strong>Entry point</strong>, enter startInstancePubSub.</li><li>On the left side of the code editor, select index.js</li><li>Replace the starter code with the following code:</li></ul><pre>const Compute = require(‘@google-cloud/compute’);<br> const compute = new Compute();<br> <br> /**<br> * Starts Compute Engine instances.<br> *<br> * Expects a PubSub message with JSON-formatted event data containing the<br> * following attributes:<br> * zone — the GCP zone the instances are located in.<br> * label — the label of instances to start.<br> *<br> * @param {!object} event Cloud Function PubSub message event.<br> * @param {!object} callback Cloud Function PubSub callback indicating<br> * completion.<br> */<br> exports.startInstancePubSub = async (event, context, callback) =&gt; {<br> try {<br> const payload = _validatePayload(<br> JSON.parse(Buffer.from(event.data, ‘base64’).toString())<br> );<br> const options = {filter: `labels.${payload.label}`};<br> const [vms] = await compute.getVMs(options);<br> await Promise.all(<br> vms.map(async (instance) =&gt; {<br> if (payload.zone === instance.zone.id) {<br> const [operation] = await compute<br> .zone(payload.zone)<br> .vm(instance.name)<br> .start();<br> <br> // Operation pending<br> return operation.promise();<br> }<br> })<br> );<br> <br> // Operation complete. Instance successfully started.<br> const message = `Successfully started instance(s)`;<br> console.log(message);<br> callback(null, message);<br> } catch (err) {<br> console.log(err);<br> callback(err);<br> }<br> };<br> <br> /**<br> * Validates that a request payload contains the expected fields.<br> *<br> * @param {!object} payload the request payload to validate.<br> * @return {!object} the payload object.<br> */<br> const _validatePayload = (payload) =&gt; {<br> if (!payload.zone) {<br> throw new Error(`Attribute ‘zone’ missing from payload`);<br> } else if (!payload.label) {<br> throw new Error(`Attribute ‘label’ missing from payload`);<br> }<br> return payload;<br> };</pre><ul><li>On the left side of the code editor, select the package.json.</li><li>Replace the starter code with the following code:</li></ul><pre>{<br> “name”: “cloud-functions-schedule-instance”,<br> “version”: “0.1.0”,<br> “private”: true,<br> “license”: “Apache-2.0”,<br> “author”: “Google Inc.”,<br> “repository”: {<br> “type”: “git”,<br> “url”: “https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git&quot;<br> },<br> “engines”: {<br> “node”: “&gt;=10.0.0”<br> },<br> “scripts”: {<br> “test”: “mocha test/*.test.js — timeout=20000”<br> },<br> “devDependencies”: {<br> “mocha”: “⁸.0.0”,<br> “proxyquire”: “².0.0”,<br> “sinon”: “⁹.0.0”<br> },<br> “dependencies”: {<br> “@google-cloud/compute”: “².0.0”<br> }<br> }</pre><ul><li>Click <strong>Deploy</strong> at the bottom of the page</li></ul><p><em>Now, you have deployed the cloud function to start an instance. Similarly, we will now create and deploy a function to stop instance.</em></p><p>· You should be on the <strong>Cloud Functions</strong> page in the Cloud Console.</p><p>· Click <strong>Create Function</strong>.</p><p>· Set <strong>Function name</strong> to stopInstancePubSub.</p><p>· Leave <strong>Region</strong> at its default value.</p><p>· Leave <strong>Memory allocated</strong> at its default value.</p><p>· For <strong>Trigger type</strong>, select Cloud Pub/Sub.</p><p>· For <strong>Select a Cloud Pub/Sub topic</strong>, select Create a topic….</p><p>· A <strong>New pub/sub topic</strong> dialog box should appear.</p><p>· Under <strong>Topic ID</strong>, enter stop-instance-event.</p><p>· Click <strong>Create Topic</strong> to finish the dialog box.</p><p>· Click <strong>Save</strong> at the bottom of the <strong>Trigger</strong> box.</p><p>· Click <strong>Next</strong> at the bottom of the page.</p><p>· For <strong>Runtime</strong>, select Node.js 10.</p><p>· For <strong>Entry point</strong>, enter stopInstancePubSub.</p><p>· On the left side of the code editor, select index.js.</p><p>· Replace the starter code with the following code:</p><pre>const Compute = require(‘@google-cloud/compute’);<br> const compute = new Compute();<br> <br> /**<br> * Stops Compute Engine instances.<br> *<br> * Expects a PubSub message with JSON-formatted event data containing the<br> * following attributes:<br> * zone — the GCP zone the instances are located in.<br> * label — the label of instances to stop.<br> *<br> * @param {!object} event Cloud Function PubSub message event.<br> * @param {!object} callback Cloud Function PubSub callback indicating completion.<br> */<br> exports.stopInstancePubSub = async (event, context, callback) =&gt; {<br> try {<br> const payload = _validatePayload(<br> JSON.parse(Buffer.from(event.data, ‘base64’).toString())<br> );<br> const options = {filter: `labels.${payload.label}`};<br> const [vms] = await compute.getVMs(options);<br> await Promise.all(<br> vms.map(async (instance) =&gt; {<br> if (payload.zone === instance.zone.id) {<br> const [operation] = await compute<br> .zone(payload.zone)<br> .vm(instance.name)<br> .stop();<br> <br> // Operation pending<br> return operation.promise();<br> } else {<br> return Promise.resolve();<br> }<br> })<br> );<br> <br> // Operation complete. Instance successfully stopped.<br> const message = `Successfully stopped instance(s)`;<br> console.log(message);<br> callback(null, message);<br> } catch (err) {<br> console.log(err);<br> callback(err);<br> }<br> };<br> <br> /**<br> * Validates that a request payload contains the expected fields.<br> *<br> * @param {!object} payload the request payload to validate.<br> * @return {!object} the payload object.<br> */<br> const _validatePayload = (payload) =&gt; {<br> if (!payload.zone) {<br> throw new Error(`Attribute ‘zone’ missing from payload`);<br> } else if (!payload.label) {<br> throw new Error(`Attribute ‘label’ missing from payload`);<br> }<br> return payload;<br> };</pre><p>· On the left side of the code editor, select the package.json.</p><p>· Replace the starter code with the following code:</p><pre>{<br> “name”: “cloud-functions-schedule-instance”,<br> “version”: “0.1.0”,<br> “private”: true,<br> “license”: “Apache-2.0”,<br> “author”: “Google Inc.”,<br> “repository”: {<br> “type”: “git”,<br> “url”: “https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git&quot;<br> },<br> “engines”: {<br> “node”: “&gt;=10.0.0”<br> },<br> “scripts”: {<br> “test”: “mocha test/*.test.js — timeout=20000”<br> },<br> “devDependencies”: {<br> “mocha”: “⁸.0.0”,<br> “proxyquire”: “².0.0”,<br> “sinon”: “⁹.0.0”<br> },<br> “dependencies”: {<br> “@google-cloud/compute”: “².0.0”<br> }<br> }</pre><p>· Click <strong>Deploy</strong> at the bottom of the page.</p><p><em>You have completed the first step of creating and deploying start and stop cloud functions.</em></p><blockquote><strong><em>Step 2: Create a job in GCP using Cloud Scheduler to start VM instance on a scheduled time</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/0*jWZAgM7rDWQvZ6xy.png" /><figcaption>Scheduling a Job in Cloud Scheduler</figcaption></figure><p>· Go to the <strong>Cloud Scheduler</strong> page in the Cloud Console.</p><p>· Click <strong>Create Job</strong>.</p><p>· Leave the default region and click <strong>Next</strong> at the bottom of the page.</p><p>· Set the <strong>Name</strong> to startup-vm-instances.</p><p>· For <strong>Frequency</strong>, enter 0 9 * * 1</p><pre>This will execute at 9:00 every Monday.</pre><p>· For <strong>Timezone</strong>, select your desired country and timezone.</p><p>· For <strong>Target</strong>, select Pub/Sub.</p><p>· For <strong>Topic</strong>, enter start-instance-event.</p><p>· For <strong>Payload</strong>, enter the zone and label of VM instance noted earlier. Below is an example, here “env” is key and “dev” is value of the label</p><pre>{“zone”:”us-west1-b”,”label”:”env=dev”}</pre><p>· Click <strong>Create</strong></p><p><em>Now you have created a job to start the VM Instance on a scheduled time.</em></p><blockquote><strong><em>Step 3: Create a top level orchestration job in ETL tool (here, Matillion) that transforms the data and after that sends a message through Pub/Sub to GCP to power off the VM Instance</em></strong></blockquote><p>· Inside Matillion, right click on your folder and select Add orchestration job</p><p>· Drag and drop the jobs/tasks you want to run</p><p>· Drag and drop a widget- Cloud Pub/Sub from Components<br>(NOTE: Pub/Sub component should be the last one in this job because as it runs, the VM will stop)</p><p>· Add Project name</p><p>· In topics, select “stop-instance-event”. This is the pub/sub topic we created earlier that triggers the STOP function</p><p>· In message, enter the zone and label of VM instance noted earlier. Below is an example, here “env” is key and “dev” is value of the label</p><pre>{“zone”:”us-west1-b”,”label”:”env=dev”}</pre><p><em>Now you have created an orchestration job that will send a message to stop the VM Instance after transforming data</em></p><blockquote><strong><em>Step 4: Create a schedule in Matillion to run the orchestration job on a scheduled time</em></strong></blockquote><p>· Let’s say we started our VM Instance at 6:00 AM. It will take about 30–60 seconds for the compute engine to start</p><p>· So we need to schedule this top level orchestration job (created in Step 3) to run after the compute engine is on</p><p>· In Matillion, Click on Project on the top left and then click Manage Schedules</p><p>· Here, select the job created in step 3 and relevant time zone and select the time as 6:02 AM</p><p><em>Now, our cloud scheduler will start the VM instance at 6:00 AM, Step 4 will start transforming data at 6:02 AM and you don’t have to worry about creating another job for stopping the VM Instance, because we already took care of it in Step 3, Pub/Sub will send a message and will trigger the cloud function and stop the instance</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5391e37ae15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Platforms]]></title>
            <link>https://medium.com/@rudhani0/data-science-platforms-d8e7794e7694?source=rss-10a984c27ff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8e7794e7694</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-science-platform]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Rushali Udhani]]></dc:creator>
            <pubDate>Sat, 27 Apr 2019 15:58:30 GMT</pubDate>
            <atom:updated>2019-04-27T15:58:30.038Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Why do we need Data Science Platforms</strong></p><p>•A recent study conducted by Markets and Markets predicts the market for data science platforms will climb to $101.4 billion by the year 2021</p><p>•Tool sprawl is a common challenge for data science teams.</p><ul><li>Tool Sprawl- There are so many tools to help any organization to complete their monitoring picture, but no tool does everything and most organizations use many tools to help complete their monitoring solution. <strong>Mashing tools together often creates a problem of its own- this is the tool sprawl problem.</strong></li></ul><p><strong>Data Science Platforms</strong></p><p>•Metis machine</p><p>•Datascience.com</p><p>•Domino</p><p>•Databricks</p><p>•Dataiku</p><ul><li>Paperspace</li></ul><p><strong>What Metis Machine does?</strong></p><p>•Elevates your Machine Learning (ML) workflow from proof-of-concept to production</p><p>•Seamlessly deploy, manage, monitor, and integrate models into your applications and products</p><p>•Install the Skafos Command Line Interface (CLI)</p><p>•Platform that holds it all together</p><ul><li>build, train, deploy and monitor their models independently</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*65mQjpGqQSgfb3wCIOh24A.png" /></figure><p><strong>Inspiration and Purpose behind Metis Machine</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*u2zNmrrTNAH5U7j0guzVvw.png" /></figure><p><strong>What datascience.com do?</strong></p><p>•On June 6, 2018, Oracle completed the acquisition of DataScience.com.</p><p>•Embeds Artificial Intelligence (AI) and machine learning capabilities across its software as a service (SaaS) and platform as a service (PaaS) solutions.</p><ul><li>Together, Oracle and DataScience.com will provide customers with a single data science platform that leverages Oracle Cloud Infrastructure and the breadth of Oracle’s integrated SaaS and PaaS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*H12SqgJc9upqxlqFnY4K4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cq_0FAgKHH85jkUvP_j8Gg.png" /></figure><p><strong>Main Aspects of datascience.com</strong></p><p>•The DataScience.com Platform combines the tools, libraries, and languages your team loves with the infrastructure and workflows your organization needs. The Platform combines three key components:</p><p>•<strong>Infrastructure</strong> — systems tasks (like spawning servers) are abstracted and handled automatically so data scientists can focus on the substance of their work</p><p>•<strong>Tools</strong> — open source tools (like Jupyter, R Shiny, or modeling libraries) that data scientists need are integrated into a centralized place</p><p>•<strong>Workflow</strong> — automation for tasks, collaboration, and communication that let data science teams effectively deliver on their mission</p><p><strong>Domino</strong></p><p>•Domino provides an open, unified data science platform to build, validate, deliver, and monitor models at scale.</p><p>•This accelerates research, sparks collaboration, increases iteration speed, and removes deployment friction to deliver impactful models.</p><p>•There are 3 layers in Domino</p><p>1) Infrastructure</p><p>2) Model Factory</p><p>3) Management Consoles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJJZUKn_YAbsBy5AaXos0w.png" /></figure><p><strong>Databricks</strong></p><p>•Databricks is a platform which provides ideal solution to challenges like data growth, infrastructure complexity, disparate technologies, disjoint analytics workflow, siloed teams and protecting the data by unifying data engineering, data science and business</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*_EbwifM070vLBokkKI1MKg.png" /></figure><p><strong>Dataiku</strong></p><p>•Dataiku’s single, collaborative platform powers both self-service analytics and the <br> operationalization of machine learning models in production.</p><p>•It provides a collective platform for data project process from data preparation to application deployment on single UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PlHooTBS_tOdNynXIdjIhg.png" /></figure><p><strong>Paperspace</strong></p><p>•Paperspace is a high-performance cloud computing and ML development platform for building, training and deploying machine learning models.</p><p>•Cloud VMs with GPU support for gaming, designing and programming (ML/DL) needs. Offers latest NVIDIA GPUs along with pre-installed packages and a few DL frameworks at competitive prices.</p><p>•Paperspace is a high-performance cloud computing and ML development platform for building, training and deploying machine learning models.</p><p>•Cloud VMs with GPU support for gaming, designing and programming (ML/DL) needs. Offers latest NVIDIA GPUs along with pre-installed packages and a few DL frameworks at competitive prices.</p><p>•Paperspace is a high-performance cloud computing and ML development platform for building, training and deploying machine learning models.</p><p>•Cloud VMs with GPU support for gaming, designing and programming (ML/DL) needs. Offers latest NVIDIA GPUs along with pre-installed packages and a few DL frameworks at competitive prices.</p><p><strong>Paperspace offers three products-</strong></p><p>•1. GRADIENT</p><p>•Gradient° includes 1-click jupyter notebooks, a powerful job runner, and a python module to run any code with full power of the Paperspace GPU cloud.</p><p>•3 components-</p><p>•Jobs, notebooks, data/storage</p><ul><li><a href="https://support.paperspace.com/hc/en-us/articles/115004333473-Tutorial-Train-your-first-neural-network-">https://support.paperspace.com/hc/en-us/articles/115004333473-Tutorial-Train-your-first-neural-network-</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*zH7f5TsRefeCDCBIlYbxtA.png" /></figure><p>2. Core- <strong>Windows or Linux Desktops &amp; Servers</strong></p><p>•Easily provisions a CPU or GPU accelerated Windows or Linux instance with a range of networking, storage, and OS options.</p><p>•Paperspace offers full desktop environments as well as servers with SSH or web-based terminal access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*t6Ghxp0cgY7mEh3jGYT8gQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*sp1FZlqbQ9VqmunnYfOfew.png" /></figure><p><strong>Data Science Platforms used by Popular Companies</strong></p><p>•Domino- Dell, GAP, Instacart, Tesla, Eventbrite,Turnitin, and many more</p><p>•Dataiku- Sephora, Comcast, Unilever, Fox, Santander, Capegemini</p><ul><li>Databricks- Viacom, hp, Shell, Samsung, nbcUniversal</li></ul><p><strong>Reference Articles</strong></p><p>•<a href="https://docs.metismachine.io/docs">https://docs.metismachine.io/docs</a></p><p>•<a href="https://medium.com/metis-machine/the-inspiration-and-purpose-behind-the-metis-machine-platform-ca2c10eef30">https://medium.com/metis-machine/the-inspiration-and-purpose-behind-the-metis-machine-platform-ca2c10eef30</a></p><p>•<a href="https://cloud.oracle.com/en_US/sign-in">https://cloud.oracle.com/en_US/sign-in</a></p><p>•<a href="https://medium.com/Data%20Science">https://www.datascience.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8e7794e7694" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy and fast steps to dockerize your files and uploading your docker image to dockerhub!!]]></title>
            <link>https://medium.com/@rudhani0/easy-and-fast-steps-to-dockerize-your-files-and-uploading-your-docker-image-to-dockerhub-3f2416eeb6c3?source=rss-10a984c27ff8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f2416eeb6c3</guid>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerhub]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Rushali Udhani]]></dc:creator>
            <pubDate>Mon, 04 Mar 2019 05:21:49 GMT</pubDate>
            <atom:updated>2019-03-04T05:21:49.317Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a grad student focusing on Data Analytics and Data Science and in one of my Data Science assignments, I was asked to containerize my python files through docker and then I realized that Docker is something really easy but people feel it is difficult only because we don’t have sufficient resources that clearly explain “<em>HOW TO CREATE A DOCKER IMAGE</em>”. And, for understanding this, I went through several youtube tutorials, blogs, articles, etc. And thus, I decided to write an article that clearly answers the above-mentioned question.</p><p>NOTE: This article does not cover the explanation of docker. It is assumed that you are familiar with the concepts of docker, creation of dockerfile, and requirements.txt file.</p><p>STEP 1: Adding the Docker file, Requirements.txt file, and python files in one folder.</p><p>NOTE: Make sure that the name of your docker file must be “Dockerfile” case sensitive, and without any extension (for that save it in doublequotes&lt; and choose all files as file type while saving in Notepad)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9bvRsKx3Nh3E1a2PmFysA.png" /><figcaption>Figure 1: Dockerfile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHsrlX8iR0l_t5q_LcLCoQ.png" /><figcaption>Figure 2: Requirements.txt</figcaption></figure><p>STEP 2: Login to your docker account with your credentials and then navigate to the folder in which you have all your required files using cd</p><p>Command- docker login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vufyXoW9w-Rnue8d3Aynlw.png" /><figcaption>Figure 3: Docker Login</figcaption></figure><p>Command- cd &lt;foldername&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exbJ62jjJhc0UXhjjoI1xA.png" /><figcaption>Figure 4: Navigating to the folder that has all required files</figcaption></figure><p>STEP 3: Build a docker image</p><p>Command- Docker build . -t &lt;imagename-dockerrepositoryname&gt;:tagname</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jmb5lSttc30lTk4-TfqdA.png" /><figcaption>Figure 5: Building a docker image</figcaption></figure><p>Now we have successfully built a docker image. The command for viewing images is- docker images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgTg6TDZeNcbJRZLinThmA.png" /><figcaption>Figure 6: Displaying the docker images</figcaption></figure><p>STEP 4: Run the docker image</p><p>Command- docker run &lt;imageid&gt; or &lt;imagename&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7k3pV19YSRDBMqELcbYSMQ.png" /><figcaption>Figure 7: python file had a print statement so docker is displaying that in the terminal</figcaption></figure><p>STEP 5: Publishing docker image on docker hub</p><p>5A: Log in to your dockerhub account and create repository from the blue tab on the right</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ykqWqlU-Pt3kcLh_l33sxg.png" /><figcaption>Figure 8: Displaying the repositories on dockerhub</figcaption></figure><p>5B: publishing docker image to dockerhub through terminal</p><p>Command- docker tag &lt;dockerimagename:tagname&gt; &lt;dockerhub id/dockerrepositoryname&gt;:newtagname</p><p>docker push &lt;dockerhub id/dockerrepositoryname&gt;:newtagname</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9YDrZgMY_9t3NrZobo2iZw.png" /><figcaption>Figure 9 : Publishing your docker image to dockerhub</figcaption></figure><p>Docker Image has been published on Dockerhub-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLuxiHxEW10al0PQ0VktPA.png" /><figcaption>Figure 10: Docker image has been successfully published on Dockerhub</figcaption></figure><p>I’m also a novice to Docker, and a lot of what I’ve put in this article is about things that I found lacking clarity in other videos/ articles/ tutorials. Feel free to leave any comments or suggestions in the comments below. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f2416eeb6c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>