The story of trying to contribute to COVID-19 analysis with AWS free tier and failing

(This is a reprint of the article I wrote on my blog)

Postscript: 2020/4/17

@ hirosys-biz has published the procedure to automatically build an environment with CloudFormation. It also solves the "bad" part of this article, so be sure to check it out as well. The environment for participating in the analysis project of COVID-19 (SARS-CoV-2) was automatically constructed by CloudFormation

Introduction

"Let's practice building an Amazon Web Services environment while contributing to the analysis of the new coronavirus." As a result, I came to the conclusion that "it worked normally, but I couldn't contribute much because of the lack of specifications in the free tier." Keep a record of your work.

background

Corona fashion is spicy. Isn't it possible to solve it sooner?

An article on PC Watch that says "How to use" Folding @ home ", which contributes to corona analysis that can be started in 3 minutes even now" Find

Immediately install it on your home laptop (with an older generation GPU). I've been running for about a week and have done about 25 tasks, but I still feel unsatisfactory.

I can't raise the specs, so I want to increase the number of units in operation. But I only have one physical machine ...

Yes, I had an AWS account. Let's use this. If you can do it in the free frame, can someone imitate it if you make it an article?

Action.

What I did ①: Creating a VPC environment

I decided to build a VPC environment first and then set up an EC2 environment in it. Basically, work according to this blog article.

Only the security group has been changed as follows according to the purpose of use this time.

security.png

What I did (2): Build an EC2 environment on a VPC

Create an EC2 environment on the VPC environment created in ①. This work also referred to this blog article.

This time I wanted to create an environment that can be created with a free usage frame, so the configuration is as follows

What I did ③: Linux settings

$ sudo vi /etc/ssh/sshd_config

###Add the following around 22 lines(Port number specified in ①)
Port 2****

###After saving
$ sudo service sshd reload
###New user creation(root privileges)
# useradd newuser
# passwd newuser

###SSH settings(root privileges)
# cd /home/newuser/
# mkdir .ssh
# chmod 700 .ssh
# chown newuser:newuser .ssh
###Send the public key here with SCP
# mv /home/ec2-user/id_rsa.pub .ssh/authorized_keys
# chmod 600 .ssh/authorized_keys
# chown newuser:newuser .ssh/authorized_keys

###Give permission to sudo
# usermod -aG wheel newuser

###In another window"newuser"Log in as. After that, operate on the screen on the new user side
$ sudo su -
###After confirming that you can become root, ec2-user deleted
# userdel ec2-user

What I did ④: Introducing Folding @ Home

This time, only the minimum required FAH Client is introduced.

$ wget https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v7.6/fahclient-7.6.9-1.x86_64.rpm
$ sudo rpm -i --nodeps fahclient-7.6.9-1.x86_64.rpm
<config>
  <!-- Client Control -->
  <fold-anon v='true'/>

  <!-- Folding Slot Configuration -->
  <!-- v7.6.9-COVID for cause after 1-If you specify 19, corona related tasks will be assigned preferentially.-->
  <cause v='COVID_19'/>
  <gpu v='false'/>

  <!--Access authority setting to the Web controller. xxx.xxx.xxx.Enter your IP address in place of xxx-->
  <allow>127.0.0.1 xxx.xxx.xxx.xxx</allow>
  <web-allow>127.0.0.1 xxx.xxx.xxx.xxx</web-allow>

  <!--How much CPU resources do you use? light,middle,3 choices of full-->
  <power v='full'/>

  <!-- User Information -->
  <!--User information. If you enter the user name, how much you contributed individually will be aggregated-->
  <user v='deflat'/>
  <!--The ID of the team you want to belong to. Optional. By the way, 222 is"Japan"team.-->
  <team v='222'/>
  <!--Optional. You can get more points by registering your e-mail address on the official website and setting the received key.-->
  <passkey v='***Paste the key here***'/>

  <!--Slot number and type. This time there is only one CPU so don't mess with it-->
  <!-- Folding Slots -->
  <slot id='0' type='CPU'/>

</config>
$ sudo /etc/init.d/FAHClient stop
$ sudo /etc/init.d/FAHClient start

result

What I found out later

Summary and impressions

Change log

Recommended Posts

The story of trying to contribute to COVID-19 analysis with AWS free tier and failing
The story of trying to reconnect the client
The story of trying deep3d and losing
The story of trying to push SSH_AUTH_SOCK obsolete on screen with LD_PRELOAD
The story of Python and the story of NaN
The story of not being able to run pygame with pycharm
Correspondence analysis of sentences with COTOHA API and save to file
To improve the reusability and maintainability of workflows created with Luigi
From the introduction of JUMAN ++ to morphological analysis of Japanese with Python
The story of failing to update "calendar.day_abbr" on the admin screen of django
Upload data to s3 of aws with a command and update it, and delete the used data (on the way)
I tried to extract and illustrate the stage of the story using COTOHA
The story of making a sound camera with Touch Designer and ReSpeaker
Folding @ Home on Linux Mint to contribute to the analysis of the new coronavirus
Try to separate the background and moving object of the video with OpenCV
The story of adding MeCab to ubuntu 16.04
The story of pep8 changing to pycodestyle
The story of migrating from home server (MariaDB + Java) to AWS (DynamoDB + Python + PHP) with reduced monthly cost
A story about trying to install uwsgi on an EC2 instance and failing
Feel free to write a test with nose (in the case of + gevent)
Specify the start and end positions of files to be included with qiitap
[Introduction to AWS] I tried porting the conversation app and playing with text2speech @ AWS ♪
The story of making soracom_exporter (I tried to monitor SORACOM Air with Prometheus)
Make it easy to specify the time of AWS CloudWatch Events with CDK.
A story of a high school graduate technician trying to predict the survival of the Titanic
Script to tweet with multiples of 3 and numbers with 3 !!
The story of trying Sourcetrail × macOS × VS Code
The story of moving from Pipenv to Poetry
A story that failed when trying to remove the suffix from the string with rstrip
The story of Airflow's webserver and DAG, which takes a long time to load
I can't find the clocksource tsc! ?? The story of trying to write a kernel patch
Extract images and tables from pdf with python to reduce the burden of reporting
I tried to automate the article update of Livedoor blog with Python and selenium.
A story of trial and error trying to create a dynamic user group in Slack
The story of switching from WoSign to Let's Encrypt for a free SSL certificate
The story of porting code from C to Go and getting hooked (and to the language spec)
Quickly create a Python data analysis dashboard with Streamlit and deploy it to AWS
I just wanted to extract the data of the desired date and time with Django
A memo of misunderstanding when trying to load the entire self-made module with Python3
A story about trying to introduce Linter in the middle of a Python (Flask) project
I tried to compare the processing speed with dplyr of R and pandas of Python
Django-A story that got stuck when trying to operate mail with SES and Amazon SES (also introduces the fastest operation procedure)
The story of Python without increment and decrement operators.
The story of stopping the production service with the hostname command
The story of replacing Nvidia GTX 1650 with Linux Mint 20.1.
Add information to the bottom of the figure with Matplotlib
The story of sharing the pyenv environment with multiple users
A story of trying out pyenv, virtualenv and virtualenvwrapper
Visualize the range of interpolation and extrapolation with python
Calculate the regression coefficient of simple regression analysis with python
Predict the number of people infected with COVID-19 with Prophet
Story of image analysis of PDF file and data extraction
Try to get the contents of Word with Golang
Comparison of Windows Server and Free Linux to Commercial Linux
The story of wanting to buy Ring Fit Adventure
The story of using circleci to build manylinux wheels
Now in Singapore The story of creating a LineBot and wanting to do a memorable job
I tried to automatically post to ChatWork at the time of deployment with fabric and ChatWork Api
[Introduction to SIR model] Predict the end time of each country with COVID-19 data fitting ♬
I tried to get the number of days of the month holidays (Saturdays, Sundays, and holidays) with python
Return the image data with Flask of Python and draw it to the canvas element of HTML