<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asmi Jafar</title>
    <description>The latest articles on DEV Community by Asmi Jafar (@asmijafar20).</description>
    <link>https://dev.to/asmijafar20</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F769945%2F32be171a-4529-4009-8739-5e5dad17e420.jpeg</url>
      <title>DEV Community: Asmi Jafar</title>
      <link>https://dev.to/asmijafar20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asmijafar20"/>
    <language>en</language>
    <item>
      <title>Week 7 Outreachy Blog Post.
About: The Project progress and its future goals. </title>
      <dc:creator>Asmi Jafar</dc:creator>
      <pubDate>Sun, 30 Jan 2022 16:09:41 +0000</pubDate>
      <link>https://dev.to/asmijafar20/week-7-outreachy-blog-postabout-the-project-progress-and-its-future-goals-3133</link>
      <guid>https://dev.to/asmijafar20/week-7-outreachy-blog-postabout-the-project-progress-and-its-future-goals-3133</guid>
      <description>&lt;p&gt;My internship got started on 6th Dec, In the first week of the internship, we all discussed how to achieve things and discussed resources. Further, I have gone through the codebase of the FLINT Reporting tool. Where I need to update the code concerning its version and automate some of the tasks in that. All of my dealings were at the backend side of the code. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Goals Achieved:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Discussed what exactly the reporting tool does and how to set up it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up the environment of the Reporting tool. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Written the superscript for setting up the environment over the server and locally. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updated the Angular version of the code to make it streamline.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of December, I have to set up the CI/CD for the Reporting tool frontend. So After learning about CI/CD I have implemented the Continuous integration pipeline for the reporting tool.&lt;/p&gt;

&lt;p&gt;In the start of January, I have to set up the CI/CD for the FLINT Cloud and test its docker file, I have updated the docker files of the FLINT Cloud and implemented the CI/CD pipeline for building and publishing the FLINT Cloud images on the GitHub Container Registry.  &lt;/p&gt;

&lt;p&gt;In the second week of January, We have discussed the FLINT and its Implementation. How FLINT works and its resources. FLINT doesn’t give outputs unless it gets combined with FLINT implementation. The FLINT is considered a library by itself - it doesn't do much unless we attach modules to it and make it an implementation. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8iiw1xS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go68302syzpvgglhz0nl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8iiw1xS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go68302syzpvgglhz0nl.png" alt="Image description" width="880" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After learning about FLINT and FLINT implementation, Understanding how the base image is built for the FLINT as a part of setting up the CI/CD. I have updated the links and version of the FLINT base image docker file. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Problems faced during building the FLINT Base images:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The image size was too large due to which the image crashes most of the time while building.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The versions and links were not updated in the base image. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updating the FLINT library image, POCO header file error comes, which unable the image to get built. (Error is still not resolved yet).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the 3rd and 4th week of January, I have learned about Spring Boot and Angular for containerizing the client of the FLINT reporting tool, after this I have implemented the CI/CD pipeline for building and publishing the client image on the GitHub Container Registry.&lt;/p&gt;

&lt;p&gt;FLINT Reporting tool comprises 31 microservices and each microservice has its docker files. After learning about Spring Boot and its containerization, I have updated the docker files of microservices of the reporting tool. &lt;/p&gt;

&lt;p&gt;Now, coming to the second half of the internship that has left, My plans for that are:&lt;/p&gt;

&lt;p&gt;I have to deploy each microservices of the Reporting tool on the Kubernetes cluster. In order to implement the CI/CD for the reporting tool backend. &lt;/p&gt;

&lt;p&gt;I have to learn about the services, deployments, and ingresses&lt;/p&gt;

&lt;p&gt;References:-&lt;/p&gt;

&lt;p&gt;a) Services&lt;br&gt;
&lt;a href="https://kubernetes.io/docs/concepts/services-networking/service/"&gt;https://kubernetes.io/docs/concepts/services-networking/service/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b) Deployment&lt;br&gt;
&lt;a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/"&gt;https://kubernetes.io/docs/concepts/workloads/controllers/deployment/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;c) Ingress&lt;br&gt;
&lt;a href="https://kubernetes.io/docs/concepts/services-networking/ingress/"&gt;https://kubernetes.io/docs/concepts/services-networking/ingress/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have to define services, deployments, or ingresses more efficiently or differently with the selection of different plugins. &lt;/p&gt;

&lt;p&gt;I have to set up the FLINT and its Implementation for the demo run, for the FLINT implementation we will use the SLEEK (Standard Land extraction and emissions of Kenya). &lt;br&gt;
Firstly, I want to investigate how is it that one should build/implement the SLEEK (flint implementation). I have to update the FLINT Implementation images and produce the docs for future devs and users. &lt;/p&gt;

&lt;p&gt;In the end, I have to build and publish all the docker images of the remaining Moja Global repositories on the GitHub Container Registry. I have to produce the docs for all the implementations and changes I made in the Reporting tool and FLINT/FLINT implementation. &lt;/p&gt;

&lt;p&gt;Lastly, we have to get results from FLINT extending the FLINT implementation as we know the FLINT extends the FLINT implementation and gives results in the form of flux, metadata, and stocks data. Then we will give this data as the input to the FLINT Reporting tool, gets reports as output, and create the demo run for it. &lt;/p&gt;

</description>
      <category>outreachy</category>
      <category>programming</category>
      <category>opensource</category>
      <category>operations</category>
    </item>
    <item>
      <title>Dockerize the Spring Boot Application.</title>
      <dc:creator>Asmi Jafar</dc:creator>
      <pubDate>Sun, 23 Jan 2022 12:12:21 +0000</pubDate>
      <link>https://dev.to/asmijafar20/dockerize-the-spring-boot-application-596d</link>
      <guid>https://dev.to/asmijafar20/dockerize-the-spring-boot-application-596d</guid>
      <description>&lt;p&gt;Spring Boot is a Java framework for building applications whether you build backend applications or full-stack applications using Java or Kotlin spring boot is a framework to go with.  &lt;/p&gt;

&lt;p&gt;Another definition: Spring Boot is an open-source Java-based framework used to create a micro Service. It is used to build stand-alone and production-ready spring applications.&lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Connecting to DB&lt;/li&gt;
&lt;li&gt;Dependency Injection&lt;/li&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;Microservices&lt;/li&gt;
&lt;li&gt;Production-ready&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;What are Microservices?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microservice&lt;/strong&gt; is an architecture that allows developers to develop and deploy services independently. Each service running has its own process and this achieves the lightweight model to support business applications.&lt;/p&gt;

&lt;p&gt;Now the most important term that we need to know why spring boot is so useful and easy to use is because of dependency injection, Now What is Dependency injection?&lt;/p&gt;

&lt;p&gt;So before we know about dependency injection let’s first define &lt;em&gt;What is loose coupling?&lt;/em&gt; &lt;br&gt;
So, loose coupling is when one object doesn’t totally depend on another object it may get replaced. When two classes, modules, or components have low dependencies on each other, it is called &lt;strong&gt;loose coupling&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependency injection&lt;/strong&gt; is a fundamental aspect of a spring framework, through which the spring container injects objects into the other objects or “dependencies” Basically the dependency injection containers (spring containers) are responsible to create the objects and then they will inject it inside the class. &lt;br&gt;
Simply put, this allows for loose coupling of components and moves the responsibility of managing components onto the container. &lt;/p&gt;

&lt;p&gt;Using: &lt;a href=""&gt;https://www.baeldung.com/spring-boot-docker-images&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s start with containerizing our spring boot application (Reporting tool). Since our FLINT reporting tool has 31 microservices and each microservice has its own docker file, the structure of every docker file of the microservices is almost the same. So without any further ado let’s begin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM eclipse-temurin:17.0.1_12-jre-alpine as builder
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Spring Boot JAR file&lt;/strong&gt; has “&lt;em&gt;layers&lt;/em&gt;”. When unpacks “jar file” it has internal and external dependencies packaged together. That’s why we have used the multi-stage build for the docker image. So when any line changes in the code only one layer would get affected by it.&lt;br&gt;&lt;br&gt;
ARG instruction defines a variable that can be passed at build time. The JAR_FILE could be passed in as part of the docker command. So here we are using for Maven. &lt;br&gt;
A jarmode is a special system property that you can set when you launch the jar. It allows the bootstrap code to run something entirely different from your application. For example, something that extracts the layers. Here’s you can launch jar with a layertools jar mode. &lt;/p&gt;

