<?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 Bikash Sundaray on Medium]]></title>
        <description><![CDATA[Stories by Bikash Sundaray on Medium]]></description>
        <link>https://medium.com/@bikashkumars?source=rss-73d90ae2c142------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*32SLOMoSS6hl0k41yaEgNw.jpeg</url>
            <title>Stories by Bikash Sundaray on Medium</title>
            <link>https://medium.com/@bikashkumars?source=rss-73d90ae2c142------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:55:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bikashkumars/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[Observability is must]]></title>
            <link>https://medium.com/techmintmedia/observability-is-must-89e4cfaf3df?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/89e4cfaf3df</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 19:59:17 GMT</pubDate>
            <atom:updated>2022-08-20T09:16:02.453Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservice Observability is must</h3><h4>Microservice and Distributed Apps — Observability</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJHbcqYSzbtOrXX59ok7og.png" /></figure><p>Today we are going to talk about modern microservice and distributed application monitoring and debugging. What are the standard practices to be followed which are accepted globally. Open Source tools and technology which is adopted by many companies across the globe. We will talk about multiple programming languages, frameworks, frontend and backend technology which need monitoring and debugging. We will talk about Observability which can be applicable to distributed system like Microservice Application backend, BigData and machine learning.</p><p>Also we will try to understand in simpler terms.</p><h3>Let’s understand Metrics and Trace</h3><p>Metrics, we specifically mean the class of information that allows you to talk about the performance of a system, it could be different components of a single app or a cluster.</p><p>Metrics are always counters in the form of numeric. So when we say metrics, that means it’s already aggregated. We have only abstract information. For example metrics is like website response time is “100 ms”. Other examples like last 5 minutes system has 10k new traffic. These numeric data about your application and system are Metrics.</p><p>Where as Tracing contains information ( not counters or figures), for example inside trace data we will find TraceId, client IP address, service name, datetime, payload size etc. If we will talk about distributed tracing, it will give you full information about a request. It may or may not contains all the micro-service details that request went through to serve the final response.</p><p>In Modern Application and system we need metrics as well as distributed tracing (Aka Trace). Metrics give us current performance indicator of our application where as distributed tracing helps of analyzing problem if performance goes down or debugging something on live system. Both can be Realtime data or near Realtime data depends on what you have implemented.</p><h3>Tracing, Metrics and Monitoring</h3><p>Let me tell you, neither tracing nor metrics are new. Metrics and Tracing are used in microservices but way before that tracing and metrics was there and was getting used by larger applications ( single service or monolith application or system monitoring ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*8ZonkDeY4_i8gVH2FQP3nQ.png" /></figure><p>Monitoring is used to monitor your systems performance and discover the particular areas that having some issue or need your attention. It’s basically reactive mode. You monitor your system and application so that you can take action when something goes wrong.</p><p>Observability giving you the insight to see how each piece of your system fits together (micro-services) so you can determine what to look at when it matters most. Let’s say you want to see which component/microservice which are making site slow. Mostly observability gives your answer to your question, where as monitoring has got only abstract information. It’s more to proactive mode.</p><p>In the Observability space, 4 cloud native standard has been involved in the recent year</p><ol><li>OpenTracing</li><li>OpenCensus</li><li>OpenMetrics</li><li>OpenTelemetry</li></ol><p>OpenTelemetry is trying to solve bigger problem, OpenTelemetry combines OpenTracing, OpenCensus and OpenMetrics and making as single industry cloud native data format standard for Observability area.</p><p>Already OpenTracing is implemented in OpenTelemetry and currently at stable state. OpenCensus is all-most at the edge of stable condition of implementation. Implementing OpenMetrics just began. Out if 3 OpenMetrics is bit different, as OpenMetrics is trying to enforce Prometheus standard at the facto standard for Metrics data format.</p><p>Let’s now consider Observability</p><h3>Observability</h3><p>3 pillars of Observability are Logs, Metrics and Trace. You can call a system is implemented with Observability, that means you are already using techniques, tools and technology to generate logs, metrics and Traces. It could be 1 platform that you are using or you are using multiple tools and technology to generate all 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msl8JvGz9hWhA8l4B7VWEA.jpeg" /></figure><p><strong>Observability </strong>is the ability to measure the internal states of a system by examining its outputs. A system is considered “observable” if the current state can be estimated by only using information from outputs — That means there should be way to analyze system that it is working as expected or not from a indicator or metrics or something similar.</p><blockquote><em>Don’t confuse your-self with Observability and Monitoring Observability is a property of that system, like functionality or testability where as Monitoring is an action you perform to increase the observability of your system.</em></blockquote><p>I know, my last highlighted paragraph has confused you a bit. So let’s simplify. There should be way in your system where I can look at metrics at any given point of time ( like dashboard ), from there I suspect if anything going wrong (low speed or drop traffic or higher error rate, slow response time), from there I can pick one instance and search for different traces ( like list of request), then by clicking that I can see details logs ( Exact log of that request). This is basically part of observability. Monitoring in the other hand, you are trying to monitor your system for performance, downtime, service-restart etc and gets alerts if that happens.</p><p>Observability combines trace, metrics and logs for microservice to microservice communication, DB communication, Message-Queue communication etc. So anything happening inside the system, so you should have clear metrics, trace and logs for it. That fulfills Observability.</p><h3>Is there any Open Source tool which I can use to create Observability ?</h3><p>Among the best Opensource Observability back-end are Jaeger, Zipkin and Prometheus. Jaeger and Zipkin will be used for OpenTracing, Prometheus is for Metrics and you can use ELK stack for logging. There is new comer to the list is under Apache called “ Apache Skywalking “. I personally like the tool but not tested yet. Apache Skywalking gives you single platform for metrics, trace and logging. If you don’t want to use Apache Skywalkinh then you have to use 3~4 tools to implement observability in your platform.</p><p><strong>What is Open Telemetry and how it related to Observability ?</strong></p><p>Recently (in 2021) Observability data format got standardized and the given name was “OpenTelemetry”, which means there is a specific project and maintainer who maintains standard required for Observability and they are called OpenTelemetry data format and standard. OpenTelemetry combines <a href="https://opentracing.io/">OpenTracing</a> and <a href="https://opencensus.io/">Opencensus</a> project and comes to an conclusion of single data telemetry format to generate Metrics, Trace, Logs and Events. Before OpenTelemetry, every tools coming for Observability was trying to enforce different format as per their need, which was promoting vendor lock. That means if you are X tool, then you have to use X tool forever until you are reimplementing newer Y tools format in your code.</p><p>If you are using OpenTelemetry format, that means your application and system is generating OpenTelemetry data format which can ingested to any backend system for further analysis. OpenTelemetry generate a data format called OTLP but it can generate a vendor specific data format. So OpenTelemetry allows you switch to any Observability platform or backend without code changes, so technically there is no vendor lock-in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*w67GlJzvtbYLW_rjEEi5kQ.png" /></figure><p><strong>Note </strong>— Even-if I am saying its standardized, its not IEEE standard, rather CNCF supported project. That’s how Cloud Native ecosystem works.</p><blockquote><em>So if you are planning to start Observability for your system, please use OpenTelemetry at your client side and choose any platform or backend to store data.</em></blockquote><p>Till 2022, you will find tons of application are using OpenTracing as tool for Observability. But now OpenTracing it-self is asking to use Observability. List of vendor supporting OpenTelemetry are here <a href="https://opentelemetry.io/vendors">natively supported by a number of vendors</a>.</p><p>Trace and Metrics are stable in OpenTelemetry current implementation. But logs are not part of current SDK. To implement OpenTelemetry OTLP format logs, you need to relay on Some logging tools/library which are using OTLP logging format as a collector. For example LOG4J. OpenMetrics is still not standardized and under active development in OpenTelemetry.</p><h3>How i can start Observability ?</h3><p>To start using OpenTelemetry, there are 2 types of implementing OpenTelemetry</p><ol><li>Manual Instrumentation ( You have to use OpenTelemetry package inside your code to generate Metrics, Trace and Logs, you have to write code specifically related to OpenTelemetry data generation)</li><li>Auto Instrumentation ( OpenTelemetry will auto generate Metrics, Trace and Logs for you)</li></ol><p>You can check your framework documentation, how it allowing you to use OpenTelemetry.</p><p>List of reference for Java and python based application.</p><ul><li><a href="https://spring.io/projects/spring-cloud-sleuth">https://spring.io/projects/spring-cloud-sleuth</a></li><li><a href="https://github.com/spring-projects-experimental/spring-cloud-sleuth-otel">https://github.com/spring-projects-experimental/spring-cloud-sleuth-otel</a></li><li><a href="https://quarkus.io/guides/opentelemetry">https://quarkus.io/guides/opentelemetry</a></li><li><a href="https://github.com/quarkusio/quarkus-quickstarts/tree/main/opentelemetry-quickstart">https://github.com/quarkusio/quarkus-quickstarts/tree/main/opentelemetry-quickstart</a></li><li><a href="https://opentelemetry-python.readthedocs.io/en/latest/">https://opentelemetry-python.readthedocs.io/en/latest/</a></li><li><a href="https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/flask/flask.html">Python Flask</a></li></ul><p>For more information, you can check following supported programming languages, which has Auto instrumentation support.</p><p><a href="https://opentelemetry.io/docs/instrumentation/">Instrumentation</a></p><h3>More information about Jaeger, Zipkin and Prometheus</h3><p><strong>#1 Where they store their data — Storage solution</strong></p><ul><li>Jaeger stores in Cassandra 3.4+ and Elasticsearch 5.x/6.x/7.x</li><li>Jaeger current experiments with other databases, such as ScyllaDB, InfluxDB, Amazon DynamoDB, Logz.io</li><li>Cassandra and Elasticsearch are the primarily supported storage backends by Jaeger.</li><li>Zipkin was originally built to store data in Cassandra, but it later started supporting Elasticsearch and MySQL too</li><li>Prometheus has its own timeseries database inbuilt. It stores data persistent to disk.</li></ul><p><strong>#2 Data Format supported by each tool</strong></p><ul><li>Zipkin format supports Thrift, JSON v1/v2 and Protobuffer</li><li>Zipkin API <a href="https://zipkin.io/zipkin-api/#/default/post_spans">https://zipkin.io/zipkin-api/#/default/post_spans</a></li><li>Common ways to send data to Zipkin is via http or Kafka</li><li>Jaeger supports Protobuf for gRPC</li><li>Jaeger also support thrift/JSON format over Http</li><li>Zipkin format is also supported by Jaeger. That means if you are using Zipkin and wants to migrate to Jaeger then its easy.</li></ul><p><strong>#3 Companies behind each tool</strong></p><p>Jaeger is based on Go Lang (was originally built by teams at Uber) — for per service tracking called spans</p><p>Zipkin is based on java (Zipkin was originally inspired by Google’s Dapper and was developed by Twitter). Zipkin is a much older project than Jaeger</p><p>Prometheus is developed by SoundCloud</p><p><strong>#4 What else beyond Zipkin, Jaeger and Prometheus.</strong></p><p>Well there are lot of SaaS platform, which make our life easy for observability. But it’s all paid service, you have to pay for it to store and analyze your data. Also data will not be stored in house or your cloud cluster, rather it will be stored in their system.</p><p>Following are few best SaaS platform for Observability. They all started supporting OpenTelemetry OTLP format. Also they have their own system of data collection i.e. platform specific instrumentation. I personally used Splunk and Datadog.</p><ul><li>Splunk</li><li>Dynatrace</li><li>Datadog</li><li>New Relic</li><li>Sentry</li><li>Logz.io</li></ul><p>Following diagram shows, how Datadog platform can use OpenTelemetry instrumentation or datadog own instrumentation agent. It depends how you use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Oetp6TZl1Fhm4WTTpnrtA.jpeg" /></figure><h3>Challenges and Solution</h3><p>How current system is using Complex Setup for Observability</p><p>Challenges</p><ul><li>There is no way to link co-relation between multiple observability system like Jaeger and Prometheus and Elastic Search.</li><li>Still its multiple tools are used to complete the observability setup. There are platforms which combines all 3 but they are paid like <a href="http://datadoghq.com/">DataDog</a> and <a href="http://splunk/">Splunk</a>. Of course we have Apache Skywalking which is OpenSource and gives same kind of capability for Observability.</li></ul><p>Following diagram illustrates, current challenges and how big product has done their setup for Observability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*QGawhroWFc7bsXQ6Hiy6ww.jpeg" /></figure><p>This is how application these days are implemented Logging, Tracing and Metrics collection. So for logging we are using different agent, for tracing we are using different agent and for metrics we are using different agents. As an Example you can say logstash is using as log collector and stored on Elastic Search. jaeger agents are used to collect distributed traces. Prometheus agents are used to collect metrics and store on Prometheus or influxDB.</p><h3>What is the way forward solution to above problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3SvFTkXBMFtSWJFk2iQog.jpeg" /></figure><blockquote><em>The conclusion is, OpenTelemetry solved the problem of Tracing and Metrics, to enforce standard. But Logs part still under development and it will be fixed soon.</em></blockquote><h3>Tool that we discussed, here are the links and quick code snippet</h3><h3>Jaeger</h3><p>Jaeger started supporting OpenTelemetry starting version <a href="https://github.com/jaegertracing/jaeger/releases/tag/v1.35.0">Jaeger v1.35 release</a>. In this version Jaeger introduced the ability to receive OpenTelemetry trace data via the <a href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md">OpenTelemetry Protocol (OTLP)</a>. Also along with that Jaeger announced its client SDK retirement as OpenTelemetry client will replace it.</p><p><a href="https://www.jaegertracing.io/">Jaeger: open source, distributed tracing platform</a></p><p>Quickest way to start Jaeger in your system</p><pre>docker run -e JAEGER_DISABLED=true -e COLLECTOR_OTLP_ENABLED=true -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:1.37</pre><p>Now send some OTLP data to Jaeger backend and keep exploring Observability.</p><h3>Apache SkyWalking</h3><p>Apache SkyWalking is a Modern OpenTelemetry backend which can store metrics, trace send my openTelemetry collector and exporter.</p><p><a href="https://skywalking.apache.org/">Apache SkyWalking</a></p><p>Apache SkyWalking accepts both trace and metrics data.</p><h3>Zipkin</h3><p>Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data.</p><p><a href="https://zipkin.io/">OpenZipkin · A distributed tracing system</a></p><pre>docker run -d -p 9411:9411 openzipkin/zipkin</pre><h3>Prometheus</h3><p>Prometheus deals with metrics where as Zipkin and Jaeger deals with Distributed tracing. So you can use Jaeger for distributed tracing but as there is no support for metrics data on those tools, you have to choose tools which can handle metrics, for that we have prometheus. prometheus it-self is a timeseries database plus software ware which can handle metrics data and same can be integrated with Visualization tool like Grafana to data visualization.</p><pre>docker run <br>    -p 9090:9090 \<br>    -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \<br>    prom/prometheus\</pre><p>you also need to setup Grafana and Alert manager with Prometheus.</p><p>I have not gone very detailed about any language specific implementation. But I can write that in another article. So far Observability from OpenTelemetry prospective should be very clear.</p><p>Thanks for Reading. Don’t forget to share it if you find it informative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e4cfaf3df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/observability-is-must-89e4cfaf3df">Observability is must</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Internal Working Mechanism]]></title>
            <link>https://medium.com/techmintmedia/kafka-internal-working-mechanism-335d47bc471a?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/335d47bc471a</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kafka-streams]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 07:13:03 GMT</pubDate>
            <atom:updated>2022-06-19T07:13:03.616Z</atom:updated>
            <content:encoded><![CDATA[<h4>Some less explored area of Kafka</h4><p><strong>Kafka</strong>: Apache Kafka is an open-source distributed event streaming platform used for high-performance data pipelines, streaming analytics, data integration and message queue system. It’s open source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKTKq2z6NC058p3hjIBGBA.png" /></figure><p>Let’s explore the unknown and in-depth facts about Kafka.</p><h3>Even-if Kafka stores data on Disk how come it is fast and provides high throughput</h3><p>Kafka relies heavily on the filesystem for storing and caching messages. There is a general perception that “disks are slow” which makes people skeptical that a persistent structure can offer competitive performance. In fact disks are both much slower and much faster than people expect depending on how they are used; and a properly designed disk structure can often be as fast as the network.</p><p>Kafka depends on Operating system Page Cache. Page cache is like files/data written to Disk, its index/meta cached on Ram by Operating system. Kafka takes the advantage of this. Kafka internal code gets the message from producer, then it writes to memory (page cache) and then it writes to disk. This is archived by Sequential I/O which is provided by all modern OS. You can read more about Sequential I/O on internet.</p><p>As Kafka is build on Java, you can read more about Oracle Java Documentation about Zero Copy Concept from Java side. Read about “transferTo()” method. <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html">https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html</a></p><p>When SSL is enabled, zero copy optimization is lost, since the Broker needs to decrypt and encrypt the data. So use SSL for Kafka wisely. But Kafka didn’t mention this straight in their documentation.</p><h3>Do I need high Memory compute instance or Higher CPU cores instances for Kafka broker.</h3><p>You should choose a modern processor with multiple cores. Common clusters utilize 24 core machines. In-case you are planning to use encryption in transit within your broker and application, then definitely you need to add more cores comparing to your calculated number of cores. If you need to choose between faster CPUs and More cores, choose more cores. The extra concurrency that multiple cores offers will far outweigh a slightly faster clock speed. Also avoid Network storage disk rather go with actuary attached disk like AWS EBS or something similar like attaching hard-disk to Rack where you have kept your physical server.</p><p>On consumer side, also remember if your single consumer (Pod, container, Application) is required to handle data from multiple partition, then don’t forget to give more CPUs for better read performance.</p><p>Avoid the large machines because they often lead to imbalanced resource usage. For example, all the memory is being used, but none of the CPU. Also don’t go with small machines which push you to maintain more nodes (kafka broker) in your cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Yh3GK76TClGbkkNFDQETeg.png" /></figure><h3>Why Kafka leaving Zookeeper from 4.x ?</h3><p>Historically, Apache ZooKeeper was a critical part of how this distributed code worked. ZooKeeper provided the authoritative store of metadata holding the system’s most important facts: where partitions live, which replica is the leader, and so forth. The use of ZooKeeper made sense early on — it is a powerful and proven tool. For the first time, you can run Kafka without ZooKeeper starting from kafka v2.8 as preview mode. Where zookeeper will be replaced with a module called Kafka Quorum Controller based RAFT which will store all Metadata.</p><p>As part of new architecture Kafka will use new quorum controller, all metadata responsibilities previously undertaken by the Kafka controller and ZooKeeper are merged into this one new service called Quorum Controller. It is part of kafka it-self. The quorum controller can also run on dedicated VM if you have a use case that demands it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5OOhZPDr6HoI7WdukIvFQg.png" /></figure><p>The quorum controllers use the new KRaft protocol to ensure that metadata is accurately replicated across the quorum. This protocol is similar in many ways to ZooKeeper’s ZAB protocol. The new quorum controller is designed to handle a much larger number of partitions per cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7z9fh1C2ZiT64y5Ka8nI1Q.png" /></figure><p>Performance statistics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RI6b-QA6VsTajrqIDJeiw.jpeg" /></figure><p>Roadmap</p><ol><li>Kafka can run on preview mode (experimental/non-production) without zookeeper starting version 2.8</li><li>From Kafka 3.x you can run kafka without zookeeper or with zookeeper (option is there)</li><li>From Kafka 4.x, entire zookeeper support will be deprecated ( expected as of now )</li></ol><h3>Kafka Redistribution</h3><p>Even if Kafka is Opensource and Apache licensed, but there are several companies who offers Kafka on Cloud or improved/extended version of Kafka which comes with price and premium support. They maintain the original features of Kafka along with provides extended feature.</p><ul><li>Confluent: <a href="http://cnfl.io/ccloud">Confluent Cloud</a> (SaaS, fully managed) and <a href="http://cnfl.io/cplatform">Confluent Platform</a> (software download for self-managed/on-premise)</li><li>Cloudera distribution — <a href="https://www.cloudera.com/products/open-source/apache-hadoop/apache-kafka.html">https://www.cloudera.com/products/open-source/apache-hadoop/apache-kafka.html</a></li><li>EmblocSoft distribution and CPFA training — <a href="https://www.emblocsoft.com/pages/en/solutions/kafka/support/">https://www.emblocsoft.com/pages/en/solutions/kafka/support/</a></li><li>IBM Event Streams — <a href="https://www.ibm.com/cloud/event-streams">https://www.ibm.com/cloud/event-streams</a> — Apache Kafka on premise and the public cloud</li><li>Strimzi — <a href="http://strimzi.io/">http://strimzi.io/</a> — Apache Kafka Operator for Kubernetes and Openshift. Downloads and Helm Chart — <a href="https://github.com/strimzi/strimzi-kafka-operator/releases/latest">https://github.com/strimzi/strimzi-kafka-operator/releases/latest</a></li><li>TIBCO Messaging — Apache Kafka Distribution — <a href="https://www.tibco.com/products/apache-kafka">https://www.tibco.com/products/apache-kafka</a> Downloads — <a href="https://www.tibco.com/products/tibco-messaging/downloads">https://www.tibco.com/products/tibco-messaging/downloads</a></li></ul><h3>Kafka Eco-System</h3><p>Its not just installing Kafka with Zookeeper and start publishing and subscribing messages or stream data to Kafka. There is a big ecosystem which makes Kafka as on of the best message queue and streaming platform in modern Tech stack. Let’s explore the Kafka Ecosystem. Kafka provides following ecosystem.</p><ul><li>Kafka connect</li><li>Kafka Stream processing</li><li>Kafka Hadoop integration</li><li>Kafka integration with Oracle DB</li><li>Kafka on AWS</li><li>Kafka on Azure</li><li>Kafka on GCP</li><li>Kafka logging</li><li>GUI tools for Kafka</li><li>Metrics for Kafka</li></ul><h3>Does Kafka repeats same message which is already delivered to same consumer ?</h3><p>Well YES. was it shocking for you ?</p><p>Till kafka 2.x as zookeeper is the dependent service ( coordinator), so the Kafka works is like kafka stores metadata information in zookeeper for example each topic wise partition list and which consumer group has read up-to which offset. Also zookeeper maintainer the current leader of a partition.</p><p>But here is the catch ( Kafka does this as part of performance improvement )</p><blockquote><em>Kafka does not update Zookeeper with the message offset last read after every read, instead it waits a short period of time. Due to this delay it is possible that your logic has consumed a message and that fact hasn’t been synced to zookeeper. So if your client exits/crashes you may find messages being replayed next time to start.</em></blockquote><p>Also note that sometimes the loss of a Broker or other event that causes the Leader for a Partition to change can also cause duplicate messages to be replayed. So you should design your data critical application carefully.</p><p>Is there any solution to this problem ? Yes kafka do provides 2 types of consumer</p><ol><li>High level consumer — This is most widely used consumer style for kafka cluster. For these style of Kafka consumers, Kafka provides techniques like Consumer group, automatic offset commit, manual offset commit, not to worry about Kafka broker (auto broker discovery), not to worry about where is the partition is (broker name), not to worry about who is the current leader of the partition. Most generic subscriber/consumer group follow this consumer style like SpringBoot, Spring, Quarkus and other programming language kafka clients.</li><li>Low Level consumer — This is I would say less explored and uncommon area of Kafka consumer. This don’t provides consumer group that means you as consumer in your database need to maintain last read offset, so each time your consumer is going to ask messages from kafka, consumer should provide the offset. As a consumer you decide from which partition you need to read message. As a consumer you need to findout who is the current leader of the partition (Kafka broker), if that broker goes down, you need to findout who is the new broker. So it’s kind of very heavy self managed client/consumer to deal with Kafka data subscriber part. usually extreme mission critical application need to follow this way.</li></ol><h3>Kafka Compact Topic</h3><p>Can Kafka keep message forever ? The answer is Yes, Kafka can store message forever. Kafka provides topic wise configuration called “Compact topic” that means data retention of that topic will be “-1” means infinite.</p><p>As per Kafka definition: Log compaction ensures that Kafka will always retain at least the last known value for each message key within the log of data for a single topic partition. It addresses use cases and scenarios such as restoring state after application crashes or system failure, or reloading caches after application restarts during operational maintenance. For each unique message key it will retain only the last published message, other old message belongs to that key will deleted automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*kCzkvrvT-A6xEgpf65RKzQ.png" /></figure><p>But now the question is, evenif I am using compact type Kafka topic, lets say I want to delete a message from compact topic, is it still possible ? Answer is Yes</p><p>It’s possible to remove a message from a Kafka topic by publishing a new message with the key of the message we want to delete as null. The general tendency of kafka is that, if it finds any key with value as null, then it automatically it deletes that message. So in this way you can reduce the message size of compact topic. For this deletion kafka provides configuration as “delete.retention.ms”</p><h3>Kafka Mirror Maker ( Geo replication )</h3><p>Suppose you want to replicate your Kafka cluster data to another Kafka cluster then you need something called MirrorMaker. Usually for Disaster recovery this tool has been used.</p><p>Kafka’s mirroring feature makes it possible to maintain a replica of an existing Kafka cluster. MirrorMaker tool to mirror a source Kafka cluster into a target (mirror) Kafka cluster. The tool uses a Kafka consumer to consume messages from the source cluster, and re-publishes those messages to the local (target) cluster using an embedded Kafka producer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*vocQpMjZPDjNvjwlJQhsGw.jpeg" /></figure><p>Kafka administrators can define data flows that cross the boundaries of individual Kafka clusters, data centers, or geo-regions. With MirrorMaker you can monitor the status of Sync based on single topic or all topic just to monitor how replication is working.</p><p>When you should starting thinking about MirrorMake. Following are the high level use cases and need.</p><ul><li>Geo-replication</li><li>Disaster recovery</li><li>Feeding edge clusters into a central, aggregate cluster</li><li>Physical isolation of clusters (such as production vs. testing)</li><li>Cloud migration or hybrid cloud deployments</li></ul><p>MirrorMaker has way more configuration than you expect ( if you are new) . Let’s consider A being Kafka cluster-1 and B the 2nd Kafka cluster (same for C, D and K cluster). Following sync configuration is possible between multiple Kafka clusters.</p><ul><li>2 way sync between cluster ( Active-Active setup) : A-&gt;B, B-&gt;A</li><li>1 Way Sync ( Active-Passive setup) : A-&gt;B</li><li>Aggregation (from many clusters to one): A-&gt;K, B-&gt;K, C-&gt;K</li><li>Fan-out (from one to many clusters): K-&gt;A, K-&gt;B, K-&gt;C</li><li>Chaining or Forwarding: A-&gt;B, B-&gt;C, C-&gt;D</li></ul><p>MirrorMaker shell script “connect-mirror-maker.sh”, you can find inside “bin” folder of latest Kafka distribution.</p><p>Thanks for reading. Don’t forget to like this and share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=335d47bc471a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/kafka-internal-working-mechanism-335d47bc471a">Kafka Internal Working Mechanism</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes — Things you should know]]></title>
            <link>https://medium.com/techmintmedia/kubernetes-things-you-should-know-1d0ba25d5f74?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d0ba25d5f74</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sat, 02 Apr 2022 19:05:14 GMT</pubDate>
            <atom:updated>2022-04-02T19:05:14.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes — Things you should know</h3><h4>Internal working mechanism of Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*B05pbIVNN9K-OzVIjyFr-Q.png" /></figure><p>I have been working on Kubernetes and deploying cloud-native apps for over 6 years now. Being at both ends of Cloud-Native Apps where I design/develop and deploy. Seen the transition from the most difficult way of on-prem K8s deployment to managed services like EKS and AKS. Here I am sharing my experience and things you should know about Kubernetes.</p><p>This is the Part-1 of this series. I will be releasing around 4 more articles on this topic.</p><blockquote><em>This content targets both cloud and on-prem Kubernetes deployment. Some content may not required for services like AKS, EKS, as internal things are managed by AWS and Azure.</em></blockquote><p>Fact: Kubernetes is also referred to as K8s, not k8s :) — this was just a fun fact.</p><p>What we are going to cover in this article</p><ul><li>Fun with K8s</li><li>Any K8s playground which I can use to play with K8s</li><li>Vendors who can help to kick-start Kubernetes for your new Product/application</li><li>etcd database of K8s and how it’s effective</li><li>Kubernetes API life cycle</li><li>CRI and K8s is dropping docker-engine support</li><li>Node affinity and anti-affinity</li><li>Forum</li></ul><h3>#1 Fun with K8s</h3><p>Can I visualize my K8s cluster in 3D :) Yes you can, watch out the demo here (Please don’t use it for production)</p><p><a href="https://afritzler.github.io/kube-universe/web/demo/">https://afritzler.github.io/kube-universe/web/demo/</a></p><h3>#2 From where I can play with Kubernetes</h3><p>Online playground</p><ol><li><a href="https://labs.play-with-k8s.com/">https://labs.play-with-k8s.com/</a></li><li><a href="https://www.katacoda.com/">https://www.katacoda.com</a>/</li></ol><p>Offline single node K8s ( you need to install)</p><ol><li><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a></li><li><a href="https://www.docker.com/products/docker-desktop">https://www.docker.com/products/docker-desktop</a></li><li><a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></li></ol><h3>#3 Can I use Kubernetes for my Apps deployment without knowing it</h3><p>There are platforms like OpenShift and cloud foundry which are built on top of Kubernetes. This platform gives you an abstraction layer for engineers to focus on engineering problems and App deployment rather than focusing on and knowing what is Kubernetes and how to configure it. But these platforms are built heavily on K8s.</p><p>If you don’t have Kubernetes engineers in your team, you can take help from the following list of companies listed on CNCF. Who can help you doing K8s setup ( of course they will charge you for their service) <a href="https://www.cncf.io/certification/kcsp/">https://www.cncf.io/certification/kcsp/</a></p><h3>#4 Kubernetes Database</h3><p>Yes, Kubernetes as an orchestration tool internally used a Database to store information. When you create an Object like Deployment, Pod, Service, Secrets — all such information are stored in etcd database. When you execute kubectl command, kubectl command talks to KubeAPI and KubeAPI request to binary ( internal K8s software ), then those binary extract information from etcd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*uHGKJnowcV3X55EQ7wacyw.png" /></figure><blockquote><em>etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node</em></blockquote><p>etcd Benchmarked at 1000s of writes/s per instance</p><p>Do you want to understand how practically etcd works ? let’s use this website playground to do some write, Read and Delete operation <a href="http://play.etcd.io/play">http://play.etcd.io/play</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8hP8OHtJsSoATBdJiwXMg.png" /></figure><h3>#5 Kubernetes API life cycle</h3><p>The core of Kubernetes’ control plane is the API server. The API server exposes an HTTP API that lets end users, different parts of your cluster, and external components communicate with one another.</p><p>The Kubernetes API lets you query and manipulate the state of API objects in Kubernetes (for example: Pods, Namespaces, ConfigMaps, and Events).</p><p>Have you seen this ? for few objects you write alpha1 and for few write v1 and for others you write beta1</p><pre>apiVersion: kubelet.config.k8s.io/v1alpha1<br><br>apiVersion: v1</pre><p>When Kubernetes add new features, mostly it never release it as GA (General available), rather it goes through API life-cycle called alpha, beta, betav1, betav2 and GA (v1, v2 etc).</p><p>Each time you are upgrading kubernetes, you need to look at your YAML files, in-case any alpha API promoted to beta. Or any beta api promoted to GA. Based on that you need to make changes to your YAML files ( RAW K8s Object YAML files or Helm Chart ) to point to correct API version. As there might be cases that, K8s might deprecate the API it-self.</p><h3>#6 CRI: Container Runtime Interface</h3><p>Container is not all about Docker. There are a lot of container solution available, which can be used as Container engine/runtime for Kubernetes.</p><p>Out-of-box kubernetes is having a API layer called CRI, which promotes any container engine/runtime which can talk to K8s via CRI ( by means protobuf and grpc ) — kubernetes is going to support it. Kubelet communicates with the container runtime (or a CRI shim for the runtime) over Unix sockets using the gRPC framework, where kubelet acts as a client and the CRI shim as the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*qyCffDLOsX7UPc9rZgVs6g.png" /></figure><p>There are container runtime/engines like Docker, <a href="https://github.com/rkt/rkt">RKT</a> , <a href="https://cri-o.io/">CRI-O</a>, <a href="https://containerd.io/">containerd</a>. But still Docker is the default runtime for K8s till v1.23 and CRI is still under Alpha.</p><p>Starting from K8s 1.24, docker-shim is deprecated, means you can’t use Docker engine starting from v1.24 of K8s. So what’s next ?</p><p>For your local docker build and docker run you can use Docker engine. Also in your DevOps pipeline you can use Docker engine. But in actual kubernetes cluster, you can’t use Docker are runtime starting K8s v1.24.</p><p>There is a company called mirantis, who said it will maintain dockershim for kubernetes along with support from Docker. This OpenSource project will keep dockershim alive. <a href="https://github.com/Mirantis/cri-dockerd">https://github.com/Mirantis/cri-dockerd</a></p><p>If you are confused with, what is docker-shim, then docker-shim is a module in kubernetes which allows kubernetes to support docker runtime as container engine. But now kubernetes is removing that module from v1.24. So you need to either install cri-dockerd by your-self or use other engine like RKT or CRI-O.</p><h3>#7 Node affinity and anti-affinity</h3><p>Remember, life is easy until we have just 2~3 worker nodes. Once we will scale to 10 or 20 worker nodes and you are dealing with distributed app deployment then node affinity is very vital.</p><p>Do we really need to control pod schedule to particular nodes? well, the answer is YES.</p><ul><li>The special type of hardware requirement for specific pods. Imagine a situation where we have a powerful computing worker node with GPU and SSD. You want your Machine learning intensive pods to be scheduled on those high-power nodes. Or a pod responsible for high CPU/GPU computation like game engine. Also non ML pods not be scheduled to those Nodes. In that case you need Node affinity and anti affinity.</li><li>You want to deploy your kafka brokers in all available Availability zones on AWS for HA and fault-tolerant. Imagine a situation, where you are running 5 nodes on AWS AZ-1 and 5 nodes on AZ-2, you want 5 replication factors of your Kafka broker pods. There might be a case that, all those 5 pods will be scheduled on AZ-1 5 nodes and nothing will be scheduled on AZ-2. So even if you have an Availability zone setup, but due to the wrong strategy, your HA will fail in case of AZ-1 failure from the AWS side.</li></ul><p>How many ways we can do this</p><ol><li>Node selector ( easy but old way, define a key-value on node and pods should have that key-value in pod spec )</li><li>node affinity and pod affinity (This is the ability of pod to choose)</li><li>Taints and Toleration (This is the ability of nodes to reject pods )</li></ol><p>Node Selector way:</p><pre>kubectl label nodes node-abcd-name workerType=ssdgpu<br><br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: nginx<br>  labels:<br>    env: test<br>spec:<br>  containers:<br>  - name: nginx<br>    image: nginx<br>    imagePullPolicy: IfNotPresent<br>  nodeSelector:<br>    workerType: ssdgpu</pre><p>So first we assign a custom key/value pair to worker node. Here we assigned as workerType as ssdgpu. Then in our Pod definition, we said, it should select worker having label as workerType = ssdgpu.</p><p>Node affinity (new way)</p><p>While defining pod Spec in YAML, you need to include nodeAffinity and shortly there are 2 types of affinity rule, 1st one is hard, if that doesn’t match then pod will not be scheduled to any worker nodes. soft affinity is like, this can be ignored by K8s scheduler if it doesn’t matches.</p><ol><li>requiredDuringSchedulingIgnoredDuringExecution (hard rule)</li><li>preferredDuringSchedulingIgnoredDuringExecution. (soft rule)</li><li>requiredDuringSchedulingRequiredDuringExecution (hard rule)</li></ol><pre>spec<br>  affinity:<br>    nodeAffinity:<br>      requiredDuringSchedulingIgnoredDuringExecution:<br>        nodeSelectorTerms:<br>        - matchExpressions:<br>          - key: az-name<br>            operator: In<br>            values:<br>            - az1<br>            - az2<br>      preferredDuringSchedulingIgnoredDuringExecution:<br>      - weight: 1<br>        preference:<br>          matchExpressions:<br>          - key: worker-hardware-type<br>            operator: In<br>            values:<br>            - ssd-gpu</pre><p>In the above example you can see, i am asking pod to be scheduled in availability az1 or az-2. It should be not scheduled to any other availability zone like az3 or az4. This was hard rule.</p><p>In the soft part i am asking to prefer worknode of type ssd-gpu with hard rule as either az1/az2.</p><p>Taints and Toleration:</p><p>This is bit advanced way of node selection, usually this is not widely followed.</p><pre>$ kubectl taint nodes node1 key1=value1:NoSchedule</pre><pre>tolerations<br>- key: &quot;key1&quot;<br>  operator: &quot;Equal&quot;<br>  value: &quot;value1&quot;<br>  effect: &quot;NoSchedule&quot;:</pre><p>First you need to configure worker node with the taint with key-value pair. This can simply done using kubectl command. Then in the pod spec you have to define the toleration. Any pod matching toleration of the node’s taint, then pod will be scheduled. One worker node can have multiple taints and any pod wants to be scheduled in that worker node, they have to match all the taints as part of tolerations spec.</p><p>Where to ask K8s questions:</p><p><a href="https://discuss.kubernetes.io/">https://discuss.kubernetes.io/</a> and of-course stack overflow.</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d0ba25d5f74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/kubernetes-things-you-should-know-1d0ba25d5f74">Kubernetes — Things you should know</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook in Visual Studio Code]]></title>
            <link>https://medium.com/data-science/jupyter-notebook-in-visual-studio-code-3fc21a36fe43?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fc21a36fe43</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 13 Oct 2019 20:32:43 GMT</pubDate>
            <atom:updated>2019-10-13T20:32:43.880Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to use Microsoft Visual Studio Code as your Data Science tool</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkxMr0bjfYUHS0nGqQtX8A.png" /></figure><p>People who work in Python, they love to do their research and experiments in Jupyter Notebook. I am a fan of desktop IDE like Visual Studio Code (VS Code) and Sublime. Visual Studio Code is a World Class tool to Program in any language. Not just Program it supports many DevOps tools like Ansible, Kubernetes, Yaml and many more.</p><p>Most Data Scientists around the globe use Jupyter Notebook as an editor for Machine Learning Development, Research and Experiment. Jupyter Notebook Supports Python, Java, R, Julia, Matlab, Octave, Scheme, Processing, Scala, and many more. Its an editor and to be precise its a web-based editor designed for python and other Programming Languages. Previously Jupyter notebook was known as iPython. It’s open Source, everyone around the globe uses it.</p><p>Microsoft Officially announces native support of Jupyter Notebook in Visual Studio Code by installing Official Python Extension.</p><h4><strong>How to use Jupyter Notebook in Visual Studio Code</strong></h4><p>Download and install the latest version of Visual Studio Code IDE <a href="https://code.visualstudio.com/download">https://code.visualstudio.com/download</a></p><p>Install <strong>Python</strong> and <a href="https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode"><strong>IntelliCode</strong></a> Extension in Visual Studio and restart. Goto extension section (left side menu) and search for the extension.</p><p>Note- In-case your Visual Studio Code Editor - Python extension is installed. You can update your old Python Extension by clicking on the Update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbLBFdQb6a7fUWEpKMBMlA.png" /></figure><h4>How to use Jupyter Notebook in Visual Studio Code</h4><p><strong>Create New Notebook in VS Code: </strong>shortcut CTRL + SHIFT + P (Windows) or Command + SHIFT + P (macOS), and run the “Python: Create Blank New Jupyter Notebook” command.</p><p><strong>Open existing Notebook in VS Code: </strong>After restarting VS Code IDE, Open Jypyter Notebook file (.ipynb file) from the file menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*ALTJ870yKejKiPBhQ-g7kA.png" /></figure><p>Click on the Play button present in the left side of each cell to execute code present in cell.</p><p>When a Jupyter notebook file is created or opened, VS Code automatically creates a Jupyter server for you locally by default.</p><p>If you want to use a remote Jupyter server — it’s as simple as using the “Specify Jupyter server URI” command via the VS Code command palette, and entering in the server URI. Shortcut CTRL + SHIFT + P (Windows) or Command + SHIFT + P (macOS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*lfFDsphQrQ0UDMVotBIWXA.png" /></figure><p>The way you use Python packages in Jupyter Notebook, you can use all your python packages and you will get in-place results (cell result). For example, I have used matplotlib and getting my graph output in-place the same as Jupyter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*SsEh_UZfizT8MJxH6z65SA.png" /></figure><p><strong>Debug Jupyter Notebook code in Visual Studio Code: </strong>Currently, to debug a Jupyter Notebook you will need to first export it as a Python file. Once exported as a Python file, the Visual Studio Code debugger lets you step through your code, set breakpoints, examine state, and analyze problems. Using the debugger is a helpful way to find and correct issues in notebook code.</p><ul><li>For the whole Notebook, open the Command Palette (⇧⌘P) and run the Python: Debug Current File in Python Interactive Window command.</li><li>For an individual cell, use the Debug Cell adornment that appears above the cell. The debugger specifically starts on the code in that cell. By default, Debug Cell just steps into user code. If you want to step into non-user code, you need to uncheck Data Science: Debug Just My Code in the Python extension settings (⌘,).</li></ul><h4><strong>The best feature in Visual Studio Code — beyond Jupyter Notebook</strong></h4><p><strong>Intelligent code Autocomplete:</strong> As you write code, IntelliSense will give you intelligent code complete suggestions right inside your code cells. You can further supercharge your editor experience by installing our <a href="https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode">IntelliCode extension</a> to get AI-powered IntelliSense with smarter auto-complete suggestions based on your current code context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*BpTC2OlUV64CraP_d38teA.gif" /><figcaption>Microsoft</figcaption></figure><p><strong>Variable Explorer: </strong>Another benefit of using VS Code is that you can take advantage of the variable explorer and plot viewer by clicking the “Variables” button in the notebook toolbar. The variable explorer will help you keep track of the current state of your notebook variables at a glance, in real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*YdDr2PVFMlzI6BdwuIDQzg.gif" /><figcaption>Microsoft</figcaption></figure><p>Happy Coding !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fc21a36fe43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/jupyter-notebook-in-visual-studio-code-3fc21a36fe43">Jupyter Notebook in Visual Studio Code</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Chatbot using Rasa Part-1]]></title>
            <link>https://medium.com/data-science/create-chatbot-using-rasa-part-1-67f68e89ddad?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f68e89ddad</guid>
            <category><![CDATA[rasa-nlu]]></category>
            <category><![CDATA[ds-in-the-real-world]]></category>
            <category><![CDATA[rasa-core]]></category>
            <category><![CDATA[rasa]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Tue, 27 Aug 2019 19:07:20 GMT</pubDate>
            <atom:updated>2019-09-13T04:19:58.430Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/towards-data-science/data-science-in-the-real-world/home"><strong>Data Science in the Real World</strong></a></h4><h4>Setup and Run your first Rasa Bot. Understand Rasa Framework.</h4><p><strong>Rasa</strong> is an open source machine learning framework for building <a href="http://blog.rasa.com/level-3-contextual-assistants-beyond-answering-simple-questions/">AI assistants and chatbots</a>. Mostly you don’t need any programming language experience to work in Rasa. Although there is something called “<strong>Rasa</strong> <strong>Action Server</strong>” where you need to write code in Python, that mainly used to trigger External actions like Calling Google API or REST API etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bs0JvC6bmiwrC7we49-tjw.png" /><figcaption>rasa.com</figcaption></figure><p>Rasa has two main modules:</p><ol><li><strong>Rasa NLU</strong> for understanding user messages</li><li><strong>Rasa Core</strong> for holding conversations and deciding what to do next</li></ol><p>Note — Now Rasa NLU and Rasa Core source code are merged together.</p><p><strong>Rasa X</strong> is a tool that helps you build, improve, and deploy AI Assistants that are powered by the Rasa framework. Rasa X includes a user interface and a REST API. Rasa X is the latest release from Rasa.</p><p>About me: I am official Rasa Contributor.</p><h3>Rasa Component</h3><p><strong>Rasa X</strong> — It’s a Browser based GUI tool which will allow you to train Machine learning model by using GUI based interactive mode. Remember it’s an optional tool in Rasa Software Stack. Sometimes Rasa sends usage statistics information from your browser to rasa — <em>but it never sends training data to outside of your system</em>, <em>it just sends how many times you are using Rasa X Train.</em></p><p><strong>Rasa NLU</strong> — This is the place, where rasa tries to understand User messages to detect <strong>Intent</strong> and <strong>Entity</strong> in your message. Rasa NLU has different components for recognizing intents and entities, most of which have some additional dependencies.</p><ol><li>Spacy (You need to install it separately)</li><li>Tensorflow (By Default available with Rasa)</li></ol><p><strong>Rasa Core </strong>— This is the place, where Rasa try to help you with contextual message flow. Based on User message, it can predict dialogue as a reply and can trigger Rasa Action Server.</p><p>Rasa internally uses Tensorflow, whenever you do “<strong>pip install rasa</strong>” or “<strong>pip install rasa-x</strong>”, by default it installs Tensorflow.</p><h3>Install Rasa</h3><p>Ubuntu 16+, Mac OS and Windows 10 (Visual C++ Build tool)</p><p><strong>Note:</strong> In case you are working on windows, make sure you have installed the Visual c++ build tool. This is required for some python packages. Definitely use miniconda to avoid the issue with other installed Python packages in your system or conflicting Python Version.</p><p>Install MiniConda (Part of Anaconda) in your OS</p><p><a href="https://conda.io/miniconda.html">Miniconda - Conda documentation</a></p><p>After installing miniconda, Follow below commands to create a virtual environment in conda. This will allow you to run Rasa without errors.</p><pre>conda install python=3.6<br>conda create -n rasa python=3.6<br>source activate rasa<br>pip install rasa-x --extra-index-url <a href="https://pypi.rasa.com/simple">https://pypi.rasa.com/simple</a></pre><p>By following the above command, both Rasa and Rasa X will be installed in your system.</p><h3>Create a new Project in Rasa</h3><p>Open Terminal and activate Conda Virtual Environment. Now go-to one directory and do “<strong>rasa init</strong>”, it will create a Rasa Project at that location. “rasa x” will start the Rasa X application</p><pre>source activate rasa<br>rasa init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*utF-_Wg_pG5FbVdE-kF9Rg.png" /></figure><p>“<strong>rasa init</strong>” should show above message, in-case you are doing well and your system doesn’t contain any error. Follow the interactive session and continue pressing enter to reach the last step. In the end, it should show this message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*VJTEnUK-1Bz704RKwHwytw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*fdRU_-kBfoJc-I4Ts2xA-g.png" /></figure><p>If you do “<strong>ls -la</strong>” in a terminal, you can see a list of files which are created by Rasa. Now do “rasa x” to start Rasa.</p><h3>Rasa Configuration</h3><p>Let me explain about files, which are created as Initial project structure of Rasa.</p><p>__init__.pyan empty file that helps python find your actions</p><p>actions.pycode for your custom actions. In-case you want Rasa to call external server via REST API or API call, you can define your Custom Actions here. Remember you can create multiple Python Script for Rasa Custom Action.</p><p>config.yml ‘*’configuration of your NLU and Core models. In-case you are dealing with Tensorflow or Spacy, you need to define such pipeline here. To handle this file, you show know about Machine Learning and Deep Learning.</p><p>credentials.ymldetails for connecting to other services. In case you want to build Bot on Facebook Messenger, Microsoft Bot Framework, you can maintain such credential and token here. So basically you just need to add Facebook, slack and Bot framework related configuration, rasa will automatically do rest for you. Remember that you need to host Rasa over https domain. During development, you can use <strong>ngrok</strong> as a testing tool.</p><p>data/nlu.md ‘*’your NLU training data. Here you can define Intent. Like Order Pizza or Book Uber. You need to add related Sentences for that Intent. Remember if you are using Rasa-X, your training Intent and Data will be added automatically.</p><p>data/stories.md ‘*’your stories. This is required for Rasa Core. There is something called “Dialog Flow in Rasa” where Rasa Core controls the flow of the conversation between you and chatbot, so for that flow, you need to train chatbot using these stories. So in case you want your chatbot to be very perfect on different context (stories) you can add those stories here.</p><p>domain.yml ‘*’your assistant’s domain. This file combines Different Intent which chatbot can detect and list of Bot replies. Remember you can define your Custom Action Server Python method name here (in underscore format), so that Rasa will call that python method for you.</p><p>endpoints.ymldetails for connecting to channels like FB messenger. This is mainly used for production setup. You can configure your Database like Redis so that Rasa can store tracking information.</p><p>models/&lt;timestamp&gt;.tar.gzyour initial model</p><h3>Play with Sample Chatbot</h3><p>Rasa created a sample Bot for you with default data. So now you can start using it from Shell/Terminal. As a starting point let’s test your Chatbot from a terminal (remember to do this in Terminal)</p><pre>rasa shell</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMhoAe4_86l4zoeY70GqsQ.png" /></figure><p>You can type “hi” and in reply from bot, you will receive some response.</p><h3>How to use Rasa-X</h3><p>This is the newest addition to Rasa Stack. You can user Rasa-X to Try your chatbot on Browser. You can download training Data. Also, you can correct your training data by guiding your Bot.</p><pre>rasa x</pre><p>It will ask for the license Agreement, you can say “y” and proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*fl8gnUqBonL1iA6QnZZNvg.png" /></figure><p>Open this link on Browser — <a href="http://localhost:5002/talk">http://localhost:5002/talk</a></p><p>In the left side, you can try to chat with your bot and on the right side you can see, which intent and reply is getting responded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TeFWZIIW7EU8OXuSiSAb_g.png" /></figure><p><strong>Some facts about Rasa-x</strong></p><p>When you run Rasa X locally, your training data and stories are read from the files in your project (e.g. data/nlu.md), and any changes you make in the UI are saved back to those files. Conversations and other data are stored in an SQLite database saved in a file called rasa.db.</p><p>Watch this video to learn more about Rasa-X</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVXvWdrr2yw8&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVXvWdrr2yw8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVXvWdrr2yw8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1094ff132c5c55ba87ddf60335518d10/href">https://medium.com/media/1094ff132c5c55ba87ddf60335518d10/href</a></iframe><h3>How to use Rasa Custom Action (Action Server)</h3><p>This is the most real-world example of your chatbot. Suppose in your chatbot you want to add a feature where your bot can tell you latest weather report of a specified city, how you will do it? The answer is “Rasa Custom Action”</p><p>An action can run any code you want. Custom actions can turn on the lights, add an event to a calendar, check a user’s bank balance, or anything else you can imagine.</p><p>Rasa will call an endpoint you can specify when a custom action is predicted. This endpoint should be a web server that reacts to this call, runs the code and optionally returns information to modify the dialogue state.</p><p>Open “<strong>actions.py</strong>” in Editor (Visual Studio Code can be an option)</p><p><strong>Step-1 — </strong>Define a Method called “<strong>ActionCheckWeather” </strong>in “actions.py”</p><pre><strong>from</strong> <strong>rasa_sdk</strong> <strong>import</strong> Action<br><strong>from</strong> <strong>rasa_sdk.events</strong> <strong>import</strong> SlotSet<br><br><strong>class</strong> <strong>ActionCheckWeather</strong>(Action):<br>   <strong>def</strong> name(self) -&gt; Text:<br>      <strong>return</strong> &quot;action_check_weather&quot;<br><br>   <strong>def</strong> run(self,<br>           dispatcher: CollectingDispatcher,<br>           tracker: Tracker,<br>           domain: Dict[Text, Any]) -&gt; List[Dict[Text, Any]]:<br><br>      dispatcher.utter_message(&quot;Hello World! from custom action&quot;)</pre><pre><strong>      return</strong> []</pre><p>Step-2 — Link this custom action with your Chatbot. Open “domain.yml”.</p><p>Add “action_check_weather” action in the list of the action. This should look like this</p><pre>actions:</pre><pre>- utter_greet</pre><pre>- utter_cheer_up</pre><pre>- utter_did_that_help</pre><pre>- utter_happy</pre><pre>- utter_goodbye</pre><pre>- <strong>action_check_weather</strong></pre><p>Now in the stories, add this custom action as your flow. Open “<strong>stories.md</strong>” file and this new custom action “action_check_weather” as part of happy path flow.</p><pre><strong>## happy path</strong></pre><pre>* greet</pre><pre>- utter_greet</pre><pre>* mood_great</pre><pre>- action_check_weather</pre><p>Step-3 Tell rasa to use Custom Action Server</p><p>Open “endpoints.yml” and add the following line to enable custom action server</p><pre>action_endpoint:</pre><pre>   url: &quot;http://localhost:5055/webhook&quot;</pre><p>Now Re-train your Rasa Chatbot using following command. You need to retrain your machine learning model because you made some changes in “stories.md” and “domain.yml” file. So without re-train, you can’t inform Rasa to use those.</p><pre>rasa train</pre><p>Now start Rasa again using</p><pre>rasa x</pre><p>Also, start Rasa Action server using the following command. Rasa X and Rasa run actions should run in 2 different terminals.</p><pre>rasa run actions</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*AUFQObM_j2Wct6gLZ3mtnQ.png" /></figure><p>You can see, you are getting a reply from custom action which is written in python. In the same python script, you can connect to your backend database and return a response. Also, you can call an external API using additional python packages.</p><p>Also, you can develop Custom action Server in C#, NodeJS and Java.</p><h3>How to build Custom Frontend for Chatbot</h3><p>You can build a Chatbot GUI using HTML5 and CSS3. You can use the Library like ReactJS and JQuery. If you want you can use Angular as your frontend JavaScript framework to build Frontend for your Chatbot.</p><ol><li>Build GUI in HTML5 and CSS3</li><li>Call Rasa Rest API from your frontend</li><li>That’s it</li></ol><p>Sample API call from JavaScript to Rasa Backend</p><p>As we are heading towards building production-grade Rasa Chatbot setup, the first thing we can simply use the following command to start Rasa.</p><pre>rasa run</pre><p>Above command will run Rasa Core and Expose REST API on port 5005.</p><pre>URL: <a href="http://localhost:5005/webhooks/rest/webhook">http://localhost:5005/webhooks/rest/webhook</a><br>Method: POST<br>Header: Content-Type: application/json<br>Body:<br>{<br> “sender”: “Rasa1”,<br> “message”: “hi”<br>}</pre><pre>Response:<br>[<br>    {<br>       “recipient_id”: “Rasa1”,<br>       “text”: “Hey! How are you?”<br>    }<br>]</pre><p>Now you can parse this response in your frontend application and show this response to the user. Remember Rasa will track your conversation based on a unique id called “Rasa1” which we have passed in the Request body.</p><p><strong>In the next part of this Article, we will learn about</strong></p><ol><li>Rasa Slot</li><li>Rasa Using Docker</li><li>Rasa-X advance</li><li>Rasa Production Deployment</li></ol><p>You can get Entire Code from my Github</p><p><a href="https://github.com/bikashkumars/rasa">bikashkumars/rasa</a></p><p>Happy Rasa and Happy Machine learning — Readers. !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67f68e89ddad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/create-chatbot-using-rasa-part-1-67f68e89ddad">Create Chatbot using Rasa Part-1</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neural Network Beginners Guide Part1]]></title>
            <link>https://medium.com/@bikashkumars/neural-network-beginners-guide-part1-2bd690b50bac?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bd690b50bac</guid>
            <category><![CDATA[recurrent-neural-network]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[convolution-neural-net]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 14 Apr 2019 06:44:38 GMT</pubDate>
            <atom:updated>2019-04-14T06:53:51.254Z</atom:updated>
            <content:encoded><![CDATA[<p>Neural networks are made up of connected nodes (Neuron), which data passes through. A node combines data sent to it from other nodes, then outputs the combined data to nodes further down the neural network. Nodes are contained in layers. Neural networks have an input layer (our features) and an output layer (our labels). Where neural networks differ is what is in between the input and output layers — hidden layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsktoyIohkvrUW7diAiRMw.png" /></figure><p>There are 3 major class (Type) of Neural Network</p><ol><li>CNN</li><li>RNN</li><li>GAN</li></ol><h4>CNN (Convolutional neural networks)</h4><p>Convolutional neural networks (CNNs) are a class of deep neural networks, mostly used in computer vision and Image Processing applications.</p><p>Convolutional refers to the network pre-processing data for you. This task was traditionally programmed by data scientists. The neural network can learn how to do pre-processing, applying filters for things such as edge detection.</p><p>Softmax is an activation function used in neural networks. CNNs commonly use softmax in the final layers of a classification model because softmax outputs probabilities for multiple classes. This has proven to be quite successful for multiclass classifications using CNNs and other deep neural networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgJuGgBVuGZGwVDgbafC8w.png" /></figure><p>Example where we can use CNN</p><ol><li>Face Detection in an Image and Video</li><li>Object Detection in an Image and Video</li><li>Speech Detection</li></ol><h4>RNN (Recurrent neural network)</h4><p>Some problems may require us to look at recent data to help perform current analysis — such as analysis of connected handwriting.</p><p>A recurrent neural network (RNN) is a class of neural network that excels when your data can be treated as a sequence — such as text, music, speech recognition, connected handwriting, or data over a time period.</p><p>An RNN can analyse or predict a word based on the previous words in a sentence — they allow a connection between previous information and current information. They are neural networks with loops, allowing data to be temporarily stored to help with later analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDIexLnIDNPxKW3P5fQXOA.png" /></figure><p>RNNs contain cells — where additional state can be stored. This is useful because the RNN can remember important information used for predictions — such as past tense. If early on in a sentence a user has written “We were going to”, an RNN can remember that the word were is in the past tense inside a unit, so it may output “We were going to fly to Canada” instead of “We were going to flew to Canada.”</p><p>Standard RNNs struggle when there is a large gap between previous data which is relevant and current data. To solve this problem AI practitioners commonly use two similar types of RNNs — long short-term memory networks (LSTM), and gated recurrent unit networks (GRU).</p><ol><li>Text Analysis</li><li>NLP</li><li>Music Analysis</li><li>Speech Detection</li><li>Language translation</li></ol><p>There are 2 sub class of RNN</p><ol><li>LSTM</li></ol><p>2. GRU</p><p>I will add more content to Part-1. Part-2 we will run some hello world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bd690b50bac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible — IT Automation Part-2]]></title>
            <link>https://faun.pub/ansible-it-automation-part-2-97ff727c0885?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/97ff727c0885</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Tue, 22 Jan 2019 14:16:43 GMT</pubDate>
            <atom:updated>2019-07-18T15:42:52.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ansible — IT Automation Part-2</h3><p><strong>First Thing First:</strong> In the part-1 of this series, we have covered basic understanding of Ansible Architecture, installation and Writing first playbook. Now we will talk more about advanced topic on Ansible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*xjkkeiGPSCk9HlBPlqAcuA.png" /><figcaption>Image Creator — Bikash Sundaray</figcaption></figure><p>In-case you have missed my first part of Ansible Series, please click on below link to read it.</p><p><a href="https://medium.com/@bikashkumars/ansible-it-automation-part-1-e889d3c13cd4">Ansible — IT Automation Part-1</a></p><p>Already we know, Ansible takes Playbook and Inventory as input and does the automation for us over SSH. Ansible provides out-of-box modules, which makes our life easy.</p><h4>What is Ansible module</h4><p>Ansible module are also called as “<strong>Task Plugins</strong>”. Remember “<strong>Task</strong>” are files in Ansible where we write out automation script.</p><p><em>Do you remember this file “main.yml” of part-1 of this Ansible series</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*36nHzgg9Tat3NTyOIl07MA.png" /></figure><p>“<strong>main.yml</strong>” is the task file in Ansible where we are going to use Ansible modules (In-built plugins).</p><pre>/roles/software/tasks/main.yml</pre><p>Note: All modules technically return JSON format data, though if you are using the command line or playbooks, you don’t really need to know much about that. If you’re writing your own module, you care, and this means you do not have to write modules in any particular language — you get to choose.</p><h4>Most important Ansible Modules ( plugins )</h4><ul><li>Cloud modules</li><li>Commands modules</li><li>Crypto modules</li><li>Database modules</li><li>Files modules</li><li>Monitoring modules</li><li>Net Tools modules</li><li>Packaging modules</li><li>Source Control modules</li><li>System modules</li><li>Utilities modules</li><li>Web Infrastructure modules</li></ul><h4>How to install Ansible Modules</h4><p>By default all modules are installed and available to you. No need to install anything extra to use above modules.</p><h4>Let’s talk about 2 Ansible Modules</h4><p><em>From my personal experience, if you will learn these 2 Ansible modules, you will able to make your 80% of your automation.</em></p><p>“<strong>Commands modules</strong>” and “<strong>files Modules</strong>” are the most common module used in Ansible. Why ? Because Every automation requires some command/Shell script needs to be executed. Every automation requires preconfigured files (JSON, XML, Shell Script or Software etc).</p><p>Let’s see without Ansible, how we do things as Human</p><pre>$ bikash@ubuntu sudo su</pre><pre>$ Entered Root Password ******</pre><pre>$ root@ubuntu:  cp server.conf /var/lib/azure/server.conf</pre><pre>$ root@ubuntu: chmod 0550 /var/lib/azure/server.conf</pre><pre>$ root@ubuntu:  bikash:group /var/lib/azure/server.conf</pre><p>Through above command, i am doing following</p><p>Logged-in to Linux Terminal as “bikash” user, then i switch user to “root”. Then OS asks for password, i enters root password. Then using “cp” command i was trying copy one file called “server.conf” to “/var/lib/azure” path. Changing file permission to “0550”. Then i am making “bikash” user as owner of the file “server.conf”</p><p>Let’s see how to do same thing using Ansible</p><pre>- name: Copy file and make user as owner</pre><pre>copy:</pre><pre>     src: server.conf</pre><pre>     dest: /var/lib/azure/</pre><pre>     owner: bikash</pre><pre>     group: group</pre><pre>     mode: 0550</pre><p>In above example, we have used “Copy” command of Ansible which is coming under “files modules” of Ansible. Where we have feed data to different attributes of copy command (src, dest, owner, group and mode). Rest Ansible will do the job for us.</p><p><strong>Let’s talk about “Files Modules” of Ansible</strong></p><ul><li><a href="https://docs.ansible.com/ansible/latest/modules/archive_module.html#archive-module">archive — Creates a compressed archive of one or more files or trees</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/copy_module.html#copy-module">copy — Copies files to remote locations</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/file_module.html#file-module">file — Sets attributes of files</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/find_module.html#find-module">find — Return a list of files based on specific criteria</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/synchronize_module.html#synchronize-module">synchronize — A wrapper around rsync to make common tasks in your playbooks quick and easy.</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/xml_module.html#xml-module">xml — Manage bits and pieces of XML files or strings</a></li></ul><p>Best Examples of <strong>Files modules</strong> Usage</p><pre><strong># Zip and Compress file<br>-</strong> name<strong>:</strong> Compress directory /path/to/foo/ into /path/to/foo.tgz<br>  archive<strong>:</strong><br>    path<strong>:</strong> /path/to/foo<br>    dest<strong>:</strong> /path/to/foo.tgz</pre><pre><strong>-</strong> name<strong>:</strong> Create a zip archive of /path/to/foo<br>  archive<strong>:</strong><br>    path<strong>:</strong> /path/to/foo<br>    format<strong>:</strong> zip</pre><pre><strong>#Copy usage<br>-</strong> name<strong>:</strong> Copy a new &quot;ntp.conf file into place, backing up the original if it differs from the copied version<br>  copy<strong>:</strong><br>    src<strong>:</strong> /mine/ntp.conf<br>    dest<strong>:</strong> /etc/ntp.conf<br>    owner<strong>:</strong> root<br>    group<strong>:</strong> root<br>    mode<strong>:</strong> 0644</pre><pre><strong>#Change Ownership of a file/directory</strong><br><strong>-</strong> file<strong>:</strong><br>    path<strong>:</strong> /etc/foo.conf<br>    owner<strong>:</strong> foo<br>    group<strong>:</strong> foo<br>    mode<strong>:</strong> 0644</pre><pre><strong># find operation</strong><br><strong>-</strong> name<strong>:</strong> Recursively find /tmp files older than 2 days<br>  find<strong>:</strong><br>    paths<strong>:</strong> /tmp<br>    age<strong>:</strong> 2d<br>    recurse<strong>:</strong> yes</pre><pre><strong># In-case you want to sync files from host to remote</strong><br><strong>-</strong> name<strong>:</strong> Synchronization of src on the control machine to dest on the remote hosts<br>  synchronize<strong>:</strong><br>    src<strong>:</strong> some/relative/path<br>    dest<strong>:</strong> /some/absolute/path<br><br><strong>-</strong> name<strong>:</strong> Synchronization using rsync protocol (push)<br>  synchronize<strong>:</strong><br>    src<strong>:</strong> some/relative/path/<br>    dest<strong>:</strong> rsync://somehost.com/path/<br><br><strong>-</strong> name<strong>:</strong> Synchronization using rsync protocol (pull)<br>  synchronize<strong>:</strong><br>    mode<strong>:</strong> pull<br>    src<strong>:</strong> rsync://somehost.com/path/<br>    dest<strong>:</strong> /some/absolute/path/</pre><p><strong>Commands modules</strong> <strong>Let’s talk about “Commands Modules” of Ansible</strong></p><p>2 most used feature of Command modules are “command” and “shell”. Both does the same thing, to execute linux command on remote server. Shell support shell script and command doesn’t supports that.</p><p>Following are the important features coming under “Commands Module”</p><ul><li><a href="https://docs.ansible.com/ansible/latest/modules/command_module.html#command-module">command — Executes a command on a remote node</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/expect_module.html#expect-module">expect — Executes a command and responds to prompts.</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/script_module.html#script-module">script — Runs a local script on a remote node after transferring it</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/shell_module.html#shell-module">shell — Execute commands in nodes.</a></li><li><a href="https://docs.ansible.com/ansible/latest/modules/telnet_module.html#telnet-module">telnet — Executes a low-down and dirty telnet command</a></li></ul><p>Best Examples of <strong>Commands modules</strong> Usage</p><pre><strong>#command usage<br>-</strong> name<strong>:</strong> Run the command if the specified file does not exist.<br>  command<strong>:</strong> /usr/bin/make_database.sh arg1 arg2<br>  args<strong>:</strong><br>    creates<strong>:</strong> /path/to/database</pre><pre><strong>-</strong> name<strong>:</strong> This command will change the working directory to somedir/ and will only run when /path/to/database doesn&#39;t exist.<br>  command<strong>:</strong> /usr/bin/make_database.sh arg1 arg2<br>  args<strong>:</strong><br>    chdir<strong>:</strong> somedir/<br>    creates<strong>:</strong> /path/to/database</pre><pre><strong>#shell usage</strong><br><strong>-</strong> name<strong>:</strong> Execute the command in remote shell; stdout goes to the specified file on the remote.<br>  shell<strong>:</strong> somescript.sh &gt;&gt; somelog.txt<br><br><strong>-</strong> name<strong>:</strong> Change the working directory to somedir/ before executing the command.<br>  shell<strong>:</strong> somescript.sh &gt;&gt; somelog.txt<br>  args<strong>:</strong><br>    chdir<strong>:</strong> somedir/<br><br><strong><em># You can also use the &#39;args&#39; form to provide the options.</em></strong><br><strong>-</strong> name<strong>:</strong> This command will change the working directory to somedir/ and will only run when somedir/somelog.txt doesn&#39;t exist.<br>  shell<strong>:</strong> somescript.sh &gt;&gt; somelog.txt<br>  args<strong>:</strong><br>    chdir<strong>:</strong> somedir/<br>    creates<strong>:</strong> somelog.txt</pre><pre><strong># Execute shell script on Remote server by coping from local</strong><br><strong>-</strong> name<strong>:</strong> Run a script with arguments<br>  script<strong>:</strong> /some/local/script.sh --some-argument 1234<br><br><strong>-</strong> name<strong>:</strong> Run a script only if file.txt does not exist on the remote node<br>  script<strong>:</strong> /some/local/create_file.sh --some-argument 1234<br>  args<strong>:</strong><br>    creates<strong>:</strong> /the/created/file.txt</pre><p>In the next article we will talk about cloud module. We will see how to automate your Azure, Google Cloud and AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Join our community Slack and read our weekly Faun topics ⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97ff727c0885" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/ansible-it-automation-part-2-97ff727c0885">Ansible — IT Automation Part-2</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible — IT Automation Part-1]]></title>
            <link>https://faun.pub/ansible-it-automation-part-1-e889d3c13cd4?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/e889d3c13cd4</guid>
            <category><![CDATA[automation-tools]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sat, 29 Dec 2018 15:04:48 GMT</pubDate>
            <atom:updated>2019-07-17T20:33:11.129Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ansible — IT Automation Part-1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*gsip01SgHz6exfmtsI31fA.jpeg" /></figure><p><strong>First thing First: </strong>Ansible is a Configuration Management Tool from Redhat. It’s free and Open Source. Ansible allows you to automate your IT infrastructure starting from creating VM, Installing Software, Docker/Kubernetes Deployment and Configuring in VM through simple Configuration file (YAML). Ansible provides Different modules like file, database, cloud, inventory to install and configure your VM/Cluster. Think of cluster, you can configure you cluster and make it up-and running without any human touch. You don’t need any programming language knowledge to work with ansible. It is one of the keytool in <strong>DevOps</strong> ecosystem.</p><p>You can clone my Ansible Part-1 Repo, before reading further.</p><p><a href="https://github.com/bikashkumars/ansible-part-1">bikashkumars/ansible-part-1</a></p><h3><strong>About Ansible</strong></h3><p>Ansible is a universal language, unraveling the mystery of how work gets done. Turn tough tasks into repeatable playbooks. Roll out enterprise-wide protocols with the push of a button. Give your team the tools to automate, solve, and share.</p><p>You can automate anything — Infrastructure, Application-deployment, networks, Containers, Security-and-compliance and cloud</p><p>Alternate tools like puppet and chef are available. Which can replace Ansible. But each tool has got it’s own beauty. Ansible does its work like a pro. So it’s not worth to compare Ansible with Chef or Puppet.</p><p>Ansible works over SSH. You can Install Ansible in a Laptop, Desktop, Deployment server or CI-CD Pipe. It works every where. You need to make sure that the target Machine/Server is accessible over SSH. Ansible support all type of SSH authentication</p><ol><li>Username/Password Based SSH Auth</li></ol><p>2. Private/Public Key Based SSH Auth</p><p>3. Jump Box and Tunnel based SSH Auth</p><p>Note: Ansible do support other protocol other than SSH to communicate with Target Machine/Server.</p><p>In Ansible, you need to define your inventory (VM details), your playbook (Automation Script details) and that’s it. Ansible will do the automation for you over SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FVvyR5t_wz04dUvIvChZOg.jpeg" /></figure><h3><strong>Install Ansible:</strong></h3><h4>How to Install Ansible in Windows</h4><p>There is out-of-box support for Linux. But you will find it difficult to up-and-running in Windows.</p><p><strong><em>Windows 7/10</em></strong>: I have installed “cygwin” and able to install ansible in Cygwin. But it didn’t work properly. I would suggest to follow below path for Windows OS Ansible installation.</p><ol><li>Download and Install <a href="https://download.virtualbox.org/virtualbox/6.0.0/VirtualBox-6.0.0-127566-Win.exe">Virtualbox</a>.</li></ol><p>2. Download <a href="https://sourceforge.net/projects/osboxes/files/v/vb/55-U-u/16.04/16.04.5/1604564.7z/download">Ubuntu Image</a> for Virtualbox</p><p>3. Run Ubuntu under Virtualbox</p><p>4. Start Ubuntu</p><p>Continue reading this article, how to install configure Ansible in Ubuntu. You can follow same path for your Virtualbox Ubuntu Configuration.</p><h4>How to Install Ansible in Linux</h4><p>Ansible Can be installed in Ubuntu/CentOS/RHEL using Python. Expected Python 2.7 or above. By-default pip should be installed. If not, then use below command to install pip</p><p><strong>Note:</strong> Use “yum” for centos/RHEL and “apt” for Ubuntu OS.</p><pre>$ sudo apt get install python-pip<br>$ sudo yum install python-pip</pre><p>Use pip to install Ansible in linux</p><pre>$ sudo pip install ansible</pre><p><strong>Note:</strong> You can install Ansible through “apt” and “yum” command for ubuntu, centOS and RHEL. But i would recommend to install via python.</p><p>This is <strong>optional</strong> step to install Ansible via Linux Package Manager (without using python)</p><pre>sudo yum install ansible<br>sudo apt-get install ansible</pre><h3>How to use Ansible:</h3><p>I always follow standard practices. The best way to start working with Ansible is to follow correct folder structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*hxJgYTovwpgodaM_Ui6TnA.png" /></figure><p><strong>About Each Directory:</strong></p><p><strong>group_vars: </strong>is the folder which will contain variable with it’s value. Which you can use in your script. Variable can use username, password, software version, path or anything.</p><p><strong>inventories:</strong> Inventories are definition for your cluster, VMs or Nodes. You can define you IP address or Domain name for all your VMs. Also you can define your username for each VM. In-case you want to SSH using public key or password based Authentication or You are dealing with tunneling. Everything is getting managed here.</p><p>Before you continue further, i request you have already created above folder structure.</p><p><strong>Step-1: Inventory</strong></p><p>First define your VM details, this will tell Ansible, how to login to VM over SSH.</p><p>Inside inventories directory, create a inventory file called “my-vm.yml”. Then add following contents to it.</p><pre>inventory_name:<br>    hosts:<br>       192.168.2.2:<br>          ansible_connection: ssh<br>          ansible_user: username<br>          ansible_ssh_pass: password<br>          ansible_become: yes<br>          ansible_become_method: sudo</pre><p>Replace 192.168.2.2 with your VM ip address. Replace “ansible_user” and “ansible_ssh_pass” with your VM password.</p><p><strong>Step-2: Group Variable</strong></p><p>Create a sub directory called “all” under “group_vars” directory. Create a file with name of your choice. For example, we have created one file called myvar at following location. “myvar” don’t have any extension.</p><pre>group_vars/all/myvar</pre><p>Add following contents to it.</p><pre>vm_user_group: mygroup<br>vm_non_root_user: bikash</pre><p>We have created 2 variables. We are going to consume these variables in our script.</p><p><strong>Step-3: Roles</strong></p><p>This is the place where you define your automation. In-side your “roles” directory, create as many modules as you want. If you look at below screenshot, you can understand, in my case i have created 5 modules. For learning, you can create just one module like “software”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*vYepTfnjFN-qniMKN0GBLw.png" /></figure><p>Let’s see, what we have inside “software” directory or module. Ansible Rule have some pre-defined structure that we have to follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*ZzYOcyVVb-NbDsbT0-pRog.png" /></figure><p>There are 3 folders, files, handlers and tasks.</p><p><strong>files: </strong>Suppose your automation requires some file to be copied to VM or your Automation requires some software installation, which you want to install by copying from files directory to remote VM directory and start installing there.</p><p><strong>tasks: <em>TASK are the Ansible playbook. </em></strong>This is the main directory where you write your own automation script. Let’s create one Ansible playbook under following directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*FYJKw5Qle-KAXnHTRG2M3g.png" /></figure><pre>/roles/software/tasks/main.yml</pre><p>Add following content to “main.yml”.</p><pre>---<br># Software Installation and Configuration Script<br>- name: Install Software<br>  debug:<br>    msg: &quot;Task - Install Required Software&quot;</pre><pre>- name: Install Docker<br>  shell: |<br>    apt-cache policy docker-ce<br>    apt-get install -y docker-ce<br>    systemctl status docker<br>  become: yes<br>  become_method: sudo</pre><pre>- name: Copy Docker Compose Binary<br>  copy:<br>    src: docker-compose<br>    dest: /usr/local/bin/<br>    owner: &#39;{{ vm_non_root_user }}&#39;<br>    group: &#39;{{ vm_user_group }}&#39;<br>    mode: 0550</pre><pre>- name: Restart service Docker, in all cases<br>  service:<br>    name: docker<br>    state: restarted</pre><p>Above playbook contains 4 Ansible task. Each task start with “- name”. Even 3rd task is trying to copy one binary file called “docker-compose” from files folder of software module to remote VM. For your case, you can keep any text file and change in script accordingly.</p><p>Let me explain about a task, following is the syntax to create one Ansible task.</p><pre>- name: Ansible TASK NAME GOES HERE<br>  shell: |<br>    write your linux command 1 here<br>    write your linux command 2 here<br>  become: yes<br>  become_method: sudo</pre><p>Even you look at the task-3, we are using variables like {{ vm_non_root_user }} and {{ vm_user_group }} in this script, which is actually defined in group_vars ( Remember ? )</p><pre>- name: Copy Docker Compose Binary<br>  copy:<br>    src: docker-compose<br>    dest: /usr/local/bin/<br>    owner: &#39;{{ vm_non_root_user }}&#39;<br>    group: &#39;{{ vm_user_group }}&#39;<br>    mode: 0550</pre><p>Now we are at the last step of playbook creation, to manage roles execution order. In the root directory create a new yml file called “start.yml” and add following content.</p><pre>---<br>- hosts: all<br>  roles:<br>     - role: software</pre><p>You can see we have written role as “software” because our module name was “software” inside roles directory. Here we are using hosts as “all” so that script will be executed for all the host inside inventory file. Although at this moment we have only 1 host in our inventory file i.e. “inventory_name”.</p><p>Then run the playbook, like this:</p><pre>ansible-playbook -i inventory/my-vm.yml start.yml</pre><p>You can clone this Github repo to learn from different examples</p><p><a href="https://github.com/ansible/ansible-examples">https://github.com/ansible/ansible-examples</a></p><p>Wait for my next part, where we will discuss more about Tunneling in Ansible and Vault to store secrets.</p><p>Happy Automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Join our community Slack and read our weekly Faun topics ⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e889d3c13cd4" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/ansible-it-automation-part-1-e889d3c13cd4">Ansible — IT Automation Part-1</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phone Calling AI Bot]]></title>
            <link>https://medium.com/@bikashkumars/phone-calling-ai-bot-30a65bf809a1?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/30a65bf809a1</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[events]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[bhubaneswar]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 20:30:27 GMT</pubDate>
            <atom:updated>2018-11-14T20:44:08.505Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJc-VlXOX4Jdsw8gWjWS5A.png" /></figure><p><strong>Chatbots</strong> are Crazy these days. It&#39;s like everyone is talking about it and very few people out there, who actually knows how to build one.</p><p>About me: I believe in Innovation in the field of Computer science. I work on IoT, Machine Learning, Mobile Apps, DevOps, Frontend, Backend and AR/VR. I love to innovate and received tons of success. I am solving real world problem. So far i have developed patented solution for different companies. While i Code or Creating solution, i never look for shortcut, there is nothing call best. I analyze the customer problem and try to solve it simpler way. These days my focus is more toward AI and Big Data Analytics.</p><blockquote><em>Before i begin talking about “</em><strong><em>Phone Calling AI Bot</em></strong><em>” let me tell you one interesting story.</em></blockquote><p>Couple of months backs, i was travelling to my hometown. I remember, it was friday. I was in my mid-way to reach my home. Suddenly i got a call from my manager, he was asking me to fix a urgent DevOps Infrastructure issue. That time, i was working on DevOps. I open My laptop, Logged-In and Started debugging the issue (2 AM i remember). After 15 minutes of debugging i found logs related to Mysql Down. In that 15 minutes i struggled for internet for starting 5 minutes. Just re-started the mysql and everything UP. I have checked, i have received around 100 emails from different monitoring tools.</p><p>After few days, i have started thinking on few aspect. How i can improve my work culture and innovate something. I was thinking about.</p><ol><li>Without accessing Monitoring Tool Email, how i got to know about Infra Related issue.</li><li>Can i solve a infra problem (At Least common problem) without logged-In to my laptop.</li><li>How i can solve a problem without getting Alert from Tool</li><li>Can we automate common Infra/DevOps work ?</li><li>Can we solve a problem without even internet.</li></ol><p>I have started thinking about Chatbot. A Special Chatbot build for our infrastructure which can notify me - faster and allow me to solve a problem. Which i can access on my phone. Even solution should work without Internet.</p><p>A build a Chatbot which can Call any Phone number and speakout messages like a human being. This solves a problem of — no internet. Then i have done my research on Machine Learning and Deep learning which can parse log messages and decide the intent/reason of the log message. Developed a chatbot which can understand engine text message, parse it and derive the intent of the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*DZspg1JfMX59IcFU5Q0TLA.png" /></figure><p>I got an invitation from <a href="http://www.techbhubaneswar.com/">techBhubaneswar</a> — (Biggest Tech Conference happening this December in Bhubaneswar, Odisha). This is the 3rd edition of the event. I heard a lot about the past 2 year editions, it was super impressive. Very delighted to take part of Technical Speaker on “Phone Calling AI Bot”.</p><p>The entire session will be divided into 3 parts</p><p><strong>Part-1</strong></p><p>We will cover different concept involved to build one chatbot. Starting with Natural Language Processing, Natural Language Understanding. Python library</p><p>I will be showing, How using <a href="https://dialogflow.com/">dialogFlow</a> — Quickly you can build Chatbot Language Processing Engine. How you can utilize power of JavaScript and NodeJS to integrate <a href="https://dialogflow.com/">dialogFlow</a> and delivery a quick Chatbot Solution. In-case you are working for small budget customer, this solution is effective.</p><p><strong>Part-2</strong></p><p>I will take you through <a href="https://rasa.com/">Rasa</a> — How quickly you can build your chatbot in-house. Everything will be under your control. In-case you are working for enterprise customer, you should go for Rasa.</p><p>Different Technology concept behind Rasa Core, NLP and NLU. How Python can be used</p><p><strong>Part-3</strong></p><p>Demo of Phone calling AI bot and how i did the solution. How Phone calling AI bot can solve problem related to DevOps and Infrastructure.</p><p>Let’s join me on December 9th at mayfair lagoon. Register your-self under Futuristic Technologies.</p><p><a href="http://www.techbhubaneswar.com/free-registration/">Free Registration</a></p><p>See you there !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30a65bf809a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook free on Cloud for your data science job]]></title>
            <link>https://medium.com/techmintmedia/run-machine-learning-code-on-azure-cloud-for-free-34b32e99764c?source=rss-73d90ae2c142------2</link>
            <guid isPermaLink="false">https://medium.com/p/34b32e99764c</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Mon, 04 Jun 2018 18:59:15 GMT</pubDate>
            <atom:updated>2018-06-08T15:06:46.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bizeI-s23pME9Xx708nDNQ.png" /></figure><p><strong>First-Thing-First:</strong> Do you have one or more <strong>Python </strong>or <strong>R Code</strong> for your Data Science work. Do You have huge dataset and don’t have enough space in your Laptop and workstation. You want to run your Data science Experiments in cloud for free. You want some powerful Cloud instances dedicated for your code execution for free. Microsoft has something for you called “<strong>Azure Notebook</strong>”. Sing-up with your Microsoft/outlook/hotmail id and start hosting your data, script, notebook and run everything for free.</p><p><strong>Why and Who needs Microsoft Azure Notebook Cloud solution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ElGT_g-ReBNjXSUE94PEEw.jpeg" /></figure><ol><li>Do you use Jupyter notebook for your Python or R Coding. It’s getting hard for your to maintain in local drive.</li><li>Are you storing all your Jupyter notebook in local hard drive</li><li>Are you storing all your jupyter notebook in Github</li><li>Do you want to play with other developer’s Notebook Code without installing or downloading in your laptop</li><li>Do you want to access your same code in your Personal Laptop, office Laptop or Workstation in a easy way.</li><li>Do you want to use powerful cloud computing for your data science job without paying anything from your credit card</li><li>Do you want to test Github code directly in browser without cloning/ installing in your Laptop</li><li>You have huge data set and don’t have any place to store. Might be in CSV or text or Blob or Image Format</li><li>Do you want to pull all publicly available data source and store some where in cloud.</li><li>Do you want to copy all Kaggle dataset and store in your cloud.</li></ol><p>If you are coming under any 1 out these 10 mention points. Then Azure Notebook is for you. Please continue reading and Do clap for me. It Inspires me to write more for you. You can click on Clap icon — bottom of this page.</p><h4>Getting Started with Microsoft Azure Notebook in Cloud</h4><p><strong>Step -1 (Open one Account): </strong><a href="https://notebooks.azure.com/">https://notebooks.azure.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ura2Uik5Y6tpY9WRab-CnQ.gif" /></figure><ol><li>Goto <a href="https://notebooks.azure.com/">https://notebooks.azure.com/</a></li></ol><p>2. Sign-in With your Outlook or hotmail id (eg. something@outlook.com )</p><p>3. In the popup box choose a friendly username for your account</p><p>4. Click on Library</p><p><strong>Step -2 (Create a new Notebook in Azure Notebook )</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhQXOfY6DB8SaCKvAiF4IA.gif" /></figure><ol><li>Go to Library</li><li>Click on New Library</li><li>Give a Name and Id</li><li>Click on New and give a name for ipynb file and select Python 3 and Create</li><li>Within few Seconds notebook will open for you</li></ol><p><strong>Step -3 (Import Packages or Install New Python packages)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wLGZ8mtkDe9YsdiQi3o3A.gif" /></figure><ol><li>Most of the Data Science packages are already pre-installed</li><li>Just import any package and start writing your code</li><li>In-case any required package is missing, you can install it using following syntax. Ohhh my god. “<em>YES you can install any python package</em>”.</li></ol><blockquote><em>!pip install package-name</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adJfIy0Hrw5U-SGA" /><figcaption>“Man in a Patagonia hat and tattoos sitting by rows of flower bushes” by <a href="https://unsplash.com/@sethdoylee?utm_source=medium&amp;utm_medium=referral">Seth Doyle</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Step -4 (Import/Upload Dataset)</strong></p><p>You can download CSV data set directly to Library or Upload those from your computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycfLirSX5fso3LmAGMM9KQ.gif" /></figure><p>Follow this easy step to upload dataset (any format) to your library</p><p>Directly access those dataset from your notebook. As easy as you can refresh your browser :)</p><p><strong>Step -5 (Pull any iPython Notebook from github and run it on Azure)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUfpJhX42US-9FGjsBZx5Q.gif" /></figure><p>Goto Github and search for python source code repo which has ipynb format. Just copy that URL and paste in New windows on Azure cloud. Notebook will be copied to your Azure Library. Directly run it on Azure cloud in fraction of seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rS8lyVrwYEX7EsTJ" /><figcaption>Photo by <a href="https://unsplash.com/@acharki95?utm_source=medium&amp;utm_medium=referral">Aziz Acharki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>That Magic !!!</p><p>What’s in future:</p><p>Might be it will be paid in future. As a developer continue using it. We love Free and open Source.</p><p>We have another very good tool called Google Colab, but i don’t see this many feature there. Although in Google Colab you can install any packages and save your code to your Google Drive.</p><p>Happy R&amp;D Flocks</p><blockquote><strong>Follow me on Twitter</strong></blockquote><p><a href="https://twitter.com/bikashkumars">https://twitter.com/bikashkumars</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34b32e99764c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/run-machine-learning-code-on-azure-cloud-for-free-34b32e99764c">Jupyter Notebook free on Cloud for your data science job</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>