- LegiNote Project Development Story 3 - Request in Go
- This article introduces the development process of the LegiNote project, which utilizes the National Assembly OpenAPI to retrieve legal information using the Go language. It covers HTTP requests and data structure definitions.
Hello, this is StatPan.
I'm writing a development log for the LegiNote side project.
Please refer to the following link for the previous installment.
The fourth LegiNote development log; I'd like to talk about infrastructure setup, a slightly different topic from before.
To develop a service, you need server resources to run it.
Of course, unless you plan to continuously operate the service beyond just gaining experience, you can consider using your personal PC or free-tier services offered by various companies.
You can temporarily use the free tiers offered by major clouds such as AWS, Azure, and GCP, or consider hosting services like Cafe24 and Gabia.
Among them, I chose Oracle Cloud's Free Tier. It arguably has the best free-tier policy among cloud services.
To summarize,
I can use a VM with 4 OCPU, 24GB of RAM, and 200GB of SSD full-time for the service (traffic isn't unlimited, but if you use that much, you'll probably need a paid service).
However, to use this VM, you have to pass the infamous Oracle card registration test.
Thus, I acquired one 24/7 uninterrupted VM.
Resources Still Feeling Insufficient
During development, one node is insufficient.
From my experience, I need resources that allow me to separate deployment for development and operation.
Unfortunately, the Oracle free tier allows only one (in the standard case), so I wanted to acquire more 24/7 VMs.
Alternative to VM: Mini PC
To have specifications equivalent to the Oracle Free Tier service and operate 24/7, I needed a server with sufficient performance and low power consumption for continuous operation.
While searching for information on this, the most helpful resource I found was DC Gallery (a Korean online community).
From candidates like n100, eqr6, and ser8, I chose eqr6 because I wanted similar specs to the VM, and I bought the server at a very low price.
Barebone eqr6: 240,000 KRW
SSD 256GB: 22,000 KRW
RAM 8GB * 2: 18,000 KRW
Total: 280,000 KRW
Considering that a similar spec VM would cost roughly the same amount for 1-2 years of uninterrupted service, I considered it a worthwhile purchase.
Up to this point, it was smooth sailing... but...
The Beginning of the Problems
Delivery That Takes Forever
Yes, these mini PCs don't arrive quickly in today's world of 1-2 day shipping.
The two weeks waiting for delivery felt like an eternity. I began to wonder if I'd been scammed by a Chinese company, when it finally arrived.
For those without experience setting up these PCs, I recommend spending the time reading helpful posts on the Mini PC Gallery in the meantime.
(Such as preparing a boot disk in addition to the included USB driver, preparing drivers to install, etc.)
Mini PC Assembly
Yes, assembling the mini PC was a unique experience. I'd built my own desktop before, so I thought it would be easy, but the mini PC's small chassis packed with various components made it more difficult than expected. Getting stuck screws out was particularly challenging.
To remove a screw, I slightly disassembled the power supply, and because it was loosely connected, the power would turn off even with slight shaking. Many funny incidents like this happened.
Looking back, it was pain disguised as a fond memory.
Mini PC Setup
This was a battle with the BIOS. After installing Ubuntu, the system automatically allocated 8GB to VRAM, leaving only 8GB of usable memory.
Since I intended to use it as a server and barely needed VRAM, I struggled to find the setting in the old BIOS menu to fix this. The BIOS version was so old that the online guides didn't match well.
Eventually, I found an obscure YouTube video and finally solved it.
I would like to express my gratitude to the anonymous developer...
Home Network Setup
I use SK Broadband, but since I wasn't present during the installation, I didn't know the specifics and only had experience with KT Broadband. So I took it lightly.
In other words, I only considered using a router extending from one modem.
However, SK uniquely has a separate modem directly connected to a public IP, and a separate modem (router) located in the living room.
Initially unaware of this, the living room router and the room router kept using different bands, making me think the room router was faulty. I don't know how many times I reset it.
After searching, I discovered the existence of the additional router and found the modem hidden in a secret space.
To take revenge for about a day's worth of suffering, I boldly bridged the modem with the public IP and tried to control the entire network by configuring the internal SK router as NAT. But, it wouldn't be fun if it was easy, so it threw a few curveballs.
For reasons still unknown, I ended up with two public IPs.
Having a separate IP for the service is personally satisfying, but I'm still getting used to this unique service philosophy compared to other internet providers.
If you're setting up a home network using SK Broadband, be aware of these key points to avoid major difficulties.
DDNS, DNS, and Port Forwarding
I think this wouldn't have been necessary if I'd gotten an additional Oracle VM, but it was a valuable learning experience.
Home IP addresses usually have dynamic IP addresses, so simply mapping the IP to a DNS server might require remapping with each router reset.
Routers often provide a DDNS service to address this.
The SK router doesn't directly provide this, and seems to recommend using a third-party service.
Fortunately, I use an ASUS router, so I used the built-in DDNS function in the ASUS router's admin panel without using a separate service and solved this problem by mapping it to the DNS server.
Thanks to my prior experience with DNS from purchasing a domain, I was able to do this smoothly.
Reflections After Solving the Problems
When only considering the cost of running a VM 24/7, it can seem quite expensive. But considering the cost and time spent on this initial setup, I understand why cloud services are so popular.
Nevertheless, for the continuous operation of this non-profit project and for personal learning, I plan to continuously improve this infrastructure.
Actually, there's currently no urgent need for scaling up users.
In the future, I will include content about the infrastructure supporting this project in my posts.
If you have similar concerns or plans, feel free to contact me.
This is StatPan!
Comments0