&lt;p&gt;Now we will step into the next part of the docker file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM eclipse-temurin:17.0.1_12-jre-alpine
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java","-Dspring.datasource.url=jdbc:postgresql://${POSTGRES_HOST}:5432/pools", "org.springframework.boot.loader.JarLauncher"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will extract and copy each layer. &lt;/p&gt;

&lt;p&gt;All being well, we should now have a layered jar with jarmode support. &lt;br&gt;
These are the layers and order that they should be added.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;dependencies&lt;/li&gt;
&lt;li&gt;snapshot-dependencies&lt;/li&gt;
&lt;li&gt;resources&lt;/li&gt;
&lt;li&gt;application&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;strong&gt;builder stage&lt;/strong&gt; extracts the folders that are needed later. Each of the COPY commands relates to the layers that we listed. We can see each layer from the layered jar get added to the Docker image as its own layer.&lt;/p&gt;

</description>
      <category>java</category>
      <category>docker</category>
      <category>microservices</category>
      <category>dependencies</category>
    </item>
    <item>
      <title>Outreachy Blog #1: Introduce Yourself.</title>
      <dc:creator>Asmi Jafar</dc:creator>
      <pubDate>Sun, 12 Dec 2021 08:29:03 +0000</pubDate>
      <link>https://dev.to/asmijafar20/outreachy-blog-1-introduce-yourself-67d</link>
      <guid>https://dev.to/asmijafar20/outreachy-blog-1-introduce-yourself-67d</guid>
      <description>&lt;p&gt;I’m a Computer Science graduate from Aligarh Muslim University, India. I have been profoundly influenced by technology and the various ways it can be used to express art. I love to do coding and creating projects and have the curiosity to learn and contribute to projects. Almost every field of Computer Science piques my interest, more specifically development (Web development) and research. I have proficiency in languages such as Python, Java, JavaScript, and C programming language.&lt;/p&gt;

&lt;p&gt;My core values are I'm always up for learning new things which helps me grow and makes me a better person than yesterday. I'm an honest person, I love honesty. Integrity is always been an eye-catcher for me. I'm a very integrated person. A person's values and integrity is what makes them different from others and valuable nothing can change that. My interests are painting and reading. I paint to view the world and read to visualize it.  I want to mention one of my favorite quotes from my favorite book "The Last Lecture": The Brick walls are there for a reason, they are not there to keep us out. The brick walls are there to give us a chance to show how badly we want something.&lt;/p&gt;

&lt;p&gt;I always wanted to participate in some open source program and I love to contribute to free and open-source projects. And Outreachy is the best platform for it. Outreachy is an incredible initiative for promoting open source and diversity all over the world.  I’m always excited to get onto new projects and am motivated to learn new stacks. With my contributions at Moja global, I found it very comfortable working with a talented team. I found the idea or purpose of Moja Global very insightful. The mission of Moja Global is to support ambitious climate action by developing open-source software. My interest in Moja Global grew as I interacted with the team and got to know more about its projects and future goals. I’m very excited to work on the project of this community by improving it and making it more efficient. Along the way, I will also learn new skills. That's what motivated me to apply to Outreachy.  &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ops Docker it is #2: Build a Docker Image for Flask Application </title>
      <dc:creator>Asmi Jafar</dc:creator>
      <pubDate>Wed, 08 Dec 2021 11:24:32 +0000</pubDate>
      <link>https://dev.to/asmijafar20/ops-docker-it-is-2-build-a-docker-image-for-flask-application-4eha</link>
      <guid>https://dev.to/asmijafar20/ops-docker-it-is-2-build-a-docker-image-for-flask-application-4eha</guid>
      <description>&lt;p&gt;Let's first start with creating the Docker file where we will pull Python 3.9 image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Flask Dockerfile template&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM python:3.9.7
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ["python3"]
CMD ["app.py"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are pulling Python 3.9.7 image from the Python dockerhub repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COPY&lt;/strong&gt;&lt;br&gt;
Copy the current directory contents into the container at &lt;code&gt;/app&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WORKDIR&lt;/strong&gt;&lt;br&gt;
It's a directory inside container image that can be set with the WORKDIR instruction in the Dockerfile. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RUN&lt;/strong&gt; command will install all the required packages for the Dockerfile. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EXPOSE&lt;/strong&gt;&lt;br&gt;
The EXPOSE instruction tells Docker to get all its information required during the runtime from a specified Port.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ENTRYPOINT&lt;/strong&gt;&lt;br&gt;
The initiating point for the dockerfile while we run it. ENTRYPOINT command and parameters will not be overwritten from the command line. Instead, all command-line arguments will be added after ENTRYPOINT parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CMD&lt;/strong&gt;&lt;br&gt;
CMD instruction is used to define what command the container should execute when launched and CMD sets default command and/or parameters, which can be overwritten from the command line when the docker container runs.&lt;/p&gt;

&lt;p&gt;Now Let's run the Docker command for building the image &lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build -t asmi-flask .&lt;/code&gt; &lt;br&gt;
This will build the image(asmi-flask) for the flask application. Give it a tag &lt;code&gt;-t&lt;/code&gt; called asmi-flask.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run -p 5000:5000 asmi-flask&lt;/code&gt; &lt;br&gt;
In this command we tell docker to run an image called asmi-flask. &lt;code&gt;-p&lt;/code&gt; Publish a container's port(s) to the host. Since Flask is running on port 5000 by default, the second part of this flag needs to be 5000. &lt;/p&gt;

&lt;p&gt;After this, we can run &lt;code&gt;docker ps&lt;/code&gt; command to check if the image has been built or not. &lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ubntu@asmijafar20:~/Flask-App$ docker images
REPOSITORY              TAG          IMAGE ID       CREATED       SIZE
asmijafar20/dockerhub   asmi-flask   2e155e2820a0   3 days ago    922MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next blog, we can build CI/CD pipelines and configure them using GitHub Actions. &lt;/p&gt;

&lt;p&gt;Till then Happy Coding! &lt;/p&gt;

</description>
      <category>python</category>
      <category>devops</category>
      <category>docker</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Ops Docker it is! #1</title>
      <dc:creator>Asmi Jafar</dc:creator>
      <pubDate>Tue, 07 Dec 2021 13:14:46 +0000</pubDate>
      <link>https://dev.to/asmijafar20/ops-docker-it-is-1-3g5p</link>
      <guid>https://dev.to/asmijafar20/ops-docker-it-is-1-3g5p</guid>
      <description>&lt;p&gt;This the very first Blog of this series. &lt;/p&gt;

&lt;p&gt;Let's start with some definitions and concepts.&lt;/p&gt;

&lt;p&gt;Docker is a platform that uses OS-level virtualization to deliver software in packages called &lt;strong&gt;Containers&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;What is a Container?&lt;/p&gt;

&lt;p&gt;A container is a way to package an application with all the necessary dependencies and configurations or you can say layers of images packaged together. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Advantages&lt;/u&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Portable Artifact&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily shared&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily moved around the development team and the development-operations team. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And due to the portability of containers and everything packaged in one isolating environment makes the Development and Deployment more efficient.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No environmental configuration is needed on the server except the docker runtime. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now here comes the question, &lt;em&gt;Where do these containers live&lt;/em&gt;?&lt;br&gt;
So, Containers live in a container repository, private or public repository. &lt;/p&gt;

&lt;p&gt;If we don't have containers then there could be a version conflict or misunderstandings between the development team and operations team. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;What is the difference between a Docker image and a Docker container&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;So, Image is the actual package with all the dependencies and configurations, an artifact that can be moved around whereas when we pull the image and start it and applications start that creates the container environment. So containers are the running image only.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What is the difference between Docker and Virtual Machines?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As we know, Docker and VM are both virtualization tools. Docker virtualizes the Application layer in the OS (operating system) and it uses the kernel of the host whereas the virtual machines virtualize the whole OS, it has an application layer and its own kernel. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The size of the docker images are smaller than VM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker containers start and run fast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compatibility: Virtual Machines are more compatible. They can run on any OS host of the Operating System.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Next blog of this series&lt;/strong&gt;: Building of docker image for Flask Application.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
