You Have 7 Hours to Run Time Sensitive Code, but your Laptop is in Another State and the Airflow DAG is Broken
The title of this article describes the exact situation I was in two nights ago. No access to my laptop, no process to automatically run my code within the next 7 hours. With a full schedule the following morning, there was no way for me to access my computer and run my code before the clock ran out.
To avoid pulling my private code from GitHub onto a friend’s laptop or any computer I don’t own, I had two options:
- Buy a new laptop
- Use my smart phone to come up with a solution through AWS
Amazon Lightsail Through my Smart Phone
Step one was to find a way to stand up a machine I can use to carry out pulling and running the code. I figured AWS must have a tool to make this seamless. Then, I found Amazon Lightsail. Within minutes, I was able to stand up a windows machine through AWS from my phone:
After the instance was up, the rest became trivial.
I pulled my code from my private GitHub repo:
Installed Python and all necessary requirements through the requirements.txt file:
Ran the code, pushed the output:
What amazes me most about this dense, stressful, journey is how powerful and ubiquitous intense computation and the internet have become. In a matter of hours, I was able to replicate the exact environment necessary to run my code all through my “cell phone” by contacting machines elsewhere in the world. The “phone” part of the name seems to be the thing used least when it comes to these powerful machines we keep in our pockets.