Re:Protohackers: Server Programming Challenge
by thunkle on Thursday September 08, 2022 @08:22PM
(#32773826)
I really like the idea, but the effort required to boot up a server is holding me back.
[ Parent
| on HN ]
Re:Protohackers: Server Programming Challenge
by vermilingua on Thursday September 08, 2022 @08:25PM
(#32773844)
It takes about 5min (including logging in and mistyping my MFA code twice) to spin up and SSH into a fresh EC2, another ~2min past that to have it accept git pushes. Depending on the language another 5-10min to set up automatic builds.
Consider it part of the challenge?
Re:Protohackers: Server Programming Challenge
by otachack on Thursday September 08, 2022 @09:01PM
(#32774068)
Agreed, there are several methods to spin a server and it offers a great learning experience for those that don't know it.
Re:Protohackers: Server Programming Challenge
by macintux on Thursday September 08, 2022 @09:30PM
(#32774254)
Exactly, I'm using it as an excuse to finally branch out into Terraform and non-AWS cloud providers.
Re:Protohackers: Server Programming Challenge
by mtlynch on Thursday September 08, 2022 @09:43PM
(#32774332)
If you're comfortable with Docker, fly.io makes it really easy to spin up a web server, and you can run three servers 24/7 under their free tier.
(not affiliated, just a happy customer)
Re:Protohackers: Server Programming Challenge
by Jtsummers on Thursday September 08, 2022 @10:32PM
(#32774624)
fly.io works well for this. Just tried it out on the smoke test problem.
Re:Protohackers: Server Programming Challenge
by renovator3 on Tuesday September 20, 2022 @09:22AM
(#32911295)
I'm trying to setup fly.io for Protohackers, but for some reason I keep on getting a 502 error, no matter what I do.
Here's my main.py and Dockerfile[0], if you feel like taking a look. The monitoring tab of fly.io didn't show any errors, or anything like that. Maybe I'm missing something obvious, but I can't really see what the issue could be.
Re:Protohackers: Server Programming Challenge
by Thaxll on Thursday September 08, 2022 @08:32PM
(#32773888)
https://ngrok.com/ or equivalent should make that easy, it will tunnel and expose a local TCP port to the internet.
Beside that I think Protohackers is an excellent idea.
Re:Protohackers: Server Programming Challenge
by mvolfik on Friday September 09, 2022 @12:04PM
(#32780920)
I'm not sure if ngrok would work - my understanding was that they only offer public domain names, which point to (a limited amount of) their IP addresses, and which client to route to is distinguished by HTTP Host header (eventually SNI). Which wouldn't be usable in this case, since you're dealing with raw TCP
Re:Protohackers: Server Programming Challenge
by jasmaa on Saturday September 10, 2022 @12:56AM
(#32787902)
FWIW my echo failed smoke test when I tried with ngrok using the IP I got from dig. Strange thing is that the server still received the test payloads over ngrok, and my echo passes when hosted on EC2. Not sure if it's something with ngrok or if there's some other incompatibility (I'm a windows user :/)
Re:Protohackers: Server Programming Challenge
by Thaxll on Friday September 09, 2022 @04:04PM
(#32784191)
I did not look at the implementation but since they offer pure TCP exposure it should work juste fine byt resolving the DNS, when you use a TCP service there is no host header in the protocol.
Re:Protohackers: Server Programming Challenge
by shaftoe444 on Friday September 09, 2022 @09:06AM
(#32778692)
Good tip, going to use this as an excuse to play with ngrok!
Re:Protohackers: Server Programming Challenge
by ellen364 on Friday September 09, 2022 @04:41AM
(#32776873)
I can see that the cloud hosting would be a sticking point if you aren’t familiar with it.
Luckily, for Protohackers you can use a really basic setup. I used Hetzner’s standard Ubuntu image, opened the nano text editor on the server, copy-pasted my Python code, then ran the program using the OS’s version of Python. Didn’t even run it in the background; just started the program and closed it when Protohackers reported the tests were done.