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.
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.
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.
After that, EC2 is started normally, but please open the port for the ASP.NET server with TCP in addition to SSH number 22.
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
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.
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.
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