<?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: Kent Fujii</title>
    <description>The latest articles on DEV Community by Kent Fujii (@kentfujii).</description>
    <link>https://dev.to/kentfujii</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%2F47398%2F45d2d7e3-93e2-4dbd-a8ab-60a659daa0da.jpg</url>
      <title>DEV Community: Kent Fujii</title>
      <link>https://dev.to/kentfujii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kentfujii"/>
    <language>en</language>
    <item>
      <title>I've created a tiny library connecting Rails and Digdag</title>
      <dc:creator>Kent Fujii</dc:creator>
      <pubDate>Sun, 08 May 2022 09:34:18 +0000</pubDate>
      <link>https://dev.to/kentfujii/ive-created-a-tiny-library-connecting-rails-and-digdag-42d2</link>
      <guid>https://dev.to/kentfujii/ive-created-a-tiny-library-connecting-rails-and-digdag-42d2</guid>
      <description>&lt;h2&gt;
  
  
  What's this?
&lt;/h2&gt;

&lt;p&gt;I've created a tiny library connecting Rails and Digdag.&lt;br&gt;
The library "&lt;a href="https://github.com/KentFujii/mogura"&gt;mogura&lt;/a&gt;" is now available.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is this used for?
&lt;/h2&gt;

&lt;p&gt;Rake tasks are a way to manage batches in Rails.&lt;br&gt;
However, batch processing tends to bloat the codebase and increase operational costs.&lt;/p&gt;

&lt;p&gt;In some cases, introducing a professional Python ETL tool such as Airflow may be a hurdle with learning/building/operating/expenses or recruiting human resources.&lt;br&gt;
In addition, it is often not a realistic option to rewrite the Rails-related domain logic contained in Rake tasks as microservices in Python.&lt;br&gt;
There may be a demand to include a workflow engine within a Rails application.&lt;/p&gt;

&lt;p&gt;I have been looking for a way to use the domain logic of a Rails application while still satisfying the requirements of a workflow engine.&lt;br&gt;
And I have come up with the option of creating a tiny library connecting Rails and Digdag.&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Add the following to your Rails project Gemfile and &lt;code&gt;bundle install&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem 'mogura'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the library is installed, try the following command in the root directory of your Rails project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bundle exec mogura help
Commands:
  mogura help [COMMAND] # Describe available commands or one specific command
  mogura init # Initialize Digdag files
  mogura push # Push Digdag workflows
  mogura version # Prints version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;bundle exec mogura init&lt;/code&gt; will create the following files in your Rails project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAILS_ROOT/config/digdag/sample.dig
RAILS_ROOT/app/dags/sample_dag.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_export:
  rb:
    require: {{ RAILS_ROOT }}/config/environment
+run:
  rb&amp;gt;: SampleDag.run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class SampleDag
  def run
    puts "Hello Rails #{Rails.env}"
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commanding &lt;code&gt;bundle exec mogura push&lt;/code&gt; will register &lt;code&gt;sample.dig&lt;/code&gt; with Digdag.&lt;br&gt;
By loading the Rails environment from Digdag inside &lt;code&gt;sample.dig&lt;/code&gt;, you can call your domain logic of the Rails from your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thanks for reading!
&lt;/h2&gt;

&lt;p&gt;Currently, only a single Digdag project can be registered as workflows, but I think it would be better if multiple Digdag projects could be registered.&lt;br&gt;
Also, this library currently allows Digdag operations only from the CLI, but I would like to be able to register and edit workflows from your domain logic of the Rails application.&lt;br&gt;
And I'm actively looking for feedback or contributions to this library, feel free to have new functionality ideas to add! :)&lt;/p&gt;

</description>
      <category>rails</category>
      <category>digdag</category>
    </item>
    <item>
      <title>Release Checklist</title>
      <dc:creator>Kent Fujii</dc:creator>
      <pubDate>Tue, 21 Apr 2020 15:57:20 +0000</pubDate>
      <link>https://dev.to/kentfujii/release-checklist-j6c</link>
      <guid>https://dev.to/kentfujii/release-checklist-j6c</guid>
      <description>&lt;p&gt;A checklist example to check before releasing a web service&lt;/p&gt;

&lt;h2&gt;
  
  
  Application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Test coverage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is the test coverage 60% or higher?

&lt;ul&gt;
&lt;li&gt;In general, 60% is “acceptable”&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Log
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is there a log in CloudWatch Logs?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  External monitoring
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is the stability of top page monitored by StatusCake?

&lt;ul&gt;
&lt;li&gt;Polling at least every 15 minutes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vulnerability
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Vulnerability diagnosis for externally released services.

&lt;ul&gt;
&lt;li&gt;Diagnostics by AWS inspector, IBM APP SCAN, etc. have been performed and the vulnerability has been fixed by the day of release&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Load test
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Has a load test been performed?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Infrastructure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Log (ex. CloudWatch)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Have you set how many days to retain logs?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Load Balancer (ex. ALB)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is the response time monitored in NewRelic?&lt;/li&gt;
&lt;li&gt;[ ] Is the load balancer 5xx monitored in NewRelic?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  App/Batch Server (ex. EC2)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] NewRelic's APMs are installed in your project.&lt;/li&gt;
&lt;li&gt;[ ] CPU/memory/disk is monitored in NewRelic&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Container Orchestrator (ex. ECS)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Check the hard limit of memory set in the task definition of ECS not to exceed the upper limit of the ECS instance memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Database (ex. RDS, ElastiCache)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] RDS CPU/memory/disk is monitored in NewRelic&lt;/li&gt;
&lt;li&gt;[ ] ElastiCache CPU/memory is monitored in NewRelic&lt;/li&gt;
&lt;li&gt;[ ] Are you sure it's not provided to the public?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Network (ex. VPC, SG, WAF, S3)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] VPC's IP range is not the same as your other AWS VPCs&lt;/li&gt;
&lt;li&gt;[ ] Is there a clear separation between the Public and Private segments?&lt;/li&gt;
&lt;li&gt;[ ] If it is an internal service, is SG's ingress limited to your organization?&lt;/li&gt;
&lt;li&gt;[ ] Set WAF for services that are released to the public.&lt;/li&gt;
&lt;li&gt;[ ] Are all S3 buckets isolated from the outside world?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  DevOps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Are you able to run build/test/deploy with CircleCI?&lt;/li&gt;
&lt;li&gt;[ ] Are you able to manage your cloud resources with Terraform?&lt;/li&gt;
&lt;li&gt;[ ] Is there an on-call system like Opsgenie?

&lt;ul&gt;
&lt;li&gt;Be able to receive the following error notifications by phone or other means and be ready to write a playbook/post-mortem after recovery

&lt;ul&gt;
&lt;li&gt;external monitoring&lt;/li&gt;
&lt;li&gt;5xx of load balancers&lt;/li&gt;
&lt;li&gt;Disk space remaining in EC2&lt;/li&gt;
&lt;li&gt;Disk Space in RDS&lt;/li&gt;
&lt;li&gt;Amount of memory remaining in ElastiCache&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

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