<?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: David Virtser</title>
    <description>The latest articles on DEV Community by David Virtser (@poison_dv).</description>
    <link>https://dev.to/poison_dv</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%2F2385%2FJIkXZC0I.jpg</url>
      <title>DEV Community: David Virtser</title>
      <link>https://dev.to/poison_dv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/poison_dv"/>
    <language>en</language>
    <item>
      <title>How to save on AWS Elastic Beanstalk EC2 machines by putting them to sleep</title>
      <dc:creator>David Virtser</dc:creator>
      <pubDate>Wed, 06 Sep 2017 07:02:44 +0000</pubDate>
      <link>https://dev.to/poison_dv/how-to-save-on-aws-elastic-beanstalk-ec2-machines-by-putting-them-to-sleep</link>
      <guid>https://dev.to/poison_dv/how-to-save-on-aws-elastic-beanstalk-ec2-machines-by-putting-them-to-sleep</guid>
      <description>&lt;p&gt;If you are running few non production environments on AWS Elastic Beanstalk you were probably wondering how do you put its servers to sleep during the off work hours just to save few 💰💰💰?&lt;/p&gt;

&lt;p&gt;There is a simple trick that AWS provide, but don’t promote it for a reason. As a result not many know about it. ;)&lt;/p&gt;

&lt;p&gt;All you need to do is to define two time periods in your environment &lt;em&gt;Configuration -&amp;gt; Scaling -&amp;gt; Time-based scaling section.&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;One period with cron based time settings to Stop your EC2 environment machines and the other one to Start them.&lt;/p&gt;

&lt;p&gt;Here is cron definition to reduce number of EC2 machines to zero at 17:00 UTC every working week day — &lt;em&gt;0 17 * * 0,1,2,3,4&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;And a cron definition to increase number of EC2 machines to one at 05:00 UTC every working week day — &lt;em&gt;0 5 * * 0,1,2,3,4&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;What it actually does is terminates and recreates the machines as AWS doesn’t allow to suspend/pause EC2 machines.&lt;/p&gt;

&lt;p&gt;If you can afford to run without Elastic Load Balancer it will save you even more as this trick won’t terminate the LB. 🤑&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
    </item>
    <item>
      <title>Modern dev/test/prod environments using Docker Compose</title>
      <dc:creator>David Virtser</dc:creator>
      <pubDate>Wed, 25 Jan 2017 20:02:38 +0000</pubDate>
      <link>https://dev.to/poison_dv/modern-devtestprod-environments-using-docker-compose</link>
      <guid>https://dev.to/poison_dv/modern-devtestprod-environments-using-docker-compose</guid>
      <description>&lt;p&gt;There is like thousands of post talking about what is Docker and how to start working with it, but there is no much posts explaining simply the motivation behind it. So I decided to write one, as I see it.&lt;/p&gt;

&lt;p&gt;I think its much more important to understand &lt;em&gt;why&lt;/em&gt; than technical details of &lt;em&gt;how&lt;/em&gt;. When you understand &lt;em&gt;why&lt;/em&gt;, you have the motivation to learn &lt;em&gt;how&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;OK, let's remind ourselves first about the old habits of how we used to work. This to get a better reference of the problem.&lt;/p&gt;

&lt;p&gt;We used to create dev/test/prod environments manually. It could work when your team and environment are small. When team grows and you have to share those dev/test environments, things start to go out of control. Such environments aren't isolated and become inconsistent over time.&lt;/p&gt;

&lt;p&gt;In many cases, those environments are not identical to production environment, running on different machines or have different network/security conditions. Which all resulting in unexpected bugs on production.&lt;/p&gt;

&lt;p&gt;When team and environment grows, engineers can't keep up with constant changes and additions of new components. It become impossible to install manually on your local machine another dependency. This leads to creative solutions like using some API/cache/db from another environment. 💩&lt;/p&gt;

&lt;p&gt;This is where Docker will shine by turning your environment services infrastructure into code. Which will be predictable, repeatable and consistent between your engineers dev, your CI test and your production environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker
&lt;/h2&gt;

&lt;p&gt;Let's start with Docker, which is the basis for everything. It takes some time to grasp the concept and how to work with it, like with any abstraction. But believe me it's worth it.&lt;/p&gt;

&lt;p&gt;Docker is using Linux core without need of creating virtual machines for each container (service). As a result the best option as developer machine would be Linux. Docker can run on Mac as well, but will require more resources to create Docker virtual machine space. Sorry, I can't provide any feedback regarding working with Docker in Windows OS as I never tried it. (If you did, please share your experience in comments)&lt;/p&gt;

&lt;p&gt;What does Docker container represent? A container is a single instance of one component in your environment. Component can be for example web application, API, worker, cache, database, or others.&lt;/p&gt;

&lt;p&gt;What you define in service Docker file is which OS image to use as your baseline, how to enrich it with your service dependencies, where to copy your code from and how to run the service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Compose
&lt;/h2&gt;

&lt;p&gt;Docker is nice when you want to spin up a single app/service. What makes it really powerful is Docker Compose which creates a composition of Docker containers that eventually represent your real application dev/test/prod environment.&lt;/p&gt;

&lt;p&gt;Docker composition describes the relationship between your services. Their volumes, networks, links, configuration, etc..&lt;/p&gt;

&lt;p&gt;It allows you to spin up the whole sandbox environment of services on your machine. Fully isolated, your own environment. ☺&lt;/p&gt;

&lt;p&gt;I think that's all you need to know to get the motivation to learn how to build Docker containers and work with Composition.&lt;/p&gt;

&lt;p&gt;If I could explain it simply, as next step, I suggest to follow &lt;a href="https://docs.docker.com/learn/"&gt;Docker documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>tech</category>
    </item>
  </channel>
</rss>
