4 ms·
I really like the idea, but the effort required to boot up a server is holding me back.
by thunkle 4y ago
I really like the idea, but the effort required to boot up a server is holding me back.
- vermilingua 4y agoIt 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?
- Thaxll 4y agohttps://ngrok.com/ 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.
- deleted 4y ago[deleted]
- shaftoe444 4y agoGood tip, going to use this as an excuse to play with ngrok!
- mvolfik 4y agoI'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
- Thaxll 4y agoI 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.
- jasmaa 4y agoFWIW 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 :/)
- mtlynch 4y agoIf 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)
- Jtsummers 4y agofly.io works well for this. Just tried it out on the smoke test problem.
- renovator3 4y agoI'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. [0] https://pastebin.com/gSr3405x https://pastebin.com/gSr3405x
- ellen364 4y agoI 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.