The story of running the asp.net core 3.1 app on arm64 version Amazon Linux 2

Hello.

https://qiita.com/yKimisaki/items/fa528de37413c1001bb6 I wrote in a past article that I made a SlackBot, but recently I put it on an instance of AWS Graviton (64bit version arm CPU, AWS independently developed), so note I will leave it to the extent. The current situation is working without any problems, so I think there is probably no problem.

About the instance

https://aws.amazon.com/jp/blogs/news/new-t4g-instances-burstable-performance-powered-by-aws-graviton2/

Although various things are summarized above, since it is not an API server that is used insanely hard due to the scale of the company, it is currently operated with t4g.nano. The storage is set to 15GB, but since it fits in about 1.7GB, 8GB should probably be enough for this scale. I think the price is currently around $ 4 to $ 5 a month. It's cheaper than renting an x64 t2.nano.

About OS / AMI

The OS is Amazon Linux 2, but since it is AWS and I decided to use Amazon Linux 2, there is no particular meaning. If you have a quick start with .NET Core pre-installed, you cannot use the t4g instance, so choose a child that seems to be pure.

image.png

After that, EC2 is started normally, but please open the port for the ASP.NET server with TCP in addition to SSH number 22.

Put .NET Core Runtime in a virtual machine

I'm using SSH on WSL's Ubuntu 20.04 LTS to connect to AWS, but for no other reason than it's easy, please enter the server the way you like. So, at present, it seems that you cannot use yum, apt, or other package managers to install .NET Core Runtime on the arm64 version of EC2. So, bring it manually with wget from the following.

https://dotnet.microsoft.com/download/dotnet/current

wget https://download.visualstudio.microsoft.com/download/pr/dffd493f-9eb8-483f-81c7-a9e2201574ef/54e7464241e01e7031fd89e6fe88e6da/aspnetcore-runtime-3.1.9-linux-arm64.tar.gz

So, if you unzip it and pass it through the path, it's OK. This time, I created a dotnet folder directly under my home directory and expanded it there, so it looks like the following.

tar zxf aspnetcore-runtime-3.1.9-linux-arm64.tar.gz
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

publish for arm64 version

In this case, it's an in-house SlackBot that doesn't require updates and updates frequently, so I'm always sloppy by hitting commands on Windows and sending them via scp. Go to the project folder around PowerShell and

dotnet publish -c Release -r linux-arm64

Will generate an arm64 version of the executable file. It's OK if you send the entire publish folder in the product with scp using WSL.

to start

Enter Linux again with SSH

nohup ./publish/SlackBot > slackbot.out &

I'm running in the background like this. After that, it is OK if you specify the URL of the AWS server in SlackCommand of the Slack API.

finally

I used to launch an EC2 instance with .NET Core pre-installed, but this time I couldn't do that and I couldn't use the package manager, so it was a bit annoying, but it was safe for arm. It works well on CPU with .NET Core! So I was happy ... I don't know much about it, but AWS has been accelerating its move to Graviton recently, and it seems that it has become the standard for ElastiCache and EKS. However, it seems that a game store like myself will continue to be destined to escape from the x86 processor by developing with UE4 and Unity (or rather Visual Studio and Maya). The arm version of Windows is embroidery, and the arm version of Mac is coming soon, but what will happen ... Anyway, I can't really imagine developing a game with arm in the next few years. In that sense, I think that being able to overcome the processor barrier is one of the strengths of .NET Core, so please check out the arm version of .NET Core.

Recommended Posts

The story of running the asp.net core 3.1 app on arm64 version Amazon Linux 2
Announcing the availability of Java 11 LTS on Amazon Linux 2
Put the latest version of Python on linux (Debian) on Chromebook
Install the latest version of Git on your Linux server
Run docker-compose on Amazon Linux2 on ARM64
Suspend Thread on Linux (corrected version at the bottom of the article)
The story of making the Mel Icon Generator version2
Use the latest version of PyCharm on Ubuntu
Change the resolution of Ubuntu running on VirtualBox
The story of switching the Azure App Service web system from Windows to Linux
Try running the toio core cube on Windows 10 / macOS / Linux with the Python library bleak
Install the latest version of CMake on Ubuntu 18.04.4 LTS
The story of replacing Nvidia GTX 1650 with Linux Mint 20.1.
I tried running the app on the IoT platform "Rimotte"
The story of building the fastest Linux environment in the world
Open Chrome version of LINE from the command line [Linux]
Find out the version of the language you are running
Publish your Django app on Amazon Linux + Apache + mod_wsgi
Check the type and version of your Linux distribution
The story of sys.path.append ()
[Personal memo] Install the latest Java on Amazon Linux that already contains Java and switch the version
Notes on the version of CUDA, cuDNN where tensorflow-gpu worked
Try running Amazon Linux 2 on-premises (VM on your local PC).
The story of how the Python bottle worked on Sakura Internet
After all, the story of returning from Linux to Windows
Commands and files to check the version of CentOS Linux
The story of downgrading the version of tensorflow in the demo of Mask R-CNN.
Get the host name of the host PC with Docker on Linux
[First personal development] The story of deploying the Flask app and Twitter's automatic reply bot on Heroku
Align the version of chromedriver_binary
Addition of amazon linux swap
Install the JDK on Linux
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Paste the link on linux
Install strongSwan 5.9.1 on Amazon Linux 2
The story that the version of python 3.7.7 was not adapted to Heroku
Build a Selenium environment on Amazon Linux 2 in the shortest time
On Linux, the time stamp of a file is a little past.
The story of running python and displaying the results without closing vim
Summary of installing PHP7.2 on EC2 (Amazon Linux 2) and setting php.ini
Check the memory protection of linux kerne with the code for ARM
How to update the python version of Cloud Shell on GCP
The story of failing to update "calendar.day_abbr" on the admin screen of